diff mbox series

[v2] optee: copy FDT OP-TEE related nodes before generic FDT changes

Message ID 20200930174454.v2.1.I3f984b644583cb7080d779898cebfed8669d3f33@changeid
State New
Headers show
Series [v2] optee: copy FDT OP-TEE related nodes before generic FDT changes | expand

Commit Message

Patrick Delaunay Sept. 30, 2020, 3:45 p.m. UTC
From: Etienne Carriere <etienne.carriere@linaro.org>


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")

Fixes: 6ccb05eae01b ('image: fdt: copy possible optee nodes to a loaded devicetree')
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

---

Changes in v2:
- rebase on master branch
- add Fixes tag

 common/image-fdt.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

-- 
2.17.1

Comments

Tom Rini Sept. 30, 2020, 3:48 p.m. UTC | #1
On Wed, Sep 30, 2020 at 05:45:08PM +0200, Patrick Delaunay wrote:

> From: Etienne Carriere <etienne.carriere@linaro.org>

> 

> 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")

> 

> Fixes: 6ccb05eae01b ('image: fdt: copy possible optee nodes to a loaded devicetree')

> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

> ---

> 

> Changes in v2:

> - rebase on master branch

> - add Fixes tag


Note that this applied cleanly for me and I reworded the commit slightly
differently to also include a fixes tag.  I'm currently testing this
(just to be safe).  Sorry for not being clear in the other thread I
would just grab that and add the tag.

-- 
Tom
diff mbox series

Patch

diff --git a/common/image-fdt.c b/common/image-fdt.c
index f13eefb061..3d6935ad40 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -557,6 +557,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) {
@@ -576,13 +584,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,