oreboot on VisionFive 1 021: running payloads from DRAM
Channel: Daniel aka CyReVolt 🐢
Date: 2022-12-15

As part of the RISC-V International developer program, I received a StarFive VisionFive board, based on the JH7100 SoC featuring two SiFive U74 cores. My goal is to bring the oreboot port forw
ard that we already had in progress for the predecessor board, the BeagleV. At the same time, I'm sharing the development process with the world doing live streams.

In this video, we start with a recap of our procedure for reworking the vendor provided source code, followed by a glance at the upcoming FOSDEM, what the RISC-V Platform Runtime Services Task
 Group is doing, and the slides to a talk I recently gave at Backspace, Bamberg's hackerspace, introducing programming microcontrollers in Rust based on the Rust Embedded abstractions we also
use in oreboot. We then walk through the Rust translation of the DRAM initialization code, and try running a payload from it, using the main stage we had already drafted before. While that wor
ks fine, we are having trouble executing code from the SPI flash, getting a bit lost in the vendor source code, so we leave that for further investigation.

Previous video: https://www.youtube.com/watch?v=WlLCyMOTtzY&list=PLenOHeTI_A9PSGshDnEc4dYK-GSnCshk6&index=20
Next video: https://www.youtube.com/watch?v=C3LxwTK6A-k&list=PLenOHeTI_A9PSGshDnEc4dYK-GSnCshk6&index=22

Twitch channel: https://twitch.tv/cyrevolt

References:
https://riscv.org/risc-v-developer-boards/
https://groups.google.com/a/riscv.org/g/devboard-community
https://groups.google.com/a/riscv.org/g/devboard-community/c/utStFu8Q3A0
https://starfivetech.com/en/site/boards
https://doc-en.rvspace.org/
https://github.com/starfive-tech/linux
https://github.com/oreboot/oreboot
https://github.com/oreboot/oreboot/pull/606
https://github.com/starfive-tech/JH7100_ddrinit
https://github.com/starfive-tech/JH7100_ddrinit/blob/starfive/boot/bootmain.c
https://github.com/starfive-tech/opensbi/releases/tag/OpenSBI-v0.9-395ff7e
https://doc.rust-lang.org/nomicon/transmutes.html
https://fosdem.org/2023/schedule/
https://rust-fosdem.github.io/
https://lists.fosdem.org/pipermail/fosdem/2022q4/003467.html
https://lists.fosdem.org/pipermail/fosdem/2022q4/003474.html
https://lists.riscv.org/g/tech-prs/topic/agenda_for_tomorrow_meeting/95324634?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,95324634,previd%3D1669702129486882991,nextid%3D1666326394514399570&previd=1669702129486882991&nextid=1666326394514399570
https://metaspora.org/microcontrollers-and-rust-wch.pdf
https://github.com/orangecms/ch32v307-rust/