summaryrefslogtreecommitdiff
path: root/src/arch/riscv/bootblock.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/riscv/bootblock.S')
-rw-r--r--src/arch/riscv/bootblock.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/arch/riscv/bootblock.S b/src/arch/riscv/bootblock.S
index c54c0e235c..43bca907bb 100644
--- a/src/arch/riscv/bootblock.S
+++ b/src/arch/riscv/bootblock.S
@@ -16,6 +16,7 @@
*/
#include <arch/encoding.h>
+#include <mcall.h>
.section ".text._start", "ax", %progbits
@@ -30,8 +31,14 @@ _start:
# and the stack must be page-aligned.
la sp, _estack
+ # poison the stack
+ la t1, _stack
+ li t0, 0xdeadbeef
+ sd t0, 0(t1)
+
# make room for HLS and initialize it
- addi sp, sp, -64 // MENTRY_FRAME_SIZE
+ addi sp, sp, -HLS_SIZE
+
// Once again, the docs and toolchain disagree.
// Rather than get fancy I'll just lock this down
// until it all stabilizes.
@@ -39,11 +46,6 @@ _start:
csrr a0, 0xf14
call hls_init
- # poison the stack
- la t1, _stack
- li t0, 0xdeadbeef
- sd t0, 0(t1)
-
la t0, trap_entry
csrw mtvec, t0