u-boot requirements for genode

Stefan Kalkowski stefan.kalkowski at genode-labs.com
Tue Jan 3 15:59:44 CET 2023


Hello Michael,


On Fri, Dec 30, 2022 at 02:49:25AM +0100, Michael Grunditz wrote:
> Hello
> 
> I would like to know the requirements from u-boot in order to properly
> start genode.

in general Genode's base-hw kernel can boot from different
environments that u-boot might provide. This depends on the platform resp.
board. The generic Cortex-A53 bootstrap code used by rpi3, i.MX8, and
allwinner64 assumes that u-boot started the kernel (or better:
bootstrap code) in the EL3, EL2, or EL1 mode, although the latter one
is not used as start mode by any of these boards if I remember
correctly.
The only requirement is that the ELF binary was setup correctly, that
all peripherals used (e.g. the UART) are accessible in this mode (e.g.
when switching from secure to normal world before).

> 
> I know you are using bootm command, but that doesn't work at all with
> rockchip boards. Not sure if it is rockchip specific, but bootm will in the
> end try to switch to el2  which will surely fail in my case, since it's
> already there. It also requires dt blob and or atags, if not there - hang.

Have you tried the following after loading the Genode system's uImage
to "load_addr":

  bootm start ${load_addr}; bootm loados; bootm go;

It shouldn't require a device-tree blob then.

> 
> I have tried to drop to el1 from uboot and with genode image as EP. That
> works a bit better then just jumping to it from el2. But strange things
> happens. No output from Genode can be seen. I can output characters to uart
> , but the uart driver or something in between fails.

I don't think this is a good idea, because probably u-boot does not
setup the EL2 mode properly here then. Although I'm not sure. To stay
safe, I would not try to eagerly degrade the privilege level.
Moreover, you won't be able to use the hypervisor functionality.

> 
> I have tested with adding a crash the last thing it does in enable_mmu ,
> and I get that crash. My guess is that it actually starts, but not sure.
> One thing that struck me was that it looked a bit like a serial
> communication error, like a baud rate issue. rockchip insists on running a
> silly high baud rate.

Do I understand you correctly that the UART in principle works in the
Genode bootstrap code, but not if you enforce u-boot to switch to EL1
before? If this is the case, you probably have no baud-rate issue
here?!

Regards
Stefan

> 
> So the first question is what I want to know,, the requirements. I have no
> problems with adjusting things .
> 
> Best regards,
> Michael

> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users


-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org



More information about the users mailing list