[PATCH v5 20/21] arm: stm32mp: spl: fix function with fdt_addr_t input

Johan Jonker jbx6244 at gmail.com
Tue Feb 28 22:22:21 CET 2023


The fdt_addr_t and phys_addr_t size have been decoupled.
A 32bit CPU can expect 64-bit data from the device tree parser,
so fix ofnode_get_addr_size function with fdt_addr_t input to
be able to handle both sizes for stm32mp SoC in spl.c file.

Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
---
 arch/arm/mach-stm32mp/spl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index 19d9fe04..6b26641b 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -112,7 +112,7 @@ uint32_t stm32mp_get_dram_size(void)

 static int optee_get_reserved_memory(uint32_t *start, uint32_t *size)
 {
-	phys_size_t fdt_mem_size;
+	fdt_addr_t fdt_mem_size;
 	fdt_addr_t fdt_start;
 	ofnode node;

@@ -121,8 +121,8 @@ static int optee_get_reserved_memory(uint32_t *start, uint32_t *size)
 		return 0;

 	fdt_start = ofnode_get_addr_size(node, "reg", &fdt_mem_size);
-	*start = fdt_start;
-	*size = fdt_mem_size;
+	*start = (uint32_t)fdt_start;
+	*size = (uint32_t)fdt_mem_size;
 	return (fdt_start < 0) ? fdt_start : 0;
 }

--
2.20.1



More information about the U-Boot mailing list