Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: netbsd-9, boot, EFI and device tree



On Fri, Apr 23, 2021 at 10:02:37PM +0200, Manuel Bouyer wrote:
> Hello,
> I'm starting a new project with an Olimex A20 lime2 board.
> Up to now I used the old way of loading the kenrel from u-boot, where I can
> also pass kernel command line and device tree blobs.
> I though that for this new projet I would start with a fresh install,
> and so with EFI. But I didn't find much informations about it.
> 
> What is the way to load a specific device tree, and set some kernel
> boot options ?

From documentation and experiments, the problem is that the BROM on the
Sunxi SoC (hence the olimex-a20-olinuxino) does not provide an UEFI
environment, neither a SPL (Second Program Loader) nor a shell.

The BROM checks for uboot in some locations, in this case on the uSD.

So one needs to install U-Boot in every case.

Then U-Boot will act as specified by UEFI, looking in all devices for a 
FAT partition, looking for a /EFI/BOOT/ directory and, in this
directory, a EFI program with a standardized name.

In this case this is bootarm.efi, that is compiled during the building
of the NetBSD release.

De facto, if U-Boot has been compiled with the DTS, the only file needed
is the UEFI second stage bootloader (bootarm.efi for an arm32) and
that's all.

So the process is:

BROM (Sunxi SoC) -> SPL (U-Boot) 
	-> (FAT partition)/EFI/BOOT/bootarm.efi (provided by NetBSD)
	-> ('a' partition in NetBSD wedge): /netbsd

Even if it was possible (it is in theory possible) to bypass
bootarm.efi, letting U-Boot (providing UEFI) directly load an EFI aware
NetBSD kernel (but it doesn't seem at the moment possible from a
cursory look), U-Boot is mandatory for this SoC (I don't know if the
emmc version provides more UEFI i.e. has already U-Boot on it).

If I'm not mistaken, the "old" way was to provide an U-Boot version of
the kernel (the *.ub). It is not anymore required, since the EFI second
stage loader (bootarm.efi) can load the kernel.

In fact, I have tested with only U-Boot installed and
/EFI/BOOT/bootarm.efi on the FAT partition of the uSD card, and it
boots without ado.

HTH,
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index