Page MenuHomeFreeBSD

New port: sysutils/opensbi: OpenSBI, a RISC-V bootloader and firmware
ClosedPublic

Authored by mhorne on Oct 26 2019, 9:13 PM.

Details

Summary

OpenSBI is a RISC-V bootloader and set of firmware libraries that
implement the RISC-V Supervisor Binary Interface (SBI) required for
supervisor targets, such as the FreeBSD kernel.

This port installs the OpenSBI libraries that can be used for
development of custom firmwares, as well as the firmware files for the
QEMU virt and SiFive U540 platforms.

Test Plan

Passes portlint.
Builds fine in poudriere.

Diff Detail

Repository
rP FreeBSD ports 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 created this revision.Oct 26 2019, 9:13 PM
philip accepted this revision.Oct 27 2019, 2:29 AM
philip added a subscriber: philip.

I also tested this in Poudriere on 12 and HEAD.

Looks good to me!

This revision is now accepted and ready to land.Oct 27 2019, 2:29 AM
linimon retitled this revision from New port: OpenSBI a RISC-V bootloader and firmware to New port: sysutils/opensbi: OpenSBI, a RISC-V bootloader and firmware.Oct 27 2019, 6:20 AM

Of course if it were me (with my decades-long aversion to repeating hardcoded strings) I would have done it as, e.g.:

QEMU_VIRT_PLATFORM=qemu/virt
[...]
${MAKE_CMD} -C ${WRKSRC} PLATFORM=${QEMU_VIRT_PLATFORM} I=${STAGEDIR}${DATADIR} \
[...]

mhorne updated this revision to Diff 63719.Oct 27 2019, 3:12 PM

Reduce hardcoded strings.

This revision now requires review to proceed.Oct 27 2019, 3:12 PM
lwhsu accepted this revision.Oct 27 2019, 3:34 PM

This might be too aggressive, but it can be folded more: https://gist.github.com/e48b2311f72d655b0f88c7c798e6e722

This might help adding more platforms in the future, but I'm fine with the original version.

This revision is now accepted and ready to land.Oct 27 2019, 3:34 PM
nick added a subscriber: nick.Oct 27 2019, 5:15 PM
lwhsu added inline comments.Oct 27 2019, 5:25 PM
sysutils/opensbi/Makefile
19 ↗(On Diff #63719)

+= here is not necessary, = is enough.

21 ↗(On Diff #63719)

Also here.

mhorne updated this revision to Diff 63720.Oct 27 2019, 5:25 PM

Use lhwsu's simplification.

This revision now requires review to proceed.Oct 27 2019, 5:25 PM
lwhsu accepted this revision.Oct 27 2019, 5:27 PM

Feel free to commit this with my approval, just modify the += nit before committing.

This revision is now accepted and ready to land.Oct 27 2019, 5:27 PM

This might be too aggressive, but it can be folded more: https://gist.github.com/e48b2311f72d655b0f88c7c798e6e722

This might help adding more platforms in the future, but I'm fine with the original version.

I think it's good. As far as I can tell, all platforms will produce the same firmware files.

Just to note, the platforms I've included now are the ones that are currently relevant to running FreeBSD. I could include the others (andes/ae350, kendryte/k210, and ariane-fpga) if we think that's useful.

lwhsu added a comment.Oct 27 2019, 5:34 PM

Just to note, the platforms I've included now are the ones that are currently relevant to running FreeBSD. I could include the others (andes/ae350, kendryte/k210, and ariane-fpga) if we think that's useful.

We can add them when them become relevant to FreeBSD, or, add them as default-off options.