b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 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 | 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 |