blob: d869dd2b75be2a60f397e1569dca15ccd691f843 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +02001#!/bin/sh
2
3mkdir -p ${obj}include
4mkdir -p ${obj}board/armltd/integrator
5
6config_file=${obj}include/config.h
7
8if [ "$1" = "ap" ]
9then
10# ---------------------------------------------------------
11# Set the platform defines
12# ---------------------------------------------------------
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020013cat > ${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
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020019# ---------------------------------------------------------
20# Set the core module defines according to Core Module
21# ---------------------------------------------------------
22cpu="arm_intcm"
23variant="unknown core module"
24
25if [ "$2" = "" ]
26then
27 echo "$0:: No parameters - using arm_intcm"
28else
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"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020053 echo "#define CONFIG_CM720T 1 /* CPU core is ARM720T */" \
54 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020055 variant="Core module CM720T"
56 ;;
57
58 ap922_XA10_config)
59 cpu="arm_intcm"
60 variant="unported core module CM922T_XA10"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020061 echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \
62 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020063 ;;
64
65 ap920t_config)
66 cpu="arm920t"
67 variant="Core module CM920T"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020068 echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \
69 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020070 ;;
71
72 ap926ejs_config)
73 cpu="arm926ejs"
74 variant="Core module CM926EJ-S"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020075 echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \
76 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020077 ;;
78
79 ap946es_config)
80 cpu="arm946es"
81 variant="Core module CM946E-S"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020082 echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \
83 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +020084 ;;
85
86 *)
87 echo "$0:: Unknown core module"
88 variant="unknown core module"
89 cpu="arm_intcm"
90 ;;
91
92 esac
93fi
94
95case "$cpu" in
96 arm_intcm)
Andreas Bießmannb38a33b2010-09-24 21:20:40 +020097 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
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200109 ;;
110
111 arm720t)
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200112 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
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200117 ;;
118esac
119
120else
121
122# ---------------------------------------------------------
123# Set the platform defines
124# ---------------------------------------------------------
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200125cat >> ${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
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200130
131cpu="arm_intcm"
132variant="unknown core module"
133
134if [ "$2" = "" ]
135then
136 echo "$0:: No parameters - using arm_intcm"
137else
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"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200158 echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \
159 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200160 ;;
161
162 cp920t_config)
163 cpu="arm920t"
164 variant="Core module CM920T"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200165 echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \
166 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200167 ;;
168
169 cp926ejs_config)
170 cpu="arm926ejs"
171 variant="Core module CM926EJ-S"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200172 echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \
173 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200174 ;;
175
176
177 cp946es_config)
178 cpu="arm946es"
179 variant="Core module CM946E-S"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200180 echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \
181 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200182 ;;
183
184 cp1136_config)
185 cpu="arm1136"
186 variant="Core module CM1136EJF-S"
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200187 echo "#define CONFIG_CM1136EJF_S 1 /* CPU core is ARM1136JF-S */" \
188 >> ${config_file}
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200189 ;;
190
191 *)
192 echo "$0:: Unknown core module"
193 variant="unknown core module"
194 cpu="arm_intcm"
195 ;;
196
197 esac
198
199fi
200
201if [ "$cpu" = "arm_intcm" ]
202then
Andreas Bießmannb38a33b2010-09-24 21:20:40 +0200203 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
Jean-Christophe PLAGNIOL-VILLARD693a7ae2009-05-17 00:58:37 +0200212fi
213
214fi # ap
215
216# ---------------------------------------------------------
217# Complete the configuration
218# ---------------------------------------------------------
Wolfgang Denk749dba72009-07-18 22:09:38 +0200219$MKCONFIG -a -n "${2%%_config}" integrator$1 arm $cpu integrator armltd
220echo "Variant: $variant with core $cpu"