summaryrefslogtreecommitdiffstats
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-03-04 01:10:13 +0100
committerTom Rini <trini@konsulko.com>2016-03-15 21:30:14 -0400
commitdea2174d9d941db2ec64997779771a4b4c3527c2 (patch)
tree022730c8f59c7722d981c593177209818a88c7f1 /cmd/bootefi.c
parentcc4a474873ecf79775bef6b2e73a8b0c7e13b95f (diff)
downloadtalos-obmc-uboot-dea2174d9d941db2ec64997779771a4b4c3527c2.tar.gz
talos-obmc-uboot-dea2174d9d941db2ec64997779771a4b4c3527c2.zip
efi_loader: Call fdt preparation functions
We have a nice framework around image fils to prepare a device tree for OS execution. That one patches in missing device tree nodes and fixes up the memory range bits. We need to call that one from the EFI boot path too to get all those nice fixups. This patch adds the call. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 98d1fcaba2..2b104d4908 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -92,6 +92,7 @@ static unsigned long do_bootefi_exec(void *efi)
{
ulong (*entry)(void *image_handle, struct efi_system_table *st);
ulong fdt_pages, fdt_size, fdt_start, fdt_end;
+ bootm_headers_t img = { 0 };
/*
* gd lives in a fixed register which may get clobbered while we execute
@@ -102,6 +103,13 @@ static unsigned long do_bootefi_exec(void *efi)
/* Update system table to point to our currently loaded FDT */
if (working_fdt) {
+ /* Prepare fdt for payload */
+ if (image_setup_libfdt(&img, working_fdt, 0, NULL)) {
+ printf("ERROR: Failed to process device tree\n");
+ return -EINVAL;
+ }
+
+ /* Link to it in the efi tables */
systab.tables[0].guid = EFI_FDT_GUID;
systab.tables[0].table = working_fdt;
systab.nr_tables = 1;
OpenPOWER on IntegriCloud