riscv-software-src/opensbi

Start the OpenSBI Payload in m-mode ?

rejsys opened this issue · 1 comments

rejsys commented

We wanted to start the u-boot as a payload of OpenSBI in m-mode. We thought we could archive this by just modifying the following line:

li a0, PRV_S

But we are not able to start OpenSBI now. There is no output after coping the boot image:
copying boot image ......... done!

What is needed to set the mode of the OpenSBI payload to m-mode?

Edit: this relates to another issue #310 but is not about changing the mode to m-mode after entering s-mode but more about staying in m-mode and not going to s-mode at all.

rejsys commented

I found the solution myself (even if OpenSBI is not intended for that, it is sometimes needed to run your own code in m-mode):

Change:

li a0, PRV_S

To:
li a0, PRV_S

and Change:

if (dom->next_mode != PRV_S &&

To:
if (dom->next_mode != PRV_M &&