annotate gsm-fw/cfgmagic/post-target @ 303:61c68a55f2a2

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