blob: 1e59705ac054ace92a32f02bec1bd7231d713fdf [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2Date: Fri, 4 Mar 2022 09:23:34 +0100
3Subject: [PATCH] Assume TPL support for ATF when compiling U-Boot without TPL
4MIME-Version: 1.0
5Content-Type: text/plain; charset=UTF-8
6Content-Transfer-Encoding: 8bit
7
8Broadcom's U-Boot behaviour depends on compilation time check whether
9TPL was compiled with or without ATF support. There is no proper runtime
10check.
11
12When compiling just U-Boot (without SPL & TPL) there is no way to tell
13if it's going to work with TPL with or without ATF support.
14
15Modify code to blindly assume ATF support in TPL in such cases. It seems
16to be always true for Broadcom and we need some assumption as we don't
17deal with compiling SPL or TPL.
18
19Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
20---
21 arch/arm/mach-bcmbca/bcm4908/cpu.c | 2 +-
22 board/broadcom/bcmbca/board.c | 4 ++--
23 2 files changed, 3 insertions(+), 3 deletions(-)
24
25--- a/arch/arm/mach-bcmbca/bcm4908/cpu.c
26+++ b/arch/arm/mach-bcmbca/bcm4908/cpu.c
27@@ -138,7 +138,7 @@ int get_nr_cpus()
28 return nr_cpus;
29 }
30
31-#if !defined(CONFIG_TPL_ATF)
32+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
33 void boot_secondary_cpu(unsigned long vector)
34 {
35 uint32_t cpu, nr_cpus = QUAD_CPUS;
36--- a/board/broadcom/bcmbca/board.c
37+++ b/board/broadcom/bcmbca/board.c
38@@ -103,7 +103,7 @@ void board_spinor_init(void)
39
40 int board_init(void)
41 {
42-#if !defined(CONFIG_TPL_ATF)
43+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
44 unsigned long vector;
45 #endif
46 board_sdk_init_e();
47@@ -121,7 +121,7 @@ int board_init(void)
48 printf("$Uboot: "BUILD_TAG" $\n");
49 #endif
50
51-#if !defined(CONFIG_TPL_ATF)
52+#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
53 #if defined(CONFIG_ARM64)
54 vector = (unsigned long)&_start;
55 #else