blob: caabf804b2f2fd950752ba9ccc04b77fdae2abd3 [file] [log] [blame]
Andrew Geisslerea144b032023-01-27 16:03:57 -06001From 07cc3e4af3def76d92faf39712d4fd8717b21d2b Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Peter Hoyes <Peter.Hoyes@arm.com>
3Date: Fri, 10 Dec 2021 11:41:19 +0000
4Subject: [PATCH 3/9] armv8: Allow disabling exception vectors on non-SPL
5 builds
6
7On the BASER_FVP, U-Boot shares EL2 with another bootloader, so we do
8not wish to overide the exception vector, but we are also not using an
9SPL build.
10
11Therefore, add ARMV8_EXCEPTION_VECTORS, which disables exception vectors
12in a similar way to ARMV8_SPL_EXCEPTION_VECTORS.
13
14Rename ARMV8_SPL_EXCEPTION_VECTORS -> SPL_ARMV8_EXCEPTION_VECTORS so
15that both config flags be be targeted using CONFIG_IS_ENABLED.
16
17Issue-Id: SCM-3728
18Upstream-Status: Inappropriate [other]
19 Implementation pending further discussion
20Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
21Change-Id: I0cf0fc6d7ef4d45791411cf1f67c65e198cc8b2b
22---
23 arch/arm/cpu/armv8/Kconfig | 10 ++++++++--
24 arch/arm/cpu/armv8/Makefile | 6 ++----
25 arch/arm/cpu/armv8/start.S | 4 ++--
26 configs/vexpress_aemv8r_defconfig | 1 +
27 4 files changed, 13 insertions(+), 8 deletions(-)
28
29diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -060030index 1305238c9d..dec4be0e30 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040031--- a/arch/arm/cpu/armv8/Kconfig
32+++ b/arch/arm/cpu/armv8/Kconfig
33@@ -1,8 +1,8 @@
34 if ARM64
35
36-config ARMV8_SPL_EXCEPTION_VECTORS
37+config ARMV8_EXCEPTION_VECTORS
38 bool "Install crash dump exception vectors"
39- depends on SPL
40+ default y
41 help
42 The default exception vector table is only used for the crash
43 dump, but still takes quite a lot of space in the image size.
44@@ -10,6 +10,12 @@ config ARMV8_SPL_EXCEPTION_VECTORS
45 Say N here if you are running out of code space in the image
46 and want to save some space at the cost of less debugging info.
47
48+config SPL_ARMV8_EXCEPTION_VECTORS
49+ bool "Install crash dump exception vectors in the SPL"
50+ depends on SPL
51+ help
52+ Same as ARMV8_EXCEPTION_VECTORS, but for SPL builds
53+
54 config ARMV8_MULTIENTRY
55 bool "Enable multiple CPUs to enter into U-Boot"
56
57diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
Andrew Geisslerea144b032023-01-27 16:03:57 -060058index 2e4bf9e038..001a31cae7 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040059--- a/arch/arm/cpu/armv8/Makefile
60+++ b/arch/arm/cpu/armv8/Makefile
61@@ -13,10 +13,8 @@ ifndef CONFIG_$(SPL_)SYS_DCACHE_OFF
62 obj-y += cache_v8.o
63 obj-y += cache.o
64 endif
65-ifdef CONFIG_SPL_BUILD
66-obj-$(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) += exceptions.o
67-else
68-obj-y += exceptions.o
69+obj-$(CONFIG_$(SPL_)ARMV8_EXCEPTION_VECTORS) += exceptions.o
70+ifndef CONFIG_SPL_BUILD
71 obj-y += exception_level.o
72 endif
73 obj-y += tlb.o
74diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
75index 28f0df13f0..f831e77af3 100644
76--- a/arch/arm/cpu/armv8/start.S
77+++ b/arch/arm/cpu/armv8/start.S
78@@ -104,7 +104,7 @@ pie_skip_reloc:
79 pie_fixup_done:
80 #endif
81
82-#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
83+#if CONFIG_IS_ENABLED(ARMV8_EXCEPTION_VECTORS)
84 .macro set_vbar, regname, reg
85 msr \regname, \reg
86 .endm
87@@ -354,7 +354,7 @@ ENDPROC(smp_kick_all_cpus)
88 /*-----------------------------------------------------------------------*/
89
90 ENTRY(c_runtime_cpu_setup)
91-#if defined(CONFIG_ARMV8_SPL_EXCEPTION_VECTORS) || !defined(CONFIG_SPL_BUILD)
92+#if CONFIG_IS_ENABLED(ARMV8_EXCEPTION_VECTORS)
93 /* Relocate vBAR */
94 adr x0, vectors
95 switch_el x1, 3f, 2f, 1f
96diff --git a/configs/vexpress_aemv8r_defconfig b/configs/vexpress_aemv8r_defconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -060097index 495eb1dee3..683d983c36 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040098--- a/configs/vexpress_aemv8r_defconfig
99+++ b/configs/vexpress_aemv8r_defconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -0600100@@ -16,3 +16,4 @@ CONFIG_SYS_CBSIZE=512
101 CONFIG_SYS_PBSIZE=541
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400102 # CONFIG_MMC is not set
103 CONFIG_VIRTIO_MMIO=y
104+CONFIG_ARMV8_EXCEPTION_VECTORS=n
105--
1062.25.1
107