forked from rarias/nixos-riscv
Delegate external interrupts to U-Boot
This commit is contained in:
41
JOURNAL.md
41
JOURNAL.md
@@ -3297,3 +3297,44 @@ I see that the MIE sets the machine mode external interrupt enable in this way:
|
||||
Only if the external interrupt function is not the default one. But for the
|
||||
PLIC, it looks like the default one is being used. So let's enable the machine
|
||||
mode interrupts unconditionally.
|
||||
|
||||
Let's try to cause an interruption. I would need to list all the steps.
|
||||
|
||||
mw 0x40802000 0x10 # Enable interrupt for source 4 (timer)
|
||||
mw 0x40800010 0xff # Make source 4 priority large
|
||||
md 0x40a00004 1 # Show which value should be claimed
|
||||
mw 0x40a00004 0 # Claim 0
|
||||
|
||||
Nice, I can see the trap:
|
||||
|
||||
Boot HART MIDELEG : 0x0000000000000022
|
||||
Boot HART MEDELEG : 0x000000000000b109
|
||||
...
|
||||
=> mw 0x40802000 0x10 # Enable interrupt for source 4 (timer)
|
||||
=> mw 0x40800010 0xff # Make source 4 priority large
|
||||
=> md 0x40a00004 1 # Show which value should be claimed
|
||||
40a00004: 00000000 ....
|
||||
=> mw 0x40a00004 0 # Claim 0 (weird)
|
||||
<i
|
||||
sbi_trap_error: hart0: trap0: unhandled local interrupt (error -1000)
|
||||
|
||||
sbi_trap_error: hart0: trap0: mcause=0x800000000000000b mtval=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: mepc=0x00000000af71ebbc mstatus=0x8000000a00006800
|
||||
sbi_trap_error: hart0: trap0: ra=0x00000000af71eba0 sp=0x00000000aeed3b00
|
||||
sbi_trap_error: hart0: trap0: gp=0x00000000aeed3dd0 tp=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: s0=0x00000000af7cd170 s1=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: a0=0x0000000000000000 a1=0x0000000000000002
|
||||
sbi_trap_error: hart0: trap0: a2=0x0000000000000008 a3=0x0000000000000004
|
||||
sbi_trap_error: hart0: trap0: a4=0x0000000000000001 a5=0x0000000000000001
|
||||
sbi_trap_error: hart0: trap0: a6=0x0000000000000008 a7=0x00000000af795778
|
||||
sbi_trap_error: hart0: trap0: s2=0x0000000000000000 s3=0x00000000aeed5b90
|
||||
sbi_trap_error: hart0: trap0: s4=0x0000000000000003 s5=0x00000000af7f7a4c
|
||||
sbi_trap_error: hart0: trap0: s6=0x0000000000000000 s7=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: s8=0x0000000000000000 s9=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: s10=0x00000000aeed5bc0 s11=0x0000000000000000
|
||||
sbi_trap_error: hart0: trap0: t0=0x00000000aeed3ac0 t1=0x0000000000000039
|
||||
sbi_trap_error: hart0: trap0: t2=0x3b3d74696e695f64 t3=0x0000000000000010
|
||||
sbi_trap_error: hart0: trap0: t4=0x0000000000000000 t5=0x61745f746f6f627b
|
||||
sbi_trap_error: hart0: trap0: t6=0x00000000aeed3aa0
|
||||
|
||||
Now let's try delegating it to u-boot, and see if I can print some information.
|
||||
|
||||
Reference in New Issue
Block a user