Skip to content

Commit 8fcfd28

Browse files
committed
Reset interrupts in bootblob
Signed-off-by: Ryan O'Leary <[email protected]>
1 parent 3b70868 commit 8fcfd28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/soc/sifive/fu540/src/bootblock.S

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ _boot:
2626
# some hardware configurations, but is always set in QEMU.
2727
csrr a0, mhartid
2828

29+
# Reset the mtimecmp to some absurdly large number.
30+
# The mtimecmp register is memory mapped at 0x2004000 + 0x8 * mhartid
31+
# TODO: Move to Rust
32+
li t0, 0x2004000
33+
slli t1, a0, 3
34+
add t1, t1, t0
35+
li t0, 0xffffffffffffffff
36+
sd t0, (t1)
37+
38+
# Clear all interrupt enable and pending bits.
39+
# TODO: Move to Rust
40+
csrwi mie, 0x0
41+
csrwi mip, 0x0
42+
2943
# Layout of L2-LIM (address 0x08000000):
3044
# 0x00000-0x0ffff: .bss segment (64K bytes)
3145
# 0x10000-0x1ffff: stack of boot hart (64K bytes)

0 commit comments

Comments
 (0)