From patchwork Fri Jun 5 07:22:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 241761 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Fri, 5 Jun 2020 09:22:54 +0200 Subject: [PATCH] optee: copy FDT OP-TEE related nodes before generic FDT changes Message-ID: <20200605092244.1.I773bf523d9f4d1a6212483d030e34113b832a779@changeid> From: Etienne Carriere Move call to optee_copy_fdt_nodes() introduced by [1] before generic changes in kernel FDT so that platform specific changes are not overridden by the changes made by this function. Link: [1] commit 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree") Signed-off-by: Etienne Carriere Signed-off-by: Patrick Delaunay --- common/image-fdt.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/common/image-fdt.c b/common/image-fdt.c index b63e772bd6..041382447e 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -547,6 +547,14 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, printf("ERROR: arch-specific fdt fixup failed\n"); goto err; } + + fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob); + if (fdt_ret) { + printf("ERROR: transfer of optee nodes to new fdt failed: %s\n", + fdt_strerror(fdt_ret)); + goto err; + } + /* Update ethernet nodes */ fdt_fixup_ethernet(blob); if (IMAGE_OF_BOARD_SETUP) { @@ -566,13 +574,6 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, } } - fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob); - if (fdt_ret) { - printf("ERROR: transfer of optee nodes to new fdt failed: %s\n", - fdt_strerror(fdt_ret)); - goto err; - } - /* Delete the old LMB reservation */ if (lmb) lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,