Cleanup
[platform/kernel/u-boot.git] / board / integratorap / split_by_variant.sh
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_INTEGRATOR"        >> tmp.fil
10 echo     " 1 /* Integrator/AP   */"             >> tmp.fil
11 # ---------------------------------------------------------
12 #  Set the core module defines according to Core Module
13 # ---------------------------------------------------------
14 CC=${CROSS_COMPILE}gcc
15 cpu="arm_intcm"
16
17 if [ "$2" == "" ]
18 then
19         echo "$0:: No preprocessor parameter - using ${CROSS_COMPILE}gcc"
20 else
21         CC=$2
22 fi
23
24
25 if [ "$1" == "" ]
26 then
27         echo "$0:: No parameters - using ${CROSS_COMPILE}gcc arm_intcm"
28 else
29         case "$1" in
30         ap7_config              |       \
31         ap966_config            |       \
32         ap922_config            |       \
33         integratorap_config     |       \
34         ap_config)
35         cpu="arm_intcm"
36         ;;
37
38         ap720t_config)
39         cpu="arm720t"
40         echo -n "#define CONFIG_CM720T"         >> tmp.fil
41         echo    " 1 /* CPU core is ARM720T */ " >> tmp.fil
42         ;;
43
44         ap922_XA10_config)
45         echo -n "#define CONFIG_CM922T_XA10"            >> tmp.fil
46         echo    " 1 /* CPU core is ARM922T_XA10 */"     >> tmp.fil
47         cpu="arm_intcm"
48         ;;
49
50         ap920t_config)
51         cpu="arm920t"
52         echo -n "#define CONFIG_CM920T"                 >> tmp.fil
53         echo    " 1 /* CPU core is ARM920T */"          >> tmp.fil
54         ;;
55
56         ap926ejs_config)
57         cpu="arm926ejs"
58         echo -n "#define CONFIG_CM926EJ_S"              >> tmp.fil
59         echo    " 1 /* CPU core is ARM926EJ-S */ "      >> tmp.fil
60         ;;
61
62
63         ap946es_config)
64         cpu="arm946es"
65         echo -n "#define CONFIG_CM946E_S"               >> tmp.fil
66         echo    " 1 /* CPU core is ARM946E-S */ "       >> tmp.fil
67         ;;
68
69         *)
70         echo "$0:: Unrecognised target - using arm_intcm"
71         cpu="arm_intcm"
72         ;;
73
74         esac
75
76 fi
77
78 if [ "$cpu" == "arm_intcm" ]
79 then
80         echo "/* Core module undefined/not ported */"   >> tmp.fil
81         echo "#define CONFIG_ARM_INTCM 1"               >> tmp.fil
82         echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM"       >> tmp.fil
83         echo -n "  /* CM may not have "                 >> tmp.fil
84         echo    "multiple SSRAM mapping */"             >> tmp.fil
85         echo -n "#undef CONFIG_CM_SPD_DETECT "          >> tmp.fil
86         echo -n " /* CM may not support SPD "           >> tmp.fil
87         echo    "query */"                              >> tmp.fil
88         echo -n "#undef CONFIG_CM_REMAP  "              >> tmp.fil
89         echo -n " /* CM may not support "               >> tmp.fil
90         echo    "remapping */"                          >> tmp.fil
91         echo -n "#undef CONFIG_CM_INIT  "               >> tmp.fil
92         echo -n " /* CM may not have  "                 >> tmp.fil
93         echo    "initialization reg */"                 >> tmp.fil
94         echo -n "#undef CONFIG_CM_TCRAM  "              >> tmp.fil
95         echo    " /* CM may not have TCRAM */"          >> tmp.fil
96 fi
97 mv tmp.fil ./include/config.h
98 # ---------------------------------------------------------
99 #  Ensure correct core object loaded first in U-Boot image
100 # ---------------------------------------------------------
101 $CC -E -P -C -D CPU_FILE=cpu/$cpu/start.o               \
102 -o board/integratorap/u-boot.lds board/integratorap/u-boot.lds.S
103 # ---------------------------------------------------------
104 # Complete the configuration
105 # ---------------------------------------------------------
106 ./mkconfig -a integratorap arm $cpu integratorap;