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