1e19db555SDaniel Schwierzeck# SPDX-License-Identifier: GPL-2.0+ 2e19db555SDaniel Schwierzeck 3bf71a29cSMasahiro Yamadaifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TEGRA),yy) 4acf15001SLokesh VutlaCONFIG_CPU_V7A= 5bf71a29cSMasahiro YamadaCONFIG_CPU_ARM720T=y 6bf71a29cSMasahiro Yamadaendif 7bf71a29cSMasahiro Yamada 879d75d75SMasahiro Yamada# This selects which instruction set is used. 979d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_ARM720T) =-march=armv4 1002499e4eSDavid Müller (ELSOFT AG)arch-$(CONFIG_CPU_ARM920T) =-march=armv4t 1179d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te 12626f6e4fSMarek Vasutarch-$(CONFIG_CPU_ARM946ES) =-march=armv5te 1379d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_SA1100) =-march=armv4 1479d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_PXA) = 1579d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_ARM1136) =-march=armv5 1679d75d75SMasahiro Yamadaarch-$(CONFIG_CPU_ARM1176) =-march=armv5t 17acf15001SLokesh Vutlaarch-$(CONFIG_CPU_V7A) =$(call cc-option, -march=armv7-a, \ 18de39dc71SAdam Ford $(call cc-option, -march=armv7)) 19ea37f0b3STom Riniarch-$(CONFIG_CPU_V7M) =-march=armv7-m 204bbd6b1dSMichal Simekarch-$(CONFIG_CPU_V7R) =-march=armv7-r 2179d75d75SMasahiro Yamadaarch-$(CONFIG_ARM64) =-march=armv8-a 2279d75d75SMasahiro Yamada 23a78cd861STom Rini# On Tegra systems we must build SPL for the armv4 core on the device 24a78cd861STom Rini# but otherwise we can use the value in CONFIG_SYS_ARM_ARCH 25a78cd861STom Riniifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TEGRA),yy) 26a78cd861STom Riniarch-y += -D__LINUX_ARM_ARCH__=4 27a78cd861STom Rinielse 28a78cd861STom Riniarch-y += -D__LINUX_ARM_ARCH__=$(CONFIG_SYS_ARM_ARCH) 29a78cd861STom Riniendif 30a78cd861STom Rini 3179d75d75SMasahiro Yamada# Evaluate arch cc-option calls now 3279d75d75SMasahiro Yamadaarch-y := $(arch-y) 3379d75d75SMasahiro Yamada 3479d75d75SMasahiro Yamada# This selects how we optimise for the processor. 3579d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi 3679d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM920T) = 3779d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM926EJS) = 3879d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM946ES) = 3979d75d75SMasahiro Yamadatune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100 4079d75d75SMasahiro Yamadatune-$(CONFIG_CPU_PXA) =-mcpu=xscale 4179d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM1136) = 4279d75d75SMasahiro Yamadatune-$(CONFIG_CPU_ARM1176) = 43de39dc71SAdam Fordtune-$(CONFIG_CPU_V7A) =-mtune=generic-armv7-a 444bbd6b1dSMichal Simektune-$(CONFIG_CPU_V7R) = 4579d75d75SMasahiro Yamadatune-$(CONFIG_ARM64) = 4679d75d75SMasahiro Yamada 4779d75d75SMasahiro Yamada# Evaluate tune cc-option calls now 4879d75d75SMasahiro Yamadatune-y := $(tune-y) 4979d75d75SMasahiro Yamada 5079d75d75SMasahiro YamadaPLATFORM_CPPFLAGS += $(arch-y) $(tune-y) 5179d75d75SMasahiro Yamada 5201f14456SMasahiro Yamada# Machine directory name. This list is sorted alphanumerically 5301f14456SMasahiro Yamada# by CONFIG_* macro name. 544697abeaSmaxims@google.commachine-$(CONFIG_ARCH_ASPEED) += aspeed 5562011840SMasahiro Yamadamachine-$(CONFIG_ARCH_AT91) += at91 56ddf6bd48SMasahiro Yamadamachine-$(CONFIG_ARCH_BCM283X) += bcm283x 57894c3ad2SThomas Fitzsimmonsmachine-$(CONFIG_ARCH_BCMSTB) += bcmstb 58601fbec7SMasahiro Yamadamachine-$(CONFIG_ARCH_DAVINCI) += davinci 5977b55e8cSThomas Abrahammachine-$(CONFIG_ARCH_EXYNOS) += exynos 6072a8ff4bSMasahiro Yamadamachine-$(CONFIG_ARCH_HIGHBANK) += highbank 61586bde93SLokesh Vutlamachine-$(CONFIG_ARCH_K3) += k3 6239a72345SMasahiro Yamadamachine-$(CONFIG_ARCH_KEYSTONE) += keystone 6356f86e39SMasahiro Yamada# TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD 6456f86e39SMasahiro Yamadamachine-$(CONFIG_KIRKWOOD) += kirkwood 65cbd2fba1SRyder Leemachine-$(CONFIG_ARCH_MEDIATEK) += mediatek 66bfcef28aSBeniamino Galvanimachine-$(CONFIG_ARCH_MESON) += meson 6781e33f4bSStefan Roesemachine-$(CONFIG_ARCH_MVEBU) += mvebu 6809f455dcSMasahiro Yamada# TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA 693e93b4e6SMasahiro Yamada# TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X 703e93b4e6SMasahiro Yamadamachine-$(CONFIG_ORION5X) += orion5x 71a93fbf4aSMasahiro Yamadamachine-$(CONFIG_ARCH_OMAP2PLUS) += omap2 7297775d26SManivannan Sadhasivammachine-$(CONFIG_ARCH_OWL) += owl 73225f5eecSMinkyu Kangmachine-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx 74e6e505b9SAlexander Grafmachine-$(CONFIG_ARCH_SUNXI) += sunxi 7508592136SMateusz Kulikowskimachine-$(CONFIG_ARCH_SNAPDRAGON) += snapdragon 7605a21721SMasahiro Yamadamachine-$(CONFIG_ARCH_SOCFPGA) += socfpga 771cc95f6eSNobuhiro Iwamatsumachine-$(CONFIG_ARCH_RMOBILE) += rmobile 782444dae5SSimon Glassmachine-$(CONFIG_ARCH_ROCKCHIP) += rockchip 790a61ee88SVikas Manochamachine-$(CONFIG_STM32) += stm32 802514c2d0SPatrick Delaunaymachine-$(CONFIG_ARCH_STM32MP) += stm32mp 8109f455dcSMasahiro Yamadamachine-$(CONFIG_TEGRA) += tegra 824c425570SMasahiro Yamadamachine-$(CONFIG_ARCH_UNIPHIER) += uniphier 835ca269a4SMasahiro Yamadamachine-$(CONFIG_ARCH_ZYNQ) += zynq 84274ccb5bSMichal Simekmachine-$(CONFIG_ARCH_ZYNQMP) += zynqmp 85ec48b6c9SMichal Simekmachine-$(CONFIG_ARCH_VERSAL) += versal 861d6c54ecSMichal Simekmachine-$(CONFIG_ARCH_ZYNQMP_R5) += zynqmp-r5 8701f14456SMasahiro Yamada 8801f14456SMasahiro Yamadamachdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) 8901f14456SMasahiro Yamada 9030ebf88fSMasahiro YamadaPLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) 9130ebf88fSMasahiro Yamada 9201f14456SMasahiro Yamadalibs-y += $(machdirs) 9301f14456SMasahiro Yamada 94e19db555SDaniel Schwierzeckhead-y := arch/arm/cpu/$(CPU)/start.o 95e19db555SDaniel Schwierzeck 96e19db555SDaniel Schwierzeckifeq ($(CONFIG_SPL_BUILD),y) 97e19db555SDaniel Schwierzeckifneq ($(CONFIG_SPL_START_S_PATH),) 98e19db555SDaniel Schwierzeckhead-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o 99e19db555SDaniel Schwierzeckendif 100e19db555SDaniel Schwierzeckendif 101e19db555SDaniel Schwierzeck 102e19db555SDaniel Schwierzecklibs-y += arch/arm/cpu/$(CPU)/ 103e19db555SDaniel Schwierzecklibs-y += arch/arm/cpu/ 104e19db555SDaniel Schwierzecklibs-y += arch/arm/lib/ 105e19db555SDaniel Schwierzeck 106e19db555SDaniel Schwierzeckifeq ($(CONFIG_SPL_BUILD),y) 107*c1e0940fSPeng Fanifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx5 mx6 mx7 mx35 imx8m imx8)) 108552a848eSStefano Babiclibs-y += arch/arm/mach-imx/ 109e19db555SDaniel Schwierzeckendif 110e19db555SDaniel Schwierzeckelse 111cd357ad1SPeng Fanifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs imx8m imx8 vf610)) 112552a848eSStefano Babiclibs-y += arch/arm/mach-imx/ 113e19db555SDaniel Schwierzeckendif 114e19db555SDaniel Schwierzeckendif 115e19db555SDaniel Schwierzeck 116d0787656SStefan Roeseifneq (,$(filter $(SOC), kirkwood)) 117d0787656SStefan Roeselibs-y += arch/arm/mach-mvebu/ 118e19db555SDaniel Schwierzeckendif 11901f14456SMasahiro Yamada 12001f14456SMasahiro Yamada# deprecated 12101f14456SMasahiro Yamada-include $(machdirs)/config.mk 122