From 40da460641fc441b30b2da5f54dc6c627bfc5bd1 Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Tue, 9 Dec 2025 14:39:20 +0100 Subject: [PATCH] board: stm32mp2: fix fwu_mdata node updating Comparing the SD card boot with the eMMC one, the DTS differs as follows: - fwu-mdata-store = <0x00000085>; + fwu-mdata-store = "/soc@0/bus@42080000/mmc@48230000"; In both cases, the U-Boot DTS loaded by tf-a-stm32mp at address 0x84400000 was obtained with the following commands: STM32MP> fdt addr 0x84400000 Working FDT set to 84400000 STM32MP> fdt print As shown in the diff, the working case (SD card) uses a numeric value, i.e. the phandle of the sdmmc1 node, while the eMMC case uses a path. This patch updates the fwu-mdata-store property to use the phandle instead of the path. Signed-off-by: Dario Binacchi --- board/st/stm32mp2/stm32mp2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c index 8ea962ef10a9..d312e5cb1071 100644 --- a/board/st/stm32mp2/stm32mp2.c +++ b/board/st/stm32mp2/stm32mp2.c @@ -818,6 +818,7 @@ int fdt_update_fwu_properties(void *blob, int nodeoff, { int ret; int storage_off; + const fdt32_t *phandle; ret = fdt_increase_size(blob, 100); if (ret) { @@ -837,8 +838,14 @@ int fdt_update_fwu_properties(void *blob, int nodeoff, return nodeoff; } - ret = fdt_setprop_string(blob, nodeoff, "fwu-mdata-store", storage_path); + phandle = fdt_getprop(blob, storage_off, "phandle", NULL); + if (!phandle) { + log_err("Can't find phandle for %s\n", storage_path); + return -ENOENT; + } + ret = fdt_setprop_u32(blob, nodeoff, "fwu-mdata-store", + fdt32_to_cpu(*phandle)); if (ret < 0) log_err("Can't set fwu-mdata-store property\n");