Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/23869 )
Change subject: util/cbfstool: Add ARM64 Image support ......................................................................
Patch Set 2:
I'm a little confused why we need a trampoline and relocation code just to boot an ARM64 kernel. ARM64 kernels always want to be loaded at the start of physical memory (+0x80000). ARM64 boards in coreboot can statically position their ramstage wherever they want in memlayout. Why not just make sure that the ramstage is always far enough away from the start of physical memory to avoid the possibility of an overlap and be done with it? I mean, all relevant systems have more than enough DRAM available.
This just seems to add loads of complication to the process with no clear gain.
The trampoline: Coreboot passes a pointer to the coreboot tables in x0, but we have to pass a pointer to the devicetree in x0. My first idea was to include the devicetree in the payload and load it to a known address right before the kernel. But we need to be able to modify it, like it's done with ACPI tables. The trampoline's purpose is to find the devicetree in coreboot tables and pass the address to the kernel in x0.
The load address: I can place the kernel anywhere in DRAM, the start of DRAM is prefered. Using static address has the following disadvantages: I need to know start of DRAM, but that's only set in memlayout.ld. Extracting it seems a bit tricky. I would need to modify all memlayout.ld to have enough free space for the kernel image. I need to add a sanity check, that the start of dram is usable. That could be done with a new REGION called payload for example.
With the dynamic loader I don't have to care about all that, it just places the kernel and executes it.