Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 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 | # --------------------------------------------------------- |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 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 | |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 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" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 53 | echo "#define CONFIG_CM720T 1 /* CPU core is ARM720T */" \ |
| 54 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 55 | variant="Core module CM720T" |
| 56 | ;; |
| 57 | |
| 58 | ap922_XA10_config) |
| 59 | cpu="arm_intcm" |
| 60 | variant="unported core module CM922T_XA10" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 61 | echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \ |
| 62 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 63 | ;; |
| 64 | |
| 65 | ap920t_config) |
| 66 | cpu="arm920t" |
| 67 | variant="Core module CM920T" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 68 | echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \ |
| 69 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 70 | ;; |
| 71 | |
| 72 | ap926ejs_config) |
| 73 | cpu="arm926ejs" |
| 74 | variant="Core module CM926EJ-S" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 75 | echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \ |
| 76 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 77 | ;; |
| 78 | |
| 79 | ap946es_config) |
| 80 | cpu="arm946es" |
| 81 | variant="Core module CM946E-S" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 82 | echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \ |
| 83 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 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) |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 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 |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 109 | ;; |
| 110 | |
| 111 | arm720t) |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 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 |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 117 | ;; |
| 118 | esac |
| 119 | |
| 120 | else |
| 121 | |
| 122 | # --------------------------------------------------------- |
| 123 | # Set the platform defines |
| 124 | # --------------------------------------------------------- |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 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 |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 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" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 158 | echo "#define CONFIG_CM922T_XA10 1 /* CPU core is ARM922T_XA10 */" \ |
| 159 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 160 | ;; |
| 161 | |
| 162 | cp920t_config) |
| 163 | cpu="arm920t" |
| 164 | variant="Core module CM920T" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 165 | echo "#define CONFIG_CM920T 1 /* CPU core is ARM920T */" \ |
| 166 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 167 | ;; |
| 168 | |
| 169 | cp926ejs_config) |
| 170 | cpu="arm926ejs" |
| 171 | variant="Core module CM926EJ-S" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 172 | echo "#define CONFIG_CM926EJ_S 1 /* CPU core is ARM926EJ-S */" \ |
| 173 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 174 | ;; |
| 175 | |
| 176 | |
| 177 | cp946es_config) |
| 178 | cpu="arm946es" |
| 179 | variant="Core module CM946E-S" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 180 | echo "#define CONFIG_CM946E_S 1 /* CPU core is ARM946E-S */" \ |
| 181 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 182 | ;; |
| 183 | |
| 184 | cp1136_config) |
| 185 | cpu="arm1136" |
| 186 | variant="Core module CM1136EJF-S" |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 187 | echo "#define CONFIG_CM1136EJF_S 1 /* CPU core is ARM1136JF-S */" \ |
| 188 | >> ${config_file} |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 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 |
Andreas Bießmann | b38a33b | 2010-09-24 21:20:40 +0200 | [diff] [blame] | 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 |
Jean-Christophe PLAGNIOL-VILLARD | 693a7ae | 2009-05-17 00:58:37 +0200 | [diff] [blame] | 212 | fi |
| 213 | |
| 214 | fi # ap |
| 215 | |
| 216 | # --------------------------------------------------------- |
| 217 | # Complete the configuration |
| 218 | # --------------------------------------------------------- |
Wolfgang Denk | 749dba7 | 2009-07-18 22:09:38 +0200 | [diff] [blame] | 219 | $MKCONFIG -a -n "${2%%_config}" integrator$1 arm $cpu integrator armltd |
| 220 | echo "Variant: $variant with core $cpu" |