Building OpenSBI and Uboot

Clarify a few things:

The bootchain is a basically a tarball in ESWIN’s format that can be read by the ROM of the chip. It describes different stage images, such as secondary init second_boot_fw, DDR init ddr_fw.bin, and the actual bootloader fw_payload.bin (opensbi+u-boot). What actually happened is the small 32-bit SCPU core starts first on power-on and runs ROM, then it parses from the bootchain in SPI flash and invokes secondary init + DDR init. Finally it copies bootloader (opensbi+u-boot) to DRAM, and kick start the 64-bit MCPU cores. This kind of bootchain is packaged by Esbd-77serial-nsign. second/ddr_fw are all closed source blobs from ESWIN, but bootloader we can change it.

If you go the meta-sifive route, then there’s no need to care about the versioning of different components. They are already specified by the manifest files. Just check-out this branch GitHub - sifiveinc/meta-sifive at rel/meta-sifive/hifive-premier-p550 and it’ll describe all the git commits of all repos + any private patches applied on top of it.

If you decide to do everything manually, then mimic what meta-sifive does is a good start. For me, I do everything manually for bootchain, and what I learned:

For u-boot/OS compatibility, no need to worry so much. Ubuntu carries it’s own device-tree for kernel, and kernel/grub speaks EFI protocol to u-boot, so it’s properly interfaced.

And yes, you can es_burn the new bootchain to the board. Just make sure you know how to recover the board before attempting. Following the board recover procedure is a good exercise.

BTW, you can use the discord channel from Works with RISC-V to chat on eic770x/p550: Discord

1 Like