splitting up discover/platform-{arm64,powerpc}.c and adding new platforms

Samuel Mendoza-Jonas sam at mendozajonas.com
Thu May 2 13:05:37 AEST 2019


On Tue, 2019-04-30 at 18:29 -0500, Marty E. Plummer wrote:
> Greetings.
> 
> So, I've recently been working on using petitboot as the bootloader on
> my Samsung Chromebook Plus (rk3399-gru-kevin) and for the moment have it
> working in the sense that it can boot other linux operating systems on
> the internal emmc.

Cool!

> 
> However, as it currently stands the arm64 platform assumes either ipmi
> or efi, neither of which are present in my configuration. What's more,
> coreboot doesn't to my knowledge have a sort of persistent store like
> platform-powerpc.c's nvram.

Right, the arm64 platform in Petitboot is still a bit geared towards
server-like platforms, less so laptops etc.

> 
> To that end, I've began working on creating what amounts to
> platform-uboot.c, and have realized that perhaps there is a lot of
> potential code duplication in this area.
> 
> platform-powerpc.c currently has some device-tree related parsing which
> could be shared among other platforms which use devicetree (arm and
> arm64 come to mind offhand), and opal itself is not necessarily specific
> to powerpc (one could make an arm64 runtime which implements the same
> interfaces, for example).
> 
> platform-arm64.c lacks device-tree support, which could be useful in
> general, and has exclusive to itself efi support, which could be useful
> on platforms which use it (x86_64 comes to mind).

While there's already been some effort towards reducing duplication
(moving more generic parts into platform.c, adding the params-list,
moving generic IPMI bits out of platform- files), as you point out
there's definitely more places we could break out functionality into
generic helpers. Bits like accessing the device tree are pretty easy,
more specific things like working out what exact sub-platforms could be a
little more involved depending on the platform.

> 
> I'm adding platform-uboot.c to use u-boot's fw_{print,set}env to do
> persistent store for my coreboot build, but could also be used with real
> u-boot if that were the case.
> 
> Thoughts?

Sounds good! I'm always in favour of making Petitboot more adaptable to
new platforms. Probably wait until someone actually writes a new OPAL
implementation until thinking about that one though ;)

Cheers,
Sam

> 
> Marty
> _______________________________________________
> Petitboot mailing list
> Petitboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/petitboot




More information about the Petitboot mailing list