diff options
author | Bin Meng <bin.meng@windriver.com> | 2020-08-03 09:09:01 +0300 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2020-08-14 09:38:53 +0300 |
commit | 71672b784cb6b3175d3849d28eebc2f3ed3c9d3c (patch) | |
tree | 2ba4f8a33f5921ff6a560266f4475a63ff36c24c /arch | |
parent | cdcf591d9b20534e5f5c58aa2a2b07b3b173f5a1 (diff) | |
download | u-boot-71672b784cb6b3175d3849d28eebc2f3ed3c9d3c.tar.xz |
riscv: Call spl_board_init_f() in the generic SPL board_init_f()
The generic SPL version of board_init_f() should give a call to
board specific codes to initialize board in the SPL phase.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Tested-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/include/asm/spl.h | 7 | ||||
-rw-r--r-- | arch/riscv/lib/spl.c | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h index 45c03fb9b6..1487f2d910 100644 --- a/arch/riscv/include/asm/spl.h +++ b/arch/riscv/include/asm/spl.h @@ -28,4 +28,11 @@ enum { BOOT_DEVICE_NONE }; +/** + * spl_board_init_f() - initialize board in the SPL phase + * + * @return 0 if succeeded, -ve on error + */ +int spl_board_init_f(void); + #endif diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c index c47dcd46ce..e24ec5a46c 100644 --- a/arch/riscv/lib/spl.c +++ b/arch/riscv/lib/spl.c @@ -13,6 +13,11 @@ DECLARE_GLOBAL_DATA_PTR; +__weak int spl_board_init_f(void) +{ + return 0; +} + __weak void board_init_f(ulong dummy) { int ret; @@ -24,6 +29,10 @@ __weak void board_init_f(ulong dummy) arch_cpu_init_dm(); preloader_console_init(); + + ret = spl_board_init_f(); + if (ret) + panic("spl_board_init_f() failed: %d\n", ret); } void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) |