summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDario Binacchi <[email protected]>2026-01-18 11:48:43 +0100
committerPatrice Chotard <[email protected]>2026-01-29 10:47:57 +0100
commit07cd29b175d405f904b3f638b75eb9006e5ecba0 (patch)
treef7c3f7a8b10509c00797eb6fe6c629dbf28bb357 /board
parenta370c2b4063b739e4d95192a6efb16f28a30f2e1 (diff)
board: stm32mp2: read boot index from backup register
Following the 'commit 95b5a7de30f6 ("FWU: STM32MP1: Add support to read boot index from backup register")', this patch enables reading the boot index from backup registers on STM32MP2 platforms. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Patrice Chotard <[email protected]>
Diffstat (limited to 'board')
-rw-r--r--board/st/stm32mp2/stm32mp2.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
index 7bc7d2a608f..43bc583378e 100644
--- a/board/st/stm32mp2/stm32mp2.c
+++ b/board/st/stm32mp2/stm32mp2.c
@@ -188,3 +188,24 @@ void board_quiesce_devices(void)
{
led_boot_off();
}
+
+#if defined(CONFIG_FWU_MULTI_BANK_UPDATE)
+
+#include <fwu.h>
+
+/**
+ * fwu_plat_get_bootidx() - Get the value of the boot index
+ * @boot_idx: Boot index value
+ *
+ * Get the value of the bank(partition) from which the platform
+ * has booted. This value is passed to U-Boot from the earlier
+ * stage bootloader which loads and boots all the relevant
+ * firmware images
+ *
+ */
+void fwu_plat_get_bootidx(uint *boot_idx)
+{
+ *boot_idx = (readl(TAMP_FWU_BOOT_INFO_REG) >>
+ TAMP_FWU_BOOT_IDX_OFFSET) & TAMP_FWU_BOOT_IDX_MASK;
+}
+#endif /* CONFIG_FWU_MULTI_BANK_UPDATE */