Clear the DDR memory. This should be done by bootloaders,

but they have no such feature yet.

This fixes operation on Rocket Core and lowRISC.
This commit is contained in:
Ruslan Bukin 2016-04-22 16:15:58 +00:00
parent fd3dc9f439
commit ce2b4fcfb9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298477
2 changed files with 12 additions and 0 deletions

View File

@ -2,3 +2,4 @@
RISCV opt_global.h
VFP opt_global.h
DDR_CLEAR_SIZE opt_global.h

View File

@ -126,6 +126,17 @@ _start:
csrr a0, mhartid
bnez a0, mpentry
#if defined(DDR_CLEAR_SIZE)
/* Clear DDR memory */
la t0, _end
li t1, DDR_CLEAR_SIZE
1:
sd zero, 0(t0)
addi t0, t0, 8
bltu t0, t1, 1b
/* End */
#endif
/* Build event queue for current core */
build_ring