uboot-build-default-toolchain-path.patch
[u-boot-openmoko/mini2440.git] / board / integratorcp / split_by_variant.sh
blob79a6a9d55d59652460e50926706cc9579859d866
1 #!/bin/sh
2 # ---------------------------------------------------------
3 # Set the platform defines
4 # ---------------------------------------------------------
5 echo -n "/* Integrator configuration implied " > tmp.fil
6 echo " by Makefile target */" >> tmp.fil
7 echo -n "#define CONFIG_INTEGRATOR" >> tmp.fil
8 echo " /* Integrator board */" >> tmp.fil
9 echo -n "#define CONFIG_ARCH_CINTEGRATOR" >> tmp.fil
10 echo " 1 /* Integrator/CP */" >> tmp.fil
12 cpu="arm_intcm"
13 variant="unknown core module"
15 if [ "$1" = "" ]
16 then
17 echo "$0:: No parameters - using arm_intcm"
18 else
19 case "$1" in
20 ap966)
21 cpu="arm_intcm"
22 variant="unported core module CM966E-S"
25 ap922_config)
26 cpu="arm_intcm"
27 variant="unported core module CM922T"
30 integratorcp_config | \
31 cp_config)
32 cpu="arm_intcm"
33 variant="unspecified core module"
36 cp922_XA10_config)
37 cpu="arm_intcm"
38 variant="unported core module CM922T_XA10"
39 echo -n "#define CONFIG_CM922T_XA10" >> tmp.fil
40 echo " 1 /* CPU core is ARM922T_XA10 */" >> tmp.fil
43 cp920t_config)
44 cpu="arm920t"
45 variant="Core module CM920T"
46 echo -n "#define CONFIG_CM920T" >> tmp.fil
47 echo " 1 /* CPU core is ARM920T */" >> tmp.fil
50 cp926ejs_config)
51 cpu="arm926ejs"
52 variant="Core module CM926EJ-S"
53 echo -n "#define CONFIG_CM926EJ_S" >> tmp.fil
54 echo " 1 /* CPU core is ARM926EJ-S */ " >> tmp.fil
58 cp946es_config)
59 cpu="arm946es"
60 variant="Core module CM946E-S"
61 echo -n "#define CONFIG_CM946E_S" >> tmp.fil
62 echo " 1 /* CPU core is ARM946E-S */ " >> tmp.fil
65 cp1136_config)
66 cpu="arm1136"
67 variant="Core module CM1136EJF-S"
68 echo -n "#define CONFIG_CM1136EJF_S" >> tmp.fil
69 echo " 1 /* CPU core is ARM1136JF-S */ " >> tmp.fil
73 echo "$0:: Unknown core module"
74 variant="unknown core module"
75 cpu="arm_intcm"
78 esac
82 if [ "$cpu" = "arm_intcm" ]
83 then
84 echo "/* Core module undefined/not ported */" >> tmp.fil
85 echo "#define CONFIG_ARM_INTCM 1" >> tmp.fil
86 echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> tmp.fil
87 echo -n " /* CM may not have " >> tmp.fil
88 echo "multiple SSRAM mapping */" >> tmp.fil
89 echo -n "#undef CONFIG_CM_SPD_DETECT " >> tmp.fil
90 echo -n " /* CM may not support SPD " >> tmp.fil
91 echo "query */" >> tmp.fil
92 echo -n "#undef CONFIG_CM_REMAP " >> tmp.fil
93 echo -n " /* CM may not support " >> tmp.fil
94 echo "remapping */" >> tmp.fil
95 echo -n "#undef CONFIG_CM_INIT " >> tmp.fil
96 echo -n " /* CM may not have " >> tmp.fil
97 echo "initialization reg */" >> tmp.fil
98 echo -n "#undef CONFIG_CM_TCRAM " >> tmp.fil
99 echo " /* CM may not have TCRAM */" >> tmp.fil
102 mkdir -p ${obj}include
103 mkdir -p ${obj}board/integratorcp
104 mv tmp.fil ${obj}include/config.h
105 # ---------------------------------------------------------
106 # Ensure correct core object loaded first in U-Boot image
107 # ---------------------------------------------------------
108 sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/integratorcp/u-boot.lds.template > ${obj}board/integratorcp/u-boot.lds
109 # ---------------------------------------------------------
110 # Complete the configuration
111 # ---------------------------------------------------------
112 $MKCONFIG -a integratorcp arm $cpu integratorcp;
113 echo "Variant:: $variant with core $cpu"