riscv: Merge unnecessary SMP ifdefs in start.S
[oweals/u-boot.git] / arch / riscv / cpu / start.S
index 0a2ce6d6913ed96868af9dbb6d1614fbbf9ada8a..ecf0482635b07fc410cac94dd4c0d4c375a93e61 100644 (file)
@@ -58,9 +58,7 @@ _start:
        /* tp: hart id */
        li      t0, CONFIG_NR_CPUS
        bge     tp, t0, hart_out_of_bounds_loop
-#endif
 
-#ifdef CONFIG_SMP
        /* set xSIE bit to receive IPIs */
 #if CONFIG_IS_ENABLED(RISCV_MMODE)
        li      t0, MIE_MSIE
@@ -174,7 +172,7 @@ spl_clear_bss:
 spl_clear_bss_loop:
        SREG    zero, 0(t0)
        addi    t0, t0, REGBYTES
-       bne     t0, t1, spl_clear_bss_loop
+       blt     t0, t1, spl_clear_bss_loop
 
 spl_stack_gd_setup:
        jal     spl_relocate_stack_gd
@@ -197,6 +195,7 @@ spl_secondary_hart_stack_gd_setup:
        la      a0, secondary_hart_relocate
        mv      a1, s0
        mv      a2, s0
+       mv      a3, zero
        jal     smp_call_function
 
        /* hang if relocation of secondary harts has failed */
@@ -216,7 +215,7 @@ spl_call_board_init_r:
 #endif
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
@@ -324,7 +323,7 @@ clear_bss:
 clbss_l:
        SREG    zero, 0(t0)             /* clear loop... */
        addi    t0, t0, REGBYTES
-       bne     t0, t1, clbss_l
+       blt     t0, t1, clbss_l
 
 relocate_secondary_harts:
 #ifdef CONFIG_SMP
@@ -337,6 +336,7 @@ relocate_secondary_harts:
 
        mv      a1, s2
        mv      a2, s3
+       mv      a3, zero
        jal     smp_call_function
 
        /* hang if relocation of secondary harts has failed */
@@ -357,9 +357,8 @@ relocate_secondary_harts:
 call_board_init_r:
        jal     invalidate_icache_all
        jal     flush_dcache_all
-       la      t0, board_init_r
-       mv      t4, t0                  /* offset of board_init_r() */
-       add     t4, t4, t6              /* real address of board_init_r() */
+       la      t0, board_init_r        /* offset of board_init_r() */
+       add     t4, t0, t6              /* real address of board_init_r() */
 /*
  * setup parameters for board_init_r
  */
@@ -376,9 +375,7 @@ hart_out_of_bounds_loop:
        /* Harts in this loop are out of bounds, increase CONFIG_NR_CPUS. */
        wfi
        j       hart_out_of_bounds_loop
-#endif
 
-#ifdef CONFIG_SMP
 /* SMP relocation entry */
 secondary_hart_relocate:
        /* a1: new sp */