Get kernel size/load address from vboot headers
Presently kernel load address and buffer size are programmed in the
u-boot device tree. There is no reason for this: the address and size
are part of the vboot encapsulation headers. Duplicating this
information hardcoded in the device tree does not bring any benefit
and is in fact harmful, as it is easy to get out of sync.
A better way of doing things is to derive kernel load address and size
from the appropriate vboot header. ARM people object to this, as they
want the very same kernel blob operate on devices with DRAM mapped to
different address ranges.
The suggested solution is to exclude the kernel memory section from
the device tree on the platforms where the load address could be
safely taken from the vboot header. In this case u-boot will pass
address of zero to vboot, which will know to derive the address/size
from the appropriate header. vboot then rewrites fields of the u-boot
supplied structure with actual address and size of the kernel blob.
There is no sanity check yet, as it is presumed that there is enough
memory to load any kernel and u-boot does not use the space above
0x100000 for at least 16 megabytes (the kernel partition size). On x86
platform the check could be verify that the top of the kernel space is
well below the stack.
. with the appropriate u-boot change run a Link target through a
FAFT cycle, observe it succeed.
Signed-off-by: Vadim Bendebury <email@example.com>
Reviewed-by: Kees Cook <firstname.lastname@example.org>
Reviewed-by: Doug Anderson <email@example.com>
Reviewed-by: Bill Richardson <firstname.lastname@example.org>
Reviewed-by: Randall Spangler <email@example.com>
Reviewed-by: Simon Glass <firstname.lastname@example.org>
Commit-Ready: Bill Richardson <email@example.com>
2 files changed