tizen 2.4 release
[kernel/u-boot-tm1.git] / board / armltd / integrator / split_by_variant.sh
1 #!/bin/sh
2
3 mkdir -p ${obj}include
4 mkdir -p ${obj}board/armltd/integrator
5
6 config_file=${obj}include/config.h
7
8 if [ "$1" = "ap" ]
9 then
10 # ---------------------------------------------------------
11 # Set the platform defines
12 # ---------------------------------------------------------
13 cat > ${config_file} << _EOF
14 /* Integrator configuration implied by Makefile target */
15 #define CONFIG_INTEGRATOR /* Integrator board */
16 #define CONFIG_ARCH_INTEGRATOR 1 /* Integrator/AP */
17 _EOF
18
19 # ---------------------------------------------------------
20 #       Set the core module defines according to Core Module
21 # ---------------------------------------------------------
22 cpu="arm_intcm"
23 variant="unknown core module"
24
25 if [ "$2" = "" ]
26 then
27         echo "$0:: No parameters - using arm_intcm"
28 else
29         case "$2" in
30         ap7_config)
31         cpu="arm_intcm"
32         variant="unported core module CM7TDMI"
33         ;;
34
35         ap966)
36         cpu="arm_intcm"
37         variant="unported core module CM966E-S"
38         ;;
39
40         ap922_config)
41         cpu="arm_intcm"
42         variant="unported core module CM922T"
43         ;;
44
45         integratorap_config     |       \
46         ap_config)
47         cpu="arm_intcm"
48         variant="unspecified core module"
49         ;;
50
51         ap720t_config)
52         cpu="arm720t"
53         echo "#define CONFIG_CM720T 1 /* CPU core is ARM720T */" \
54                 >> ${config_file}
55         variant="Core module CM720T"
56         ;;
57
58         ap922_XA10_config)
59         cpu="arm_intcm"
60         variant="unported core module CM922T_XA10"
61         echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \
62                 >> ${config_file}
63         ;;
64
65         ap920t_config)
66         cpu="arm920t"
67         variant="Core module CM920T"
68         echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \
69                 >> ${config_file}
70         ;;
71
72         ap926ejs_config)
73         cpu="arm926ejs"
74         variant="Core module CM926EJ-S"
75         echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \
76                 >> ${config_file}
77         ;;
78
79         ap946es_config)
80         cpu="arm946es"
81         variant="Core module CM946E-S"
82         echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \
83                 >> ${config_file}
84         ;;
85
86         *)
87         echo "$0:: Unknown core module"
88         variant="unknown core module"
89         cpu="arm_intcm"
90         ;;
91
92         esac
93 fi
94
95 case "$cpu" in
96         arm_intcm)
97         cat >> ${config_file} << _EOF
98 /* Core module undefined/not ported */
99 #define CONFIG_ARM_INTCM 1
100 #undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */
101 #undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */
102 #undef CONFIG_CM_REMAP /* CM may not support remapping */
103 #undef CONFIG_CM_INIT  /* CM may not have initialization reg */
104 #undef CONFIG_CM_TCRAM /* CM may not have TCRAM */
105 /* May not be processor without cache support */
106 #define CONFIG_SYS_NO_ICACHE 1
107 #define CONFIG_SYS_NO_DCACHE 1
108 _EOF
109         ;;
110
111         arm720t)
112         cat >> ${config_file} << _EOF
113 /* May not be processor without cache support */
114 #define CONFIG_SYS_NO_ICACHE 1
115 #define CONFIG_SYS_NO_DCACHE 1
116 _EOF
117         ;;
118 esac
119
120 else
121
122 # ---------------------------------------------------------
123 # Set the platform defines
124 # ---------------------------------------------------------
125 cat >> ${config_file} << _EOF
126 /* Integrator configuration implied by Makefile target */
127 #define CONFIG_INTEGRATOR /* Integrator board */
128 #define CONFIG_ARCH_CINTEGRATOR 1 /* Integrator/CP   */
129 _EOF
130
131 cpu="arm_intcm"
132 variant="unknown core module"
133
134 if [ "$2" = "" ]
135 then
136         echo "$0:: No parameters - using arm_intcm"
137 else
138         case "$2" in
139         ap966)
140         cpu="arm_intcm"
141         variant="unported core module CM966E-S"
142         ;;
143
144         ap922_config)
145         cpu="arm_intcm"
146         variant="unported core module CM922T"
147         ;;
148
149         integratorcp_config     |       \
150         cp_config)
151         cpu="arm_intcm"
152         variant="unspecified core module"
153         ;;
154
155         cp922_XA10_config)
156         cpu="arm_intcm"
157         variant="unported core module CM922T_XA10"
158         echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \
159                 >> ${config_file}
160         ;;
161
162         cp920t_config)
163         cpu="arm920t"
164         variant="Core module CM920T"
165         echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \
166                 >> ${config_file}
167         ;;
168
169         cp926ejs_config)
170         cpu="arm926ejs"
171         variant="Core module CM926EJ-S"
172         echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \
173                 >> ${config_file}
174         ;;
175
176
177         cp946es_config)
178         cpu="arm946es"
179         variant="Core module CM946E-S"
180         echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \
181                 >> ${config_file}
182         ;;
183
184         cp1136_config)
185         cpu="arm1136"
186         variant="Core module CM1136EJF-S"
187         echo "#define CONFIG_CM1136EJF_S 1 /* CPU core is ARM1136JF-S */" \
188                 >> ${config_file}
189         ;;
190
191         *)
192         echo "$0:: Unknown core module"
193         variant="unknown core module"
194         cpu="arm_intcm"
195         ;;
196
197         esac
198
199 fi
200
201 if [ "$cpu" = "arm_intcm" ]
202 then
203         cat >> ${config_file} << _EOF
204 /* Core module undefined/not ported */
205 #define CONFIG_ARM_INTCM 1
206 #undef CONFIG_CM_MULTIPLE_SSRAM /* CM may not have multiple SSRAM mapping */
207 #undef CONFIG_CM_SPD_DETECT /* CM may not support SPD query */
208 #undef CONFIG_CM_REMAP /* CM may not support remapping */
209 #undef CONFIG_CM_INIT /* CM may not have initialization reg */
210 #undef CONFIG_CM_TCRAM /* CM may not have TCRAM */
211 _EOF
212 fi
213
214 fi # ap
215
216 # ---------------------------------------------------------
217 # Complete the configuration
218 # ---------------------------------------------------------
219 $MKCONFIG -a -n "${2%%_config}" integrator$1 arm $cpu integrator armltd
220 echo "Variant: $variant with core $cpu"