[U-Boot] [PATCH 19/19] riscv: Allow U-Boot to run on hart 0 only
    Bin Meng 
    bmeng.cn at gmail.com
       
    Tue Nov 13 08:22:07 UTC 2018
    
    
  
Allow U-Boot to run on hart 0 only, and suspend other harts.
With this change, '-smp n' works on QEMU RISC-V board.
Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---
 arch/riscv/cpu/start.S | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index 9858058..fcb0466 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -46,6 +46,10 @@ _start:
 	/* mask all interrupts */
 	csrw	mie, zero
 
+	csrr t0, mhartid
+	beqz t0, call_board_init_f
+1:	j 1b
+
 /*
  * Set stackpointer in internal/ex RAM to call board_init_f
  */
-- 
2.7.4
    
    
More information about the U-Boot
mailing list