# Updating the openSBI on R-01?

**URL:** <https://forum.clockworkpi.com/t/updating-the-opensbi-on-r-01/13851>\
**Category:** DevTerm\
**Created:** [July 3, 2024, 8:32pm UTC](https://forum.clockworkpi.com/t/updating-the-opensbi-on-r-01/13851 "2024-07-03T20:32:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ToxicFrog](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/toxicfrog/32/9664_2.png) [@ToxicFrog](https://forum.clockworkpi.com/u/ToxicFrog)\
**Post date:** [July 3, 2024, 8:32pm UTC](https://forum.clockworkpi.com/t/updating-the-opensbi-on-r-01/13851/1 "2024-07-03T20:32:36Z")

</div>

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](https://lists.infradead.org/pipermail/opensbi/2022-May/002767.html) 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?

---

_[View the full topic](https://forum.clockworkpi.com/t/updating-the-opensbi-on-r-01/13851)._
