On Mon, Sep 30, 2013 at 11:27 AM, Grant Likely grant.likely@linaro.org wrote:
On Mon, Sep 30, 2013 at 5:46 PM, Leif Lindholm leif.lindholm@linaro.org wrote:
On Mon, Sep 30, 2013 at 08:05:59AM -0700, Roy Franz wrote:
I was thinking that the stub would want to use the FDT passed by grub if one is passed, but I hadn't thought about the case where grub wants to pass information to the stub, but the stub still loads the FDT. The easiest thing would be to straight out say that if GRUB is loading the initrd, then it is mandatory for GRUB to also load the FDT. That eliminates the corner case and I can't think of any situation where we'd want GRUB loading the initrd, but use the stub to load the FDT.
I'd also like to avoid having the stub merge FDT contents from different trees.
If we add this table, then it seems this would be the right way to handle passing the FDT to the EFI stub, even without GRUB involved. Is there a reason not to move to this method in general?
Not really. So ... I guess that would modify the stub behaviour to:
- Look for an FDT_GUID configuration table.
- If there, use it.
- If not there, require one to be loaded based on command line.
Create a mostly empty one for passing freeform data to the kernel proper; this is what it will look like on ACPI systems.
So for ACPI systems the stub will package the ACPI data into the FDT? What would the stub be putting into the FDT that an ACPI/UEFI aware kernel couldn't get itself at runtime from UEFI?
And the GRUB behaviour to:
- If no FDT_GUID, require FDT if initrd.
- If FDT_GUID, copy FDT + add initrd information.
The x86 code uses bootparam to pass the kernel command line. Could we use the FDT exists) for the kernel command line too? This would make more code shared between x86 and ARM*, since otherwise we would need to explicitly implement (UCS?) command line passing to stub?
Yes, I think that makes sense. That also means GRUB will need to always create an FDT, even if it is empty.
I'm not following something here - why would GRUB create an empty FDT?
Is GRUB going to be responsible for the complete FDT, or just passing the initrd and/or command line in an FDT?
The other option would be to pass the command line via the LoadOptions from the EFI_LOADED_IMAGE protocol. I believe that is what Roy's patches currently rely on for getting a command line.
Yes, both my implementation and the x86 implementation get the command line from the EFI_LOADED_IMAGE protocol, and do conversion from UCS-2 (I think) to ASCII/UTF-8 to pass to the kernel. The format of the command line does not seem to be specified by UEFI.
g.