Skip to contentSkip to conversation

lib: optee: migration optee_copy_fdt_nodes for OF_LIVE support

PATCH New Patrick Delaunay 2 participants 2 messages Feb 8, 2021 – Apr 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: optee: migration optee_copy_fdt_nodes for OF_LIVE support

The optee_copy_fdt_nodes is only used to copy op-tee nodes of U-Boot device tree (from gd->fdt_blob when OF_LIVE is not activated) to external device tree but it is not compatible with OF_LIVE.

This patch migrates all used function fdt_ functions to read node on old_blob to ofnode functions, compatible with OF_LIVE and remove this parameter "old_blob".

The generated "device tree" is checked on stm32mp platform with OF_LIVE activated.

---

 common/image-fdt.c  |  2 +-
 include/tee/optee.h |  4 ++--
 lib/optee/optee.c   | 45 ++++++++++++++++++---------------------------
 3 files changed, 21 insertions(+), 30 deletions(-)
common/image-fdt.c +1 -1
index 707b44a69d..bf5fbbf6e9 100644
@@ -561,7 +561,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 		goto err;
 	}
 
-	fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob);
+	fdt_ret = optee_copy_fdt_nodes(blob);
 	if (fdt_ret) {
 		printf("ERROR: transfer of optee nodes to new fdt failed: %s\n",
 		       fdt_strerror(fdt_ret));
include/tee/optee.h +2 -2
index affa937da0..ebdfe5e98d 100644
@@ -71,9 +71,9 @@ static inline int optee_verify_bootm_image(unsigned long image_addr,
 #endif
 
 #if defined(CONFIG_OPTEE) && defined(CONFIG_OF_LIBFDT)
-int optee_copy_fdt_nodes(const void *old_blob, void *new_blob);
+int optee_copy_fdt_nodes(void *new_blob);
 #else
-static inline int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
+static inline int optee_copy_fdt_nodes(void *new_blob)
 {
 	return 0;
 }
lib/optee/optee.c +18 -27

102 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 lib: optee: migration optee_copy_fdt_nodes for OF_LIVE support

Quoted 4 lines · Patrick Delaunay

The optee_copy_fdt_nodes is only used to copy op-tee nodes of U-Boot device tree (from gd->fdt_blob when OF_LIVE is not activated) to external device tree but it is not compatible with OF_LIVE.

Quoted 8 lines

This patch migrates all used function fdt_ functions to read node on old_blob to ofnode functions, compatible with OF_LIVE and remove this parameter "old_blob".

The generated "device tree" is checked on stm32mp platform with OF_LIVE activated.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/31b75762/attachment.sig>