split_by_variant.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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
  11. cpu="arm_intcm"
  12. variant="unknown core module"
  13. if [ "$1" = "" ]
  14. then
  15. echo "$0:: No parameters - using arm_intcm"
  16. else
  17. case "$1" in
  18. ap966)
  19. cpu="arm_intcm"
  20. variant="unported core module CM966E-S"
  21. ;;
  22. ap922_config)
  23. cpu="arm_intcm"
  24. variant="unported core module CM922T"
  25. ;;
  26. integratorcp_config | \
  27. cp_config)
  28. cpu="arm_intcm"
  29. variant="unspecified core module"
  30. ;;
  31. cp922_XA10_config)
  32. cpu="arm_intcm"
  33. variant="unported core module CM922T_XA10"
  34. echo -n "#define CONFIG_CM922T_XA10" >> tmp.fil
  35. echo " 1 /* CPU core is ARM922T_XA10 */" >> tmp.fil
  36. ;;
  37. cp920t_config)
  38. cpu="arm920t"
  39. variant="Core module CM920T"
  40. echo -n "#define CONFIG_CM920T" >> tmp.fil
  41. echo " 1 /* CPU core is ARM920T */" >> tmp.fil
  42. ;;
  43. cp926ejs_config)
  44. cpu="arm926ejs"
  45. variant="Core module CM926EJ-S"
  46. echo -n "#define CONFIG_CM926EJ_S" >> tmp.fil
  47. echo " 1 /* CPU core is ARM926EJ-S */ " >> tmp.fil
  48. ;;
  49. cp946es_config)
  50. cpu="arm946es"
  51. variant="Core module CM946E-S"
  52. echo -n "#define CONFIG_CM946E_S" >> tmp.fil
  53. echo " 1 /* CPU core is ARM946E-S */ " >> tmp.fil
  54. ;;
  55. cp1136_config)
  56. cpu="arm1136"
  57. variant="Core module CM1136EJF-S"
  58. echo -n "#define CONFIG_CM1136EJF_S" >> tmp.fil
  59. echo " 1 /* CPU core is ARM1136JF-S */ " >> tmp.fil
  60. ;;
  61. *)
  62. echo "$0:: Unknown core module"
  63. variant="unknown core module"
  64. cpu="arm_intcm"
  65. ;;
  66. esac
  67. fi
  68. if [ "$cpu" = "arm_intcm" ]
  69. then
  70. echo "/* Core module undefined/not ported */" >> tmp.fil
  71. echo "#define CONFIG_ARM_INTCM 1" >> tmp.fil
  72. echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> tmp.fil
  73. echo -n " /* CM may not have " >> tmp.fil
  74. echo "multiple SSRAM mapping */" >> tmp.fil
  75. echo -n "#undef CONFIG_CM_SPD_DETECT " >> tmp.fil
  76. echo -n " /* CM may not support SPD " >> tmp.fil
  77. echo "query */" >> tmp.fil
  78. echo -n "#undef CONFIG_CM_REMAP " >> tmp.fil
  79. echo -n " /* CM may not support " >> tmp.fil
  80. echo "remapping */" >> tmp.fil
  81. echo -n "#undef CONFIG_CM_INIT " >> tmp.fil
  82. echo -n " /* CM may not have " >> tmp.fil
  83. echo "initialization reg */" >> tmp.fil
  84. echo -n "#undef CONFIG_CM_TCRAM " >> tmp.fil
  85. echo " /* CM may not have TCRAM */" >> tmp.fil
  86. fi
  87. mkdir -p ${obj}include
  88. mkdir -p ${obj}board/armltd/integratorcp
  89. mv tmp.fil ${obj}include/config.h
  90. # ---------------------------------------------------------
  91. # Ensure correct core object loaded first in U-Boot image
  92. # ---------------------------------------------------------
  93. sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/armltd/integratorcp/u-boot.lds.template > ${obj}board/armltd/integratorcp/u-boot.lds
  94. # ---------------------------------------------------------
  95. # Complete the configuration
  96. # ---------------------------------------------------------
  97. $MKCONFIG -a integratorcp arm $cpu integratorcp armltd;
  98. echo "Variant:: $variant with core $cpu"