public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/6] riscv: Call spl_board_init_f() in the generic SPL board_init_f()
@ 2020-08-03  6:09 Bin Meng
  2020-08-03  6:09 ` [PATCH 2/6] riscv: sifive/fu540: spl: Drop our own version of board_init_f() Bin Meng
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Bin Meng @ 2020-08-03  6:09 UTC (permalink / raw)
  To: u-boot

From: Bin Meng <bin.meng@windriver.com>

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>
---

 arch/riscv/include/asm/spl.h | 7 +++++++
 arch/riscv/lib/spl.c         | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h
index 45c03fb..1487f2d 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 c47dcd4..e24ec5a 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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-08-06  8:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03  6:09 [PATCH 1/6] riscv: Call spl_board_init_f() in the generic SPL board_init_f() Bin Meng
2020-08-03  6:09 ` [PATCH 2/6] riscv: sifive/fu540: spl: Drop our own version of board_init_f() Bin Meng
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA4730102@ATCPCS16.andestech.com>
2020-08-04  3:36     ` Rick Chen
2020-08-06  7:37   ` Pragnesh Patel
2020-08-03  6:09 ` [PATCH 3/6] riscv: sifive/fu540: spl: Rename soc_spl_init() Bin Meng
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA473144C@ATCPCS16.andestech.com>
2020-08-06  3:29     ` Rick Chen
2020-08-06  7:38   ` Pragnesh Patel
2020-08-03  6:09 ` [PATCH 4/6] riscv: sifive/fu540: kconfig: Move FU540 driver related options to the SoC level Bin Meng
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA4731460@ATCPCS16.andestech.com>
2020-08-06  6:13     ` Rick Chen
2020-08-06  7:40   ` Pragnesh Patel
2020-08-03  6:09 ` [PATCH 5/6] riscv: sifive/fu540: Drop NET_RANDOM_ETHADDR Bin Meng
2020-08-06  3:35   ` Leo Liang
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA47314C2@ATCPCS16.andestech.com>
2020-08-06  6:56     ` Rick Chen
2020-08-06  7:40   ` Pragnesh Patel
2020-08-03  6:09 ` [PATCH 6/6] riscv: sifive/fu540: Move SPL related functions to spl.c Bin Meng
2020-08-06  3:36   ` Leo Liang
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA47314C9@ATCPCS16.andestech.com>
2020-08-06  7:00     ` Rick Chen
2020-08-06  8:10       ` Bin Meng
2020-08-06  7:42   ` Pragnesh Patel
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA47300EA@ATCPCS16.andestech.com>
2020-08-04  3:20   ` [PATCH 1/6] riscv: Call spl_board_init_f() in the generic SPL board_init_f() Rick Chen
2020-08-06  7:37 ` Pragnesh Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox