diff options
| author | Tom Rini <[email protected]> | 2023-10-10 08:54:17 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-10-10 08:54:17 -0400 |
| commit | 833ff23047c50e4053fb1bda21f4e2c9f6a3aa6a (patch) | |
| tree | 422a1ac1688b75a6c4edcbaa2024346acbaddfb8 /common | |
| parent | d9bb6d779b69c2548891e568e5e2a23e1b7eedaa (diff) | |
| parent | 3f876cb7c57511174d1b6a3e089443ccbaf236ec (diff) | |
Merge branch '2023-10-09-assorted-fixes'
- Cleanup how we pick what to launch in SPL, a few test changes, some TI
K3 platform updates, top-level Makefile fixes and related cleanup,
correct a problem with LMB overlap, other assorted fixes.
Diffstat (limited to 'common')
| -rw-r--r-- | common/spl/spl.c | 12 | ||||
| -rw-r--r-- | common/spl/spl_atf.c | 8 | ||||
| -rw-r--r-- | common/stdio.c | 6 |
3 files changed, 14 insertions, 12 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 0cf887fd626..66eeea41a34 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -643,6 +643,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2) BOOT_DEVICE_NONE, BOOT_DEVICE_NONE, }; + typedef void __noreturn (*jump_to_image_t)(struct spl_image_info *); + jump_to_image_t jump_to_image = &jump_to_image_no_args; struct spl_image_info spl_image; int ret, os; @@ -731,20 +733,20 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } else if (CONFIG_IS_ENABLED(ATF) && os == IH_OS_ARM_TRUSTED_FIRMWARE) { debug("Jumping to U-Boot via ARM Trusted Firmware\n"); spl_fixup_fdt(spl_image_fdt_addr(&spl_image)); - spl_invoke_atf(&spl_image); + jump_to_image = &spl_invoke_atf; } else if (CONFIG_IS_ENABLED(OPTEE_IMAGE) && os == IH_OS_TEE) { debug("Jumping to U-Boot via OP-TEE\n"); spl_board_prepare_for_optee(spl_image_fdt_addr(&spl_image)); - jump_to_image_optee(&spl_image); + jump_to_image = &jump_to_image_optee; } else if (CONFIG_IS_ENABLED(OPENSBI) && os == IH_OS_OPENSBI) { debug("Jumping to U-Boot via RISC-V OpenSBI\n"); - spl_invoke_opensbi(&spl_image); + jump_to_image = &spl_invoke_opensbi; } else if (CONFIG_IS_ENABLED(OS_BOOT) && os == IH_OS_LINUX) { debug("Jumping to Linux\n"); if (IS_ENABLED(CONFIG_SPL_OS_BOOT)) spl_fixup_fdt((void *)SPL_PAYLOAD_ARGS_ADDR); spl_board_prepare_for_linux(); - jump_to_image_linux(&spl_image); + jump_to_image = &jump_to_image_linux; } else { debug("Unsupported OS image.. Jumping nevertheless..\n"); } @@ -784,7 +786,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } spl_board_prepare_for_boot(); - jump_to_image_no_args(&spl_image); + jump_to_image(&spl_image); } /* diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 2c10252834f..3bdd013a35f 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -187,10 +187,10 @@ static inline void raw_write_daif(unsigned int daif) __asm__ __volatile__("msr DAIF, %x0\n\t" : : "r" (daif) : "memory"); } -typedef void (*atf_entry_t)(struct bl31_params *params, void *plat_params); +typedef void __noreturn (*atf_entry_t)(struct bl31_params *params, void *plat_params); -static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry, - uintptr_t bl33_entry, uintptr_t fdt_addr) +static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry, + uintptr_t bl33_entry, uintptr_t fdt_addr) { atf_entry_t atf_entry = (atf_entry_t)bl31_entry; void *bl31_params; @@ -251,7 +251,7 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node) return val; } -void spl_invoke_atf(struct spl_image_info *spl_image) +void __noreturn spl_invoke_atf(struct spl_image_info *spl_image) { uintptr_t bl32_entry = 0; uintptr_t bl33_entry = CONFIG_TEXT_BASE; diff --git a/common/stdio.c b/common/stdio.c index 010bf576af0..e3354f092dc 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -259,7 +259,7 @@ int stdio_register(struct stdio_dev *dev) int stdio_deregister_dev(struct stdio_dev *dev, int force) { struct list_head *pos; - char temp_names[3][16]; + char temp_names[3][STDIO_NAME_LEN]; int i; /* get stdio devices (ListRemoveItem changes the dev list) */ @@ -272,8 +272,8 @@ int stdio_deregister_dev(struct stdio_dev *dev, int force) /* Device is assigned -> report error */ return -EBUSY; } - memcpy(&temp_names[i][0], stdio_devices[i]->name, - sizeof(temp_names[i])); + strlcpy(&temp_names[i][0], stdio_devices[i]->name, + sizeof(temp_names[i])); } list_del(&dev->list); |
