grub-devel
[Top][All Lists]
Advanced

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

Re: Device tree support for x86 on Linux


From: Daniel Kiper
Subject: Re: Device tree support for x86 on Linux
Date: Fri, 30 Jul 2021 14:59:05 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi Mislav,

On Thu, Jul 29, 2021 at 08:43:45AM +0000, Mislav Stublić wrote:
> Hi,
>
> I am planning to add support for device tree loading on x86 with
> UEFI and Linux as i understand this is currently not supported. We need
> this for a board we are developing so i would test my patches in our
> development environment.
>
> I have gone through current x86 loader code and some similar use cases
> so i  believe i could provide a patch but i also have some questions.
>
> Is this a feature you would accept upstream?

I do not see any issues with it. It would be nice if you could reuse
existing code as much as possible. And please remember that current GRUB
code does not allow you to load device tree files if UEFI Secure Boot is
enabled. You can find more info here: grub-core/kern/lockdown.c.

> As for technical questions, for this to work grub would need to set
> setup_data pointer (part of setup_header for linux kernel) that points
> to memory holding loaded dtb. But i'm not sure if such memory can
> just be allocated with grub_zalloc or is there some other allocation

The grub_zalloc() et consortes can be used for the GRUB "runtime" only.

> mechanism that would guarantee this will be preserved once control is
> handed over to linux kernel.

There are two functions in the GRUB which are doing what you want:
grub_relocator_alloc_chunk_align() and grub_relocator_alloc_chunk_addr().
It seems to me the former should be better for you.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]