]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp: fix name of optee reserved memory node
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 11 Oct 2024 15:31:51 +0000 (17:31 +0200)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 16 Oct 2024 18:18:57 +0000 (20:18 +0200)
In OP-TEE, the "optee_core@" node is reserved, appended in non secure
device tree (see mark_tzdram_as_reserved() function under CFG_DT) so
this name must be checked in optee_get_reserved_memory().
We keep the check on /reserved-memory/optee@ node to have backward
compatibility with STMT32Image booting, when the reserved node is
already present in U-Boot or SPL device tree with name "optee@".

This patch solves a boot issue on board with OP-TEE for U-Boot
compiled with stm32mp15_defconfig and without secure configuration
device tree (stm32mp157c-dk2.dts for example).

Fixes: 5fe9e0deabb1 ("stm32mp: allow calling optee_get_reserved_memory()
from U-Boot")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
arch/arm/mach-stm32mp/dram_init.c

index a2ad6d1aaac0ea8ab7d8ece36be2b8b05ed7ab42..b06105768b34ac94fe9f92cfc6ff1e83bfa757c6 100644 (file)
@@ -25,8 +25,11 @@ int optee_get_reserved_memory(u32 *start, u32 *size)
        ofnode node;
 
        node = ofnode_path("/reserved-memory/optee");
-       if (!ofnode_valid(node))
-               return -ENOENT;
+       if (!ofnode_valid(node)) {
+               node = ofnode_path("/reserved-memory/optee_core");
+               if (!ofnode_valid(node))
+                       return -ENOENT;
+       }
 
        fdt_start = ofnode_get_addr_size(node, "reg", &fdt_mem_size);
        *start = fdt_start;