mini-rv32ima icon indicating copy to clipboard operation
mini-rv32ima copied to clipboard

Can it run OpenSBI?

Open ElectroBoy404NotFound opened this issue 2 years ago • 9 comments

Hi!

I have a pre-compiled risc-v opensbi image with the following: image

So what file am i supposed to execute with the emulator? I tried fw_jump.bin but it didn't work.

ElectroBoy404NotFound avatar Jul 02 '23 16:07 ElectroBoy404NotFound

It "should be able to" but I've never understood opensbi, or gotten it to successfully build and run on literally anything except qemu.

I encourage you to do this, it would be cool for someone to understand it. But I do not.

cnlohr avatar Jul 03 '23 22:07 cnlohr

Makes sense

ElectroBoy404NotFound avatar Oct 09 '23 11:10 ElectroBoy404NotFound

I think the first step to accomplish this is either:

  • define a device tree (dts) for the mini-rv32ima
  • make platform specific binding for the mini-rv32ima in OpenSBI

The former is the preferred solution as Linux, and I also believe U-boot, can leverage the dts file.

This has been the best reference on the subject so far.

upsampled avatar Nov 08 '23 14:11 upsampled

I think the first step to accomplish this is either:

  • define a device tree (dts) for the mini-rv32ima
  • make platform specific binding for the mini-rv32ima in OpenSBI

The former is the preferred solution as Linux, and I also believe U-boot, can leverage the dts file.

This has been the best reference on the subject so far.

Thanks! I'm going to try that

ElectroBoy404NotFound avatar Nov 08 '23 14:11 ElectroBoy404NotFound

@ElectroBoy404NotFound as long as @cnlohr doesn't mind the chatter, feel free to share your notes here.

upsampled avatar Nov 08 '23 15:11 upsampled

I'll see if I have time for a deeper dive later this month, but to start out:

@cnlohr emulates a 8250 UART, The output buffer address is 0x10000000 and input is 0x10000005. The DTS documentation for describing this is found here

Seems like we would need to determine the register start address (assuming 0x10000000) and length (guessing 0x100 but not sure) and other other settings.

upsampled avatar Nov 08 '23 16:11 upsampled

nevermind this is already made https://github.com/cnlohr/mini-rv32ima/blob/master/mini-rv32ima/sixtyfourmb.dts

upsampled avatar Nov 08 '23 19:11 upsampled

I def don't mind the chatter. And yeah, the idea is I just don't use OpenSBI, it feels like a lot of extra cruft without any real payoff. I still don't "get it" for something where the kernel should just be able to boot. But if someone gets it working, please let me know! I'm happy to accept patches as long as they are small.

cnlohr avatar Dec 24 '23 21:12 cnlohr

Well, I guess I better start checking notifications..

ElectroBoy404NotFound avatar Feb 15 '24 10:02 ElectroBoy404NotFound