Skip to contentSkip to conversation

mach-k3: fix reading size and addr from fdt on R5

PATCH In review Anshul Dalal 3 participants 3 messages Sep 3, 2025 – Sep 16, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mach-k3: fix reading size and addr from fdt on R5

fdtdec_get_addr_size uses architecture dependent datatypes which causes the 32-bit R5 to fail when reading the 64-bit size and addr fields of reg nodes from the fdt.

Therefore change it to a common api for both 64 and 32 bit platforms to allow for fdt fixups from R5.

Fixes 8b0fc29de0e3 ("arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT")
---
 arch/arm/mach-k3/common_fdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-k3/common_fdt.c +3 -1
index 2777354c6ab..1e6786f6c20 100644
@@ -140,7 +140,9 @@ int fdt_fixup_reserved(void *blob, const char *name,
 			return -EINVAL;
 		if (!strncmp(node_name, name, strlen(name))) {
 			/* Read out old size first */
-			addr = fdtdec_get_addr_size(blob, subnode, "reg", &size);
+			addr = fdtdec_get_addr_size_auto_parent(
+				blob, nodeoffset, subnode, "reg", 0, &size,
+				false);
 			if (addr == FDT_ADDR_T_NONE)
 				return -EINVAL;
 			new_size = size;
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Anshul Dalal

fdtdec_get_addr_size uses architecture dependent datatypes which causes the 32-bit R5 to fail when reading the 64-bit size and addr fields of reg nodes from the fdt.

Therefore change it to a common api for both 64 and 32 bit platforms to allow for fdt fixups from R5.

Fixes 8b0fc29de0e3 ("arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT")
---
 arch/arm/mach-k3/common_fdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-k3/common_fdt.c +0 -0
index 2777354c6ab..1e6786f6c20 100644

arch/arm/mach-k3/common_fdt.c int fdt_fixup_reserved(void *blob, const char *name, · line 145

Quoted 7 lines
arch/arm/mach-k3/common_fdt.c +3 -1
@@ -140,7 +140,9 @@ int fdt_fixup_reserved(void *blob, const char *name,
 			return -EINVAL;
 		if (!strncmp(node_name, name, strlen(name))) {
 			/* Read out old size first */
-			addr = fdtdec_get_addr_size(blob, subnode, "reg", &size);
+			addr = fdtdec_get_addr_size_auto_parent(
+				blob, nodeoffset, subnode, "reg", 0, &size,
+				false);
Signature · 3 lines
Best regards,
Dhruva Gole
Texas Instruments Incorporated
#2 lore raw
In reply to Anshul Dalal
Quoted 8 lines · Anshul Dalal

fdtdec_get_addr_size uses architecture dependent datatypes which causes the 32-bit R5 to fail when reading the 64-bit size and addr fields of reg nodes from the fdt.

Therefore change it to a common api for both 64 and 32 bit platforms to allow for fdt fixups from R5.

[...]

Applied to u-boot/next, thanks!

[1/1] mach-k3: fix reading size and addr from fdt on R5

      commit: 7aa5271def6ba16ff4426aa164b7bb743673b3c3
Signature · 1 line
Tom