split_by_variant.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. cpu="arm_intcm"
  15. variant="unknown core module"
  16. if [ "$1" = "" ]
  17. then
  18. echo "$0:: No parameters - using arm_intcm"
  19. else
  20. case "$1" in
  21. ap7_config)
  22. cpu="arm_intcm"
  23. variant="unported core module CM7TDMI"
  24. ;;
  25. ap966)
  26. cpu="arm_intcm"
  27. variant="unported core module CM966E-S"
  28. ;;
  29. ap922_config)
  30. cpu="arm_intcm"
  31. variant="unported core module CM922T"
  32. ;;
  33. integratorap_config | \
  34. ap_config)
  35. cpu="arm_intcm"
  36. variant="unspecified core module"
  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. variant="Core module CM720T"
  43. ;;
  44. ap922_XA10_config)
  45. cpu="arm_intcm"
  46. variant="unported core module CM922T_XA10"
  47. echo -n "#define CONFIG_CM922T_XA10" >> tmp.fil
  48. echo " 1 /* CPU core is ARM922T_XA10 */" >> tmp.fil
  49. ;;
  50. ap920t_config)
  51. cpu="arm920t"
  52. variant="Core module CM920T"
  53. echo -n "#define CONFIG_CM920T" >> tmp.fil
  54. echo " 1 /* CPU core is ARM920T */" >> tmp.fil
  55. ;;
  56. ap926ejs_config)
  57. cpu="arm926ejs"
  58. variant="Core module CM926EJ-S"
  59. echo -n "#define CONFIG_CM926EJ_S" >> tmp.fil
  60. echo " 1 /* CPU core is ARM926EJ-S */ " >> tmp.fil
  61. ;;
  62. ap946es_config)
  63. cpu="arm946es"
  64. variant="Core module CM946E-S"
  65. echo -n "#define CONFIG_CM946E_S" >> tmp.fil
  66. echo " 1 /* CPU core is ARM946E-S */ " >> tmp.fil
  67. ;;
  68. *)
  69. echo "$0:: Unknown core module"
  70. variant="unknown core module"
  71. cpu="arm_intcm"
  72. ;;
  73. esac
  74. fi
  75. case "$cpu" in
  76. arm_intcm)
  77. echo "/* Core module undefined/not ported */" >> tmp.fil
  78. echo "#define CONFIG_ARM_INTCM 1" >> tmp.fil
  79. echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> tmp.fil
  80. echo -n " /* CM may not have " >> tmp.fil
  81. echo "multiple SSRAM mapping */" >> tmp.fil
  82. echo -n "#undef CONFIG_CM_SPD_DETECT " >> tmp.fil
  83. echo -n " /* CM may not support SPD " >> tmp.fil
  84. echo "query */" >> tmp.fil
  85. echo -n "#undef CONFIG_CM_REMAP " >> tmp.fil
  86. echo -n " /* CM may not support " >> tmp.fil
  87. echo "remapping */" >> tmp.fil
  88. echo -n "#undef CONFIG_CM_INIT " >> tmp.fil
  89. echo -n " /* CM may not have " >> tmp.fil
  90. echo "initialization reg */" >> tmp.fil
  91. echo -n "#undef CONFIG_CM_TCRAM " >> tmp.fil
  92. echo " /* CM may not have TCRAM */" >> tmp.fil
  93. echo -n " /* May not be processor " >> tmp.fil
  94. echo "without cache support */" >> tmp.fil
  95. echo "#define CONFIG_SYS_NO_ICACHE 1" >> tmp.fil
  96. echo "#define CONFIG_SYS_NO_DCACHE 1" >> tmp.fil
  97. ;;
  98. arm720t)
  99. echo -n " /* May not be processor " >> tmp.fil
  100. echo "without cache support */" >> tmp.fil
  101. echo "#define CONFIG_SYS_NO_ICACHE 1" >> tmp.fil
  102. echo "#define CONFIG_SYS_NO_DCACHE 1" >> tmp.fil
  103. ;;
  104. esac
  105. mkdir -p ${obj}include
  106. mkdir -p ${obj}board/armltd/integratorap
  107. mv tmp.fil ${obj}include/config.h
  108. # ---------------------------------------------------------
  109. # Ensure correct core object loaded first in U-Boot image
  110. # ---------------------------------------------------------
  111. sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/armltd/integratorap/u-boot.lds.template > ${obj}board/armltd/integratorap/u-boot.lds
  112. # ---------------------------------------------------------
  113. # Complete the configuration
  114. # ---------------------------------------------------------
  115. $MKCONFIG -a integratorap arm $cpu integratorap armltd;
  116. echo "Variant:: $variant with core $cpu"