split_by_variant.sh 3.1 KB

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