Page MenuHomeFreeBSD

RISC-V boot1.efi and loader.efi support
ClosedPublic

Authored by mhorne on Jun 4 2020, 9:46 PM.

Details

Summary

This implementation doesn't have any major deviations from the other EFI
ports, and I've copied the boilerplate from arm64 for the most part.

I've tested this with the following boot flows:
OpenSBI (M-mode) -> u-boot (S-mode) -> loader.efi -> FreeBSD
OpenSBI (M-mode) -> u-boot (S-mode) -> boot1.efi -> loader.efi -> FreeBSD

Due to the way that u-boot handles secondary CPUs, we will require
OpenSBI >= v0.7, as the HSM extension is needed to bring them up
explicitly. Additionally, all of the necessary changes for booting will
be present in the upcoming u-boot v2020.07 release.

Test Plan

I've run the above in qemu/virt using a disk image.
I plan to test netbooting on qemu/sifive_u.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mhorne requested review of this revision.Jun 4 2020, 9:46 PM
stand/common/metadata.c
357 ↗(On Diff #72689)

There's both riscv32 and riscv64?

If any of these new files are derived from some existing files (and it looks like it from the license statements), it would be nice if they were 'svn cp'd from the file they were copied from for the commit.

In D25135#553856, @jhb wrote:

If any of these new files are derived from some existing files (and it looks like it from the license statements), it would be nice if they were 'svn cp'd from the file they were copied from for the commit.

Good note, it's easy to forget that when prototyping with git. I will be sure to do so when committing.

stand/common/metadata.c
357 ↗(On Diff #72689)

Not that we support (or have plans to). I was being precise because this function is obviously 64-bit only. Giving it a second look however, this is leftover from an experiment with ubldr, and md_load* is not something we need for EFI loader.

Remove unneeded definition of md_load64.
Remove unnecessary __riscv_xlen check.

Hi folks. Since I've now committed the various prerequisites to this work, it would be nice to get this in soon. Please give it a second look this week if you are able to.

Looks good to my cursory review.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 6 2020, 6:19 PM
This revision was automatically updated to reflect the committed changes.