FreeCalypso > hg > freecalypso-citrine
comparison cfgmagic/post-target @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children | 7c13c26f1aa4 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
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 751749*) | |
54 # Calypso Lite appears to be exactly the same as Calypso C035, | |
55 # but has only 256 KiB of IRAM instead of 512 KiB. Yet TI's | |
56 # firmware sources give it a different CHIPSET number. | |
57 # Let's try playing along... | |
58 CHIPSET=11 | |
59 DSP=36 | |
60 ;; | |
61 *) | |
62 echo "Error: unknown DBB_type=$DBB_type" 1>&2 | |
63 exit 1 | |
64 ;; | |
65 esac | |
66 export_to_c CHIPSET | |
67 export_to_c DSP | |
68 | |
69 if [ -z "$ABB_type" ] | |
70 then | |
71 echo "Error: target.$TARGET failed to define ABB_type" 1>&2 | |
72 exit 1 | |
73 fi | |
74 | |
75 case "$ABB_type" in | |
76 Iota*) | |
77 ANALOG=2 | |
78 ;; | |
79 Syren*) | |
80 ANALOG=3 | |
81 ;; | |
82 *) | |
83 echo "Error: unknown ABB_type=$ABB_type" 1>&2 | |
84 exit 1 | |
85 ;; | |
86 esac | |
87 export_to_c ANALOG | |
88 | |
89 if [ -z "$RF_type" ] | |
90 then | |
91 echo "Error: target.$TARGET failed to define RF_type" 1>&2 | |
92 exit 1 | |
93 fi | |
94 | |
95 case "$RF_type" in | |
96 Rita*) | |
97 RF_FAM=12 | |
98 RF_PG=2 | |
99 ;; | |
100 *) | |
101 echo "Error: unknown RF_type=$RF_type" 1>&2 | |
102 exit 1 | |
103 ;; | |
104 esac | |
105 export_to_c RF_FAM | |
106 export_to_c RF_PG | |
107 | |
108 if [ -z "$RF_PA" ] | |
109 then | |
110 echo "Error: target.$TARGET failed to define RF_PA" 1>&2 | |
111 exit 1 | |
112 fi | |
113 export_to_c RF_PA | |
114 | |
115 if [ -z "$Flash_type" ] | |
116 then | |
117 echo "Error: target.$TARGET failed to define Flash_type" 1>&2 | |
118 exit 1 | |
119 fi | |
120 | |
121 case "$Flash_type" in | |
122 AMD-multi*) | |
123 FLASH_IS_AMD_MULTIBANK=1 | |
124 export_to_c FLASH_IS_AMD_MULTIBANK | |
125 ;; | |
126 Intel-single* | Intel-one*) | |
127 FLASH_IS_INTEL_ONEBANK=1 | |
128 export_to_c FLASH_IS_INTEL_ONEBANK | |
129 export_to_mk FLASH_IS_INTEL_ONEBANK | |
130 ;; | |
131 *) | |
132 echo "Error: unknown Flash_type=$Flash_type" 1>&2 | |
133 exit 1 | |
134 ;; | |
135 esac | |
136 | |
137 # !!! Dirty hack !!! | |
138 # | |
139 # All targets which we currently support or have realistic prospects of | |
140 # supporting are derived from TI's D-sample and/or Leonardo reference designs. | |
141 # TI's voodoo BOARD number for D-sample is 41, and Leonardo apparently | |
142 # shared D-sample's number instead of having its own. | |
143 # My initial hope was to keep those BOARD conditionals out of our code, | |
144 # but they are sprinkled so liberally throughout TI's code that it's | |
145 # too much extra work to reshape them into something cleaner. | |
146 # So for now let's export a #define BOARD 41 for all targets | |
147 # and leave it be. | |
148 | |
149 BOARD=41 | |
150 export_to_c BOARD |