jonasblixt / punchboot

Punchboot
Other
88 stars 9 forks source link

STM32MP1 Support #36

Closed mstaack closed 7 months ago

mstaack commented 8 months ago

Really great work with this!

Currently i am tinkering with the STM32MP1 MPU's from ST:

https://www.st.com/en/microcontrollers-microprocessors/stm32mp1-series.html

Boot Sequence:

There is already a Bare-Metal Booting Repository with included C Drivers at: https://github.com/4ms/mp1-boot/tree/main/src/drivers

Would it be doable to port this in acceptable time into punchboot?

Cheers

jonasblixt commented 8 months ago

Thanks!

I would say yes. If you decide to give this a try I will try to support you. There is an mmc layer availabe so targeting a system with an eMMC would be quicker compared to raw NAND.

Roughly what would be needed:

Punchboot as of day boots in MON (Highest exception level) on 32-bit arm and in EL3 on 64-bit. The supported boot flow is PB -> ATF -> ...

The justification for doing it like this is that then the ATF component can be a part of an A/B boot setup and could be rolled back. Since ATF provides a run time interface to other parts of a system it seemed like the prudent thing to do.

I think it would be a good idea to add support for all exception levels. This would require some additional code in arch/* and some additional logic / kconfig setup for setting up the MMU.

Since the stm32mp uses parts of ATF as a first stage boot loader it make make sense to start there, i.e., keep that ATF as a first stage and add support for the USR and/or HYP levels in punchboot.

I'll keep this issue open for a while and if you decide to continue with this we can track updates here.

Jonas