Prepare v2023.10
[platform/kernel/u-boot.git] / arch / arm / Makefile
1 # SPDX-License-Identifier: GPL-2.0+
2
3 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
4 CONFIG_CPU_V7A=
5 CONFIG_CPU_ARM720T=y
6 endif
7
8 # This selects which instruction set is used.
9 arch-$(CONFIG_CPU_ARM720T)      =-march=armv4
10 arch-$(CONFIG_CPU_ARM920T)      =-march=armv4t
11 arch-$(CONFIG_CPU_ARM926EJS)    =-march=armv5te
12 arch-$(CONFIG_CPU_ARM946ES)     =-march=armv5te
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 ifeq ($(CONFIG_ARM64_CRC32),y)
20 arch-$(CONFIG_ARM64)            =-march=armv8-a+crc
21 else
22 arch-$(CONFIG_ARM64)            =-march=armv8-a
23 endif
24
25 # On Tegra systems we must build SPL for the armv4 core on the device
26 # but otherwise we can use the value in CONFIG_SYS_ARM_ARCH
27 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
28 arch-y += -D__LINUX_ARM_ARCH__=4
29 else
30 arch-y += -D__LINUX_ARM_ARCH__=$(CONFIG_SYS_ARM_ARCH)
31 endif
32
33 # Evaluate arch cc-option calls now
34 arch-y := $(arch-y)
35
36 # This selects how we optimise for the processor.
37 tune-$(CONFIG_CPU_ARM720T)      =-mtune=arm7tdmi
38 tune-$(CONFIG_CPU_ARM920T)      =
39 tune-$(CONFIG_CPU_ARM926EJS)    =
40 tune-$(CONFIG_CPU_ARM946ES)     =
41 tune-$(CONFIG_CPU_ARM1136)      =
42 tune-$(CONFIG_CPU_ARM1176)      =
43 tune-$(CONFIG_CPU_V7A)          =-mtune=generic-armv7-a
44 tune-$(CONFIG_CPU_V7R)          =
45 tune-$(CONFIG_ARM64)            =
46
47 # Evaluate tune cc-option calls now
48 tune-y := $(tune-y)
49
50 PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
51
52 # Machine directory name.  This list is sorted alphanumerically
53 # by CONFIG_* macro name.
54 machine-$(CONFIG_ARCH_APPLE)            += apple
55 machine-$(CONFIG_ARCH_ASPEED)           += aspeed
56 machine-$(CONFIG_ARCH_AT91)             += at91
57 machine-$(CONFIG_ARCH_BCM283X)          += bcm283x
58 machine-$(CONFIG_ARCH_BCMBCA)           += bcmbca
59 machine-$(CONFIG_ARCH_BCMSTB)           += bcmstb
60 machine-$(CONFIG_ARCH_DAVINCI)          += davinci
61 machine-$(CONFIG_ARCH_EXYNOS)           += exynos
62 machine-$(CONFIG_ARCH_GXP)              += hpe
63 machine-$(CONFIG_ARCH_HIGHBANK)         += highbank
64 machine-$(CONFIG_ARCH_HISTB)            += histb
65 machine-$(CONFIG_ARCH_IPQ40XX)          += ipq40xx
66 machine-$(CONFIG_ARCH_K3)               += k3
67 machine-$(CONFIG_ARCH_KEYSTONE)         += keystone
68 machine-$(CONFIG_ARCH_KIRKWOOD)         += kirkwood
69 machine-$(CONFIG_ARCH_LPC32XX)          += lpc32xx
70 machine-$(CONFIG_ARCH_MEDIATEK)         += mediatek
71 machine-$(CONFIG_ARCH_MESON)            += meson
72 machine-$(CONFIG_ARCH_MVEBU)            += mvebu
73 machine-$(CONFIG_ARCH_NEXELL)           += nexell
74 machine-$(CONFIG_ARCH_NPCM)             += npcm
75 machine-$(CONFIG_ARCH_OMAP2PLUS)        += omap2
76 machine-$(CONFIG_ARCH_ORION5X)          += orion5x
77 machine-$(CONFIG_ARCH_OWL)              += owl
78 machine-$(CONFIG_ARCH_RMOBILE)          += rmobile
79 machine-$(CONFIG_ARCH_ROCKCHIP)         += rockchip
80 machine-$(CONFIG_ARCH_S5PC1XX)          += s5pc1xx
81 machine-$(CONFIG_ARCH_SNAPDRAGON)       += snapdragon
82 machine-$(CONFIG_ARCH_SOCFPGA)          += socfpga
83 machine-$(CONFIG_ARCH_STM32)            += stm32
84 machine-$(CONFIG_ARCH_STM32MP)          += stm32mp
85 machine-$(CONFIG_ARCH_SUNXI)            += sunxi
86 machine-$(CONFIG_ARCH_TEGRA)            += tegra
87 machine-$(CONFIG_ARCH_U8500)            += u8500
88 machine-$(CONFIG_ARCH_OCTEONTX)         += octeontx
89 machine-$(CONFIG_ARCH_OCTEONTX2)        += octeontx2
90 machine-$(CONFIG_ARCH_UNIPHIER)         += uniphier
91 machine-$(CONFIG_ARCH_VERSAL)           += versal
92 machine-$(CONFIG_ARCH_VERSAL_NET)       += versal-net
93 machine-$(CONFIG_ARCH_ZYNQ)             += zynq
94 machine-$(CONFIG_ARCH_ZYNQMP)           += zynqmp
95 machine-$(CONFIG_ARCH_ZYNQMP_R5)        += zynqmp-r5
96
97 machine-$(CONFIG_MACH_IMX)              += imx
98
99 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
100
101 PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
102
103 libs-y += $(machdirs)
104
105 head-y := arch/arm/cpu/$(CPU)/start.o
106
107 ifeq ($(CONFIG_SPL_BUILD),y)
108 ifeq ($(CONFIG_SYS_SOC)$(CONFIG_SPL_FRAMEWORK),"mxs")
109 head-y := arch/arm/cpu/arm926ejs/mxs/start.o
110 endif
111 endif
112
113 libs-y += arch/arm/cpu/$(CPU)/
114 libs-y += arch/arm/cpu/
115 libs-y += arch/arm/lib/
116
117 ifneq (,$(filter $(SOC), kirkwood))
118 libs-y += arch/arm/mach-mvebu/
119 endif
120
121 # deprecated
122 -include $(machdirs)/config.mk