Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # SPDX-License-Identifier: GPL-2.0+
  2. ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TEGRA),yy)
  3. CONFIG_CPU_V7A=
  4. CONFIG_CPU_ARM720T=y
  5. endif
  6. # This selects which instruction set is used.
  7. arch-$(CONFIG_CPU_ARM720T) =-march=armv4
  8. arch-$(CONFIG_CPU_ARM920T) =-march=armv4t
  9. arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te
  10. arch-$(CONFIG_CPU_ARM946ES) =-march=armv5te
  11. arch-$(CONFIG_CPU_SA1100) =-march=armv4
  12. arch-$(CONFIG_CPU_PXA) =
  13. arch-$(CONFIG_CPU_ARM1136) =-march=armv5t
  14. arch-$(CONFIG_CPU_ARM1176) =-march=armv5t
  15. arch-$(CONFIG_CPU_V7A) =$(call cc-option, -march=armv7-a, \
  16. $(call cc-option, -march=armv7))
  17. arch-$(CONFIG_CPU_V7M) =-march=armv7-m
  18. arch-$(CONFIG_CPU_V7R) =-march=armv7-r
  19. arch-$(CONFIG_ARM64) =-march=armv8-a
  20. # On Tegra systems we must build SPL for the armv4 core on the device
  21. # but otherwise we can use the value in CONFIG_SYS_ARM_ARCH
  22. ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TEGRA),yy)
  23. arch-y += -D__LINUX_ARM_ARCH__=4
  24. else
  25. arch-y += -D__LINUX_ARM_ARCH__=$(CONFIG_SYS_ARM_ARCH)
  26. endif
  27. # Evaluate arch cc-option calls now
  28. arch-y := $(arch-y)
  29. # This selects how we optimise for the processor.
  30. tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
  31. tune-$(CONFIG_CPU_ARM920T) =
  32. tune-$(CONFIG_CPU_ARM926EJS) =
  33. tune-$(CONFIG_CPU_ARM946ES) =
  34. tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
  35. tune-$(CONFIG_CPU_PXA) =-mcpu=xscale
  36. tune-$(CONFIG_CPU_ARM1136) =
  37. tune-$(CONFIG_CPU_ARM1176) =
  38. tune-$(CONFIG_CPU_V7A) =-mtune=generic-armv7-a
  39. tune-$(CONFIG_CPU_V7R) =
  40. tune-$(CONFIG_ARM64) =
  41. # Evaluate tune cc-option calls now
  42. tune-y := $(tune-y)
  43. PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
  44. # Machine directory name. This list is sorted alphanumerically
  45. # by CONFIG_* macro name.
  46. machine-$(CONFIG_ARCH_ASPEED) += aspeed
  47. machine-$(CONFIG_ARCH_AT91) += at91
  48. machine-$(CONFIG_ARCH_BCM283X) += bcm283x
  49. machine-$(CONFIG_ARCH_BCMSTB) += bcmstb
  50. machine-$(CONFIG_ARCH_DAVINCI) += davinci
  51. machine-$(CONFIG_ARCH_EXYNOS) += exynos
  52. machine-$(CONFIG_ARCH_HIGHBANK) += highbank
  53. machine-$(CONFIG_ARCH_K3) += k3
  54. machine-$(CONFIG_ARCH_KEYSTONE) += keystone
  55. # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
  56. machine-$(CONFIG_KIRKWOOD) += kirkwood
  57. machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
  58. machine-$(CONFIG_ARCH_MESON) += meson
  59. machine-$(CONFIG_ARCH_MVEBU) += mvebu
  60. # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
  61. # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
  62. machine-$(CONFIG_ORION5X) += orion5x
  63. machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2
  64. machine-$(CONFIG_ARCH_OWL) += owl
  65. machine-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx
  66. machine-$(CONFIG_ARCH_SUNXI) += sunxi
  67. machine-$(CONFIG_ARCH_SNAPDRAGON) += snapdragon
  68. machine-$(CONFIG_ARCH_SOCFPGA) += socfpga
  69. machine-$(CONFIG_ARCH_RMOBILE) += rmobile
  70. machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
  71. machine-$(CONFIG_STM32) += stm32
  72. machine-$(CONFIG_ARCH_STM32MP) += stm32mp
  73. machine-$(CONFIG_TEGRA) += tegra
  74. machine-$(CONFIG_ARCH_UNIPHIER) += uniphier
  75. machine-$(CONFIG_ARCH_ZYNQ) += zynq
  76. machine-$(CONFIG_ARCH_ZYNQMP) += zynqmp
  77. machine-$(CONFIG_ARCH_VERSAL) += versal
  78. machine-$(CONFIG_ARCH_ZYNQMP_R5) += zynqmp-r5
  79. machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
  80. PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
  81. libs-y += $(machdirs)
  82. head-y := arch/arm/cpu/$(CPU)/start.o
  83. ifeq ($(CONFIG_SPL_BUILD),y)
  84. ifneq ($(CONFIG_SPL_START_S_PATH),)
  85. head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o
  86. endif
  87. endif
  88. libs-y += arch/arm/cpu/$(CPU)/
  89. libs-y += arch/arm/cpu/
  90. libs-y += arch/arm/lib/
  91. ifeq ($(CONFIG_SPL_BUILD),y)
  92. ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx5 mx6 mx7 mx35 imx8m imx8))
  93. libs-y += arch/arm/mach-imx/
  94. endif
  95. else
  96. ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs imx8m imx8 vf610))
  97. libs-y += arch/arm/mach-imx/
  98. endif
  99. endif
  100. ifneq (,$(filter $(SOC), kirkwood))
  101. libs-y += arch/arm/mach-mvebu/
  102. endif
  103. # deprecated
  104. -include $(machdirs)/config.mk