split_by_variant.sh 6.5 KB

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