Skip to contentSkip to conversation

riscv: Fix linking error when building u-boot-spl with no SMP support

PATCH New Leo Yu-Chi Liang 2 participants 2 messages Jun 29, 2020 – Jul 7, 2020 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: Fix linking error when building u-boot-spl with no SMP support

Switch off SMP support when building u-boot-spl would cause linking error as follow:
undefined reference to 'secondary hart relocate' and 'smp_call_function'. Add macro to wrap up proper code region that needs SMP configuration on.

Signed-off by: Leo Liang <[email protected]>
Cc: rick at andestech.com

---
 arch/riscv/cpu/start.S | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/cpu/start.S +2 -0
index 5f1c220..e3222b1 100644
@@ -191,6 +191,7 @@ spl_stack_gd_setup:
 	mv	sp, s0
 #endif
 
+#if CONFIG_IS_ENABLED(SMP)
 	/* set new stack and global data pointer on secondary harts */
 spl_secondary_hart_stack_gd_setup:
 	la	a0, secondary_hart_relocate
@@ -205,6 +206,7 @@ spl_secondary_hart_stack_gd_setup:
 	la	a0, secondary_harts_relocation_error
 	jal	printf
 	jal	hang
+#endif
 
 	/* set new global data pointer on main hart */
 1:	mv	gp, s0
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 riscv: Fix linking error when building u-boot-spl with no SMP support

Quoted 11 lines · Leo Yu-Chi Liang

Switch off SMP support when building u-boot-spl would cause linking error as follow:
undefined reference to 'secondary hart relocate' and 'smp_call_function'. Add macro to wrap up proper code region that needs SMP configuration on.

Signed-off by: Leo Liang <[email protected]>
Cc: rick at andestech.com

---
 arch/riscv/cpu/start.S | 2 ++
 1 file changed, 2 insertions(+)