mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
riscv: Fix clear bss loop in the start-up code
For RV64, it will use sd instruction to clear t0 register, and the increament will be 8 bytes. So if the difference between__bss_strat and __bss_end was not 8 bytes aligned, the clear bss loop will overflow and acks like system hang. Signed-off-by: Rick Chen <rick@andestech.com> Cc: KC Lin <kclin@andestech.com> Cc: Alan Kao <alankao@andestech.com>
This commit is contained in:
parent
31dae22faa
commit
444c46413f
3 changed files with 4 additions and 4 deletions
|
@ -174,7 +174,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
|
||||
|
@ -324,7 +324,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
|
||||
|
|
|
@ -76,7 +76,7 @@ SECTIONS
|
|||
.bss : {
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(8);
|
||||
__bss_end = .;
|
||||
} > .bss_mem
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ SECTIONS
|
|||
.bss : {
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(8);
|
||||
__bss_end = .;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue