carlosedp / riscv-bringup

Risc-V journey thru containers and new projects
270 stars 43 forks source link

Update opensbi generic platform for qemu build instructions #7

Closed atishp04 closed 3 years ago

atishp04 commented 4 years ago

OpenSBI currently supports FDT based generic platform. As a result, qemu/virt platform is removed in favor of generic platform. I think the document should updated here as it says to pull master opensbi.

Generic platform support http://lists.infradead.org/pipermail/opensbi/2020-April/001998.html

Qemu platform support removal http://lists.infradead.org/pipermail/opensbi/2020-May/002042.html

et-tommythorn commented 4 years ago

Awesome. That will increase the chance of booting this in Dromajo (the current fw image has a lot of U540 assumptions).

carlosedp commented 4 years ago

In the Qemu guide, I currently pull OpenSBI v0.6 that has compatibility with the current Kernel.

What requires changes is building OpenSBI, using:

make CROSS_COMPILE=riscv64-unknown-linux-gnu- \
     PLATFORM=generic \
     FW_PAYLOAD_PATH=../u-boot/u-boot.bin

Is it right?

atishp04 commented 4 years ago

And the firmware path needs to be updated. build/platform/generic/firmware/fw_payload.bin

carlosedp commented 4 years ago

ah yes.. nice! Gonna test this right now and update the guide:) Thanks Atish

atishp04 commented 4 years ago

Awesome. While a separate HiFive unleashed platform will continue to exist, you can also use the generic platform to boot HiFive Unleashed. So the same generic platform for binary should work on both Qemu and HiFive Unleashed!!

atishp04 commented 4 years ago

Awesome. That will increase the chance of booting this in Dromajo (the current fw image has a lot of U540 assumptions).

That's great. I took a quick look at the github repo for Dromajo and couldn't find OpenSBI changes. Let me know if you see any issues with using the generic platform for Dromajo.

et-tommythorn commented 4 years ago

OT: I'm embarrassingly behind on upstreaming attempts, but they are there: https://github.com/chipsalliance/dromajo/blob/master/run/opensbi.dromajo.tar.gz

Note, this also supports the Esperanto Technology Maxion core.

I'd be happy to open an openSBI issue in the Dromajo and continue the conversation there about what needs changing.

carlosedp commented 4 years ago

Confirming that OpenSBI from master (OpenSBI v0.7-31-gd626037) + U-Boot v2020.04 and Kernel 5.7-rc3 boots perfectly and all CPUs are detected. With v0.7 the generic platform is still not available.

With Kernel 5.6, only one CPU is detected with this OpenSBI version.

et-tommythorn commented 4 years ago

OT again (so sorry): Note, I took out all the device models, but I plan to put enough back that we can at least run Ubuntu.

On Mon, May 4, 2020 at 12:37 PM Tommy Thorn tommy.thorn@esperantotech.com wrote:

OT: I'm embarrassingly behind on upstreaming attempts, but they are there: https://github.com/chipsalliance/dromajo/blob/master/run/opensbi.dromajo.tar.gz

Note, this also supports the Esperanto Technology Maxion core.

I'd be happy to open an openSBI issue in the Dromajo and continue the conversation there about what needs changing.

atishp04 commented 4 years ago

With Kernel 5.6, only one CPU is detected with this OpenSBI version.

That is expected. As the OpenSBI readme says, you have to migrate to the latest kernel (5.7-rc+) if you are using OpenSBI v0.7 or higher. That's happened because of the HSM extension and ordered booting support added in 5.7-rc1 & OpenSBI v0.7

carlosedp commented 4 years ago

I'll keep this at hand and update the full guide once there is a new OpenSBI version (0.8) and Kernel 5.7 gets released :)

atishp04 commented 4 years ago

I'd be happy to open an openSBI issue in the Dromajo and continue the

Sure. I took a quick look at the sources and I don't expect any major changes as long as the the simulator provides a DT with correct MMIO addresses. You should be able to boot generic platform on the emulator.

carlosedp commented 3 years ago

Closing this as latest Unmatched guide uses Generic on OpenSBI