comparison gsm-fw/cfgmagic/post-target @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/cfgmagic/post-target@1e41550feec5
children 47754cdb6248
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 # This shell script fragment is sourced after the selected target.
2 # Here we'll put code that logically goes with the target hw-related
3 # stuff, but which we wish to avoid duplicating in every target.*
4 # fragment.
5
6 # The per-target fragment must have defined CONFIG_IRAM_SIZE, CONFIG_XRAM_SIZE
7 # and CONFIG_FWFLASH_SIZE.
8 if [ -z "$CONFIG_IRAM_SIZE" ]
9 then
10 echo "Error: target.$TARGET failed to define CONFIG_IRAM_SIZE" 1>&2
11 exit 1
12 fi
13
14 if [ -z "$CONFIG_XRAM_SIZE" ]
15 then
16 echo "Error: target.$TARGET failed to define CONFIG_XRAM_SIZE" 1>&2
17 exit 1
18 fi
19
20 if [ -z "$CONFIG_FWFLASH_SIZE" ]
21 then
22 echo "Error: target.$TARGET failed to define CONFIG_FWFLASH_SIZE" 1>&2
23 exit 1
24 fi
25
26 # export them to C and to the m4-based ld script generation logic
27 export_to_c CONFIG_IRAM_SIZE
28 export_to_m4 CONFIG_IRAM_SIZE
29 export_to_c CONFIG_XRAM_SIZE
30 export_to_m4 CONFIG_XRAM_SIZE
31 export_to_c CONFIG_FWFLASH_SIZE
32 export_to_m4 CONFIG_FWFLASH_SIZE
33
34 # Because we'll be using a lot of TI's code that is very liberally sprinkled
35 # with conditionals on their voodoo numbers for CHIPSET etc, we really have
36 # no choice but to continue using these nasty numbers, at least where
37 # possible.
38
39 if [ -z "$DBB_type" ]
40 then
41 echo "Error: target.$TARGET failed to define DBB_type" 1>&2
42 exit 1
43 fi
44
45 case "$DBB_type" in
46 751992*)
47 # This chip is Calypso C035 with DSP version 36 in the ROM
48 CHIPSET=10
49 DSP=36
50 # Thanks to the Sotovik find, we now have authoritative
51 # knowledge that these numbers are correct.
52 ;;
53 *)
54 echo "Error: unknown DBB_type=$DBB_type" 1>&2
55 exit 1
56 ;;
57 esac
58 export_to_c CHIPSET
59 export_to_c DSP
60
61 if [ -z "$ABB_type" ]
62 then
63 echo "Error: target.$TARGET failed to define ABB_type" 1>&2
64 exit 1
65 fi
66
67 case "$ABB_type" in
68 Iota*)
69 ANALOG=2
70 ;;
71 Syren*)
72 ANALOG=3
73 ;;
74 *)
75 echo "Error: unknown ABB_type=$ABB_type" 1>&2
76 exit 1
77 ;;
78 esac
79 export_to_c ANALOG
80
81 if [ -z "$RF_type" ]
82 then
83 echo "Error: target.$TARGET failed to define RF_type" 1>&2
84 exit 1
85 fi
86
87 case "$RF_type" in
88 Rita*)
89 RF_FAM=12
90 ;;
91 *)
92 echo "Error: unknown RF_type=$RF_type" 1>&2
93 exit 1
94 ;;
95 esac
96 export_to_c RF_FAM
97
98 # !!! Dirty hack !!!
99 #
100 # All targets which we currently support or have realistic prospects of
101 # supporting are derived from TI's D-sample and/or Leonardo reference designs.
102 # TI's voodoo BOARD number for D-sample is 41, and Leonardo apparently
103 # shared D-sample's number instead of having its own.
104 # My initial hope was to keep those BOARD conditionals out of our code,
105 # but they are sprinkled so liberally throughout TI's code that it's
106 # too much extra work to reshape them into something cleaner.
107 # So for now let's export a #define BOARD 41 for all targets
108 # and leave it be.
109
110 BOARD=41
111 export_to_c BOARD
112
113 # Ensure that device_class is set - various feature configurations
114 # will certainly depend on it.
115 if [ -z "$device_class" ]
116 then
117 echo "Error: target.$TARGET failed to define device_class" 1>&2
118 exit 1
119 fi