There’s a whole backstory about me trying to cross-compile stuff for the R01 here, but the relevant part is: the T-Head C906 that the Allwinner D1 is based on has a hardware bug that causes program crashes whenever something tries to use the fence.tso
instruction.
GCC 14 added -mno-fence-tso
as a workaround for this bug, but then I need to get all the stuff I want to build to play nice with gcc14, which is not as straightforward as I would like it to be.
In the meantime, though, there’s another option: the RISC-V openSBI was updated a few years ago with a trap handler that falls back to plain fence
, which works fine, rather than forwarding a SIGILL
to the program and killing it. This version even appears to be included in the apt repositories for the DT! Unfortunately, as far as I can tell, the openSBI is actually part of the bootloader, and needs to be combined with u-boot and written to the correct location on the sd card to actually function. And apt upgrade
doesn’t do this automatically.
So – has anyone else updated the bootloader on this machine, and the openSBI image specifically? Any hints, tips, or documentation I should be looking at before I attempt this myself?