Commit bf71a29c8e611a5c7f18d0572edeae82189dd3a2

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 4adb46a314

ARM: fix arch/arm/Makefile for Tegra

Since commit 79d75d752717 (ARM: move -march=* and -mtune= options to
arch/arm/Makefile), all the Tegra boards are broken because the SPL
is built for ARMv7.

Insert Tegra-specific code to arch/arm/Makefile to set compiler
flags for an earlier ARM architecture.

Note:
The v1 patch for commit 79d75d752717 *was* correct when it was
submitted.  Notice it was originally written for multi .config
configuration where Kconfig set CONFIG_CPU_V7/CONFIG_CPU_ARM720T for
Tegra U-Boot Main/SPL, respectively.  But, until it was merged into
the mainline, commit e02ee2548afe (kconfig: switch to single .config
configuration) had been already applied there.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Stephen Warren <swarren@nvidia.com>
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>

Showing 1 changed file with 5 additions and 0 deletions Inline Diff

1 # 1 #
2 # SPDX-License-Identifier: GPL-2.0+ 2 # SPDX-License-Identifier: GPL-2.0+
3 # 3 #
4 4
5 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TEGRA),yy)
6 CONFIG_CPU_V7=
7 CONFIG_CPU_ARM720T=y
8 endif
9
5 # This selects which instruction set is used. 10 # This selects which instruction set is used.
6 arch-$(CONFIG_CPU_ARM720T) =-march=armv4 11 arch-$(CONFIG_CPU_ARM720T) =-march=armv4
7 arch-$(CONFIG_CPU_ARM920T) =-march=armv4 12 arch-$(CONFIG_CPU_ARM920T) =-march=armv4
8 arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te 13 arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te
9 arch-$(CONFIG_CPU_ARM946ES) =-march=armv4 14 arch-$(CONFIG_CPU_ARM946ES) =-march=armv4
10 arch-$(CONFIG_CPU_SA1100) =-march=armv4 15 arch-$(CONFIG_CPU_SA1100) =-march=armv4
11 arch-$(CONFIG_CPU_PXA) = 16 arch-$(CONFIG_CPU_PXA) =
12 arch-$(CONFIG_CPU_ARM1136) =-march=armv5 17 arch-$(CONFIG_CPU_ARM1136) =-march=armv5
13 arch-$(CONFIG_CPU_ARM1176) =-march=armv5t 18 arch-$(CONFIG_CPU_ARM1176) =-march=armv5t
14 arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, -march=armv5) 19 arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, -march=armv5)
15 arch-$(CONFIG_ARM64) =-march=armv8-a 20 arch-$(CONFIG_ARM64) =-march=armv8-a
16 21
17 # Evaluate arch cc-option calls now 22 # Evaluate arch cc-option calls now
18 arch-y := $(arch-y) 23 arch-y := $(arch-y)
19 24
20 # This selects how we optimise for the processor. 25 # This selects how we optimise for the processor.
21 tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi 26 tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
22 tune-$(CONFIG_CPU_ARM920T) = 27 tune-$(CONFIG_CPU_ARM920T) =
23 tune-$(CONFIG_CPU_ARM926EJS) = 28 tune-$(CONFIG_CPU_ARM926EJS) =
24 tune-$(CONFIG_CPU_ARM946ES) = 29 tune-$(CONFIG_CPU_ARM946ES) =
25 tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100 30 tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
26 tune-$(CONFIG_CPU_PXA) =-mcpu=xscale 31 tune-$(CONFIG_CPU_PXA) =-mcpu=xscale
27 tune-$(CONFIG_CPU_ARM1136) = 32 tune-$(CONFIG_CPU_ARM1136) =
28 tune-$(CONFIG_CPU_ARM1176) = 33 tune-$(CONFIG_CPU_ARM1176) =
29 tune-$(CONFIG_CPU_V7) = 34 tune-$(CONFIG_CPU_V7) =
30 tune-$(CONFIG_ARM64) = 35 tune-$(CONFIG_ARM64) =
31 36
32 # Evaluate tune cc-option calls now 37 # Evaluate tune cc-option calls now
33 tune-y := $(tune-y) 38 tune-y := $(tune-y)
34 39
35 PLATFORM_CPPFLAGS += $(arch-y) $(tune-y) 40 PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
36 41
37 # Machine directory name. This list is sorted alphanumerically 42 # Machine directory name. This list is sorted alphanumerically
38 # by CONFIG_* macro name. 43 # by CONFIG_* macro name.
39 machine-$(CONFIG_ARCH_AT91) += at91 44 machine-$(CONFIG_ARCH_AT91) += at91
40 machine-$(CONFIG_ARCH_BCM283X) += bcm283x 45 machine-$(CONFIG_ARCH_BCM283X) += bcm283x
41 machine-$(CONFIG_ARCH_DAVINCI) += davinci 46 machine-$(CONFIG_ARCH_DAVINCI) += davinci
42 machine-$(CONFIG_ARCH_HIGHBANK) += highbank 47 machine-$(CONFIG_ARCH_HIGHBANK) += highbank
43 machine-$(CONFIG_ARCH_KEYSTONE) += keystone 48 machine-$(CONFIG_ARCH_KEYSTONE) += keystone
44 # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD 49 # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
45 machine-$(CONFIG_KIRKWOOD) += kirkwood 50 machine-$(CONFIG_KIRKWOOD) += kirkwood
46 # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA 51 # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
47 machine-$(CONFIG_ARCH_NOMADIK) += nomadik 52 machine-$(CONFIG_ARCH_NOMADIK) += nomadik
48 # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X 53 # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
49 machine-$(CONFIG_ORION5X) += orion5x 54 machine-$(CONFIG_ORION5X) += orion5x
50 machine-$(CONFIG_TEGRA) += tegra 55 machine-$(CONFIG_TEGRA) += tegra
51 machine-$(CONFIG_ARCH_UNIPHIER) += uniphier 56 machine-$(CONFIG_ARCH_UNIPHIER) += uniphier
52 machine-$(CONFIG_ARCH_VERSATILE) += versatile 57 machine-$(CONFIG_ARCH_VERSATILE) += versatile
53 58
54 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) 59 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
55 60
56 PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) 61 PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
57 62
58 libs-y += $(machdirs) 63 libs-y += $(machdirs)
59 64
60 head-y := arch/arm/cpu/$(CPU)/start.o 65 head-y := arch/arm/cpu/$(CPU)/start.o
61 66
62 ifeq ($(CONFIG_SPL_BUILD),y) 67 ifeq ($(CONFIG_SPL_BUILD),y)
63 ifneq ($(CONFIG_SPL_START_S_PATH),) 68 ifneq ($(CONFIG_SPL_START_S_PATH),)
64 head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o 69 head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o
65 endif 70 endif
66 endif 71 endif
67 72
68 libs-y += arch/arm/cpu/$(CPU)/ 73 libs-y += arch/arm/cpu/$(CPU)/
69 libs-y += arch/arm/cpu/ 74 libs-y += arch/arm/cpu/
70 libs-y += arch/arm/lib/ 75 libs-y += arch/arm/lib/
71 76
72 ifeq ($(CONFIG_SPL_BUILD),y) 77 ifeq ($(CONFIG_SPL_BUILD),y)
73 ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) 78 ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35))
74 libs-y += arch/arm/imx-common/ 79 libs-y += arch/arm/imx-common/
75 endif 80 endif
76 else 81 else
77 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) 82 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
78 libs-y += arch/arm/imx-common/ 83 libs-y += arch/arm/imx-common/
79 endif 84 endif
80 endif 85 endif
81 86
82 ifneq (,$(filter $(SOC), armada-xp kirkwood)) 87 ifneq (,$(filter $(SOC), armada-xp kirkwood))
83 libs-y += arch/arm/mvebu-common/ 88 libs-y += arch/arm/mvebu-common/
84 endif 89 endif
85 90
86 # deprecated 91 # deprecated
87 -include $(machdirs)/config.mk 92 -include $(machdirs)/config.mk
88 93