From 62bd702929f6ac9e80f602ba24a3723aaaf7f29d Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 21 Aug 2024 06:24:42 +0200 Subject: [PATCH] Restore stvec to its original value --- JOURNAL.md | 71 ++++++++++++++++++++++++++++++++++++ uboot-exception-extras.patch | 9 ++--- 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/JOURNAL.md b/JOURNAL.md index eb92795..25681be 100644 --- a/JOURNAL.md +++ b/JOURNAL.md @@ -3460,3 +3460,74 @@ Let's try to cause an interrupt with the normal CLINT: No interrupts seem to arrive at the SIP register. Let's set the stvec to zero, so it causes a machine exception. + +# 2024-08-21 + +I tried with the new bitstream (ox_u55c_46619ef4.bit) setting the stvec to zero +and I can see the OpenSBI handler stopping, probably due to the jump to zero +address: + + Boot HART MIDELEG : 0x0000000000000222 + Boot HART MEDELEG : 0x000000000000b109 + >>Core: 11 devices, 8 uclasses, devicetree: board + Loading Environment from nowhere... OK + In: serial,usbkbd + Out: serial,vidconsole + Err: serial,vidconsole + No working controllers found + Net: No ethernet found. + Working FDT set to c0000000 + Hit any key to stop autoboot: 0 + + Device 0: unknown device + + Device 1: unknown device + scanning bus for devices... + + Device 0: unknown device + starting USB... + No working controllers found + No ethernet found. + No ethernet found. + => exception sregs + stvec : 0x00000000af6f4400 + sie : 0x0000000000000000 + sip : 0x0000000000000000 + sstatus : 0x8000000200006000 + => exception enable + => exception sregs + stvec : 0x0000000000000000 + sie : 0x0000000000000222 + sip : 0x0000000000000000 + sstatus : 0x8000000200006002 + => mw 0x40014000 0xffffffff # Disable clock interrupt + => md 0x40801000 1 # Show pending interrupts (should be 0x10) + 40801000: 00000010 .... + => mw 0x40802000 0x10 # Enable interrupt for source 4 (timer) + => mw 0x40800010 0xff # Make source 4 priority large +