summaryrefslogtreecommitdiff
path: root/board/st
diff options
context:
space:
mode:
Diffstat (limited to 'board/st')
-rw-r--r--board/st/common/Kconfig2
-rw-r--r--board/st/common/MAINTAINERS2
-rw-r--r--board/st/common/Makefile1
-rw-r--r--board/st/common/stm32mp_fwu.c55
-rw-r--r--board/st/stih410-b2260/board.c4
-rw-r--r--board/st/stm32h750-art-pi/stm32h750-art-pi.c5
-rw-r--r--board/st/stm32mp1/MAINTAINERS2
-rw-r--r--board/st/stm32mp1/stm32mp1.c28
-rw-r--r--board/st/stm32mp2/stm32mp2.c21
9 files changed, 66 insertions, 54 deletions
diff --git a/board/st/common/Kconfig b/board/st/common/Kconfig
index 3d00f3f3331..aafbffbf6db 100644
--- a/board/st/common/Kconfig
+++ b/board/st/common/Kconfig
@@ -14,7 +14,7 @@ config DFU_ALT_RAM0
This defines the partitions of ram used to build dfu dynamically.
config TYPEC_STUSB160X
- tristate "STMicroelectronics STUSB160X Type-C controller driver"
+ bool "STMicroelectronics STUSB160X Type-C controller driver"
depends on DM_I2C
help
Say Y if your system has STMicroelectronics STUSB160X Type-C port
diff --git a/board/st/common/MAINTAINERS b/board/st/common/MAINTAINERS
index 0c6db547725..e87284c6a8b 100644
--- a/board/st/common/MAINTAINERS
+++ b/board/st/common/MAINTAINERS
@@ -1,6 +1,6 @@
ST BOARDS
M: Patrick Delaunay <[email protected]>
L: [email protected] (moderated for non-subscribers)
-T: git https://source.denx.de/u-boot/custodians/u-boot-stm.git
+T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-stm.git
S: Maintained
F: board/st/common/
diff --git a/board/st/common/Makefile b/board/st/common/Makefile
index 122b13c3aa8..36dfaddfa0e 100644
--- a/board/st/common/Makefile
+++ b/board/st/common/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_PMIC_STPMIC1) += stpmic1.o
ifeq ($(CONFIG_ARCH_STM32MP),y)
obj-$(CONFIG_SET_DFU_ALT_INFO) += stm32mp_dfu.o
obj-$(CONFIG_$(PHASE_)DFU_VIRT) += stm32mp_dfu_virt.o
+obj-$(CONFIG_FWU_MULTI_BANK_UPDATE) += stm32mp_fwu.o
endif
obj-$(CONFIG_TYPEC_STUSB160X) += stusb160x.o
diff --git a/board/st/common/stm32mp_fwu.c b/board/st/common/stm32mp_fwu.c
new file mode 100644
index 00000000000..ac7ca6bdca2
--- /dev/null
+++ b/board/st/common/stm32mp_fwu.c
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
+/*
+ * Copyright (C) 2026 Amarula Solutions, Dario Binacchi <[email protected]>
+ */
+
+#include <fwu.h>
+#include <part_efi.h>
+#include <asm/io.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;
+}
+
+int fwu_platform_hook(struct udevice *dev, struct fwu_data *data)
+{
+ uint boot_idx;
+ efi_guid_t boot_uuid, root_uuid;
+ const efi_guid_t boot_type_guid = PARTITION_XBOOTLDR;
+ const efi_guid_t root_type_guid =
+ PARTITION_LINUX_FILE_SYSTEM_DATA_GUID;
+ char uuidbuf[UUID_STR_LEN + 1];
+ int retb, retr;
+
+ fwu_plat_get_bootidx(&boot_idx);
+
+ retb = fwu_mdata_get_image_guid(&boot_uuid, &boot_type_guid, boot_idx);
+ retr = fwu_mdata_get_image_guid(&root_uuid, &root_type_guid, boot_idx);
+
+ if (!retb && !retr) {
+ uuid_bin_to_str(boot_uuid.b, uuidbuf, UUID_STR_FORMAT_GUID);
+ env_set("boot_partuuid", uuidbuf);
+
+ uuid_bin_to_str(root_uuid.b, uuidbuf, UUID_STR_FORMAT_GUID);
+ env_set("root_partuuid", uuidbuf);
+ } else if (!retb && retr) {
+ log_warning("%s: found boot GUID but missing root GUID (%d)\n",
+ __func__, retr);
+ } else if (!retr && retb) {
+ log_warning("%s: found root GUID but missing boot GUID (%d)\n",
+ __func__, retb);
+ }
+
+ return 0;
+}
diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c
index f5174720434..a1b0265d5ac 100644
--- a/board/st/stih410-b2260/board.c
+++ b/board/st/stih410-b2260/board.c
@@ -18,8 +18,8 @@ int dram_init(void)
int dram_init_banksize(void)
{
- gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ gd->dram[0].start = PHYS_SDRAM_1;
+ gd->dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
diff --git a/board/st/stm32h750-art-pi/stm32h750-art-pi.c b/board/st/stm32h750-art-pi/stm32h750-art-pi.c
index 244bb5eefb3..8b1b2333779 100644
--- a/board/st/stm32h750-art-pi/stm32h750-art-pi.c
+++ b/board/st/stm32h750-art-pi/stm32h750-art-pi.c
@@ -32,11 +32,6 @@ int dram_init_banksize(void)
return 0;
}
-int board_early_init_f(void)
-{
- return 0;
-}
-
int board_late_init(void)
{
return 0;
diff --git a/board/st/stm32mp1/MAINTAINERS b/board/st/stm32mp1/MAINTAINERS
index f924e61b3c0..f488361ab47 100644
--- a/board/st/stm32mp1/MAINTAINERS
+++ b/board/st/stm32mp1/MAINTAINERS
@@ -2,7 +2,7 @@ STM32MP1 BOARD
M: Patrick Delaunay <[email protected]>
M: Patrice Chotard <[email protected]>
L: [email protected] (moderated for non-subscribers)
-T: git https://source.denx.de/u-boot/custodians/u-boot-stm.git
+T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-stm.git
S: Maintained
F: arch/arm/dts/stm32mp13*
F: arch/arm/dts/stm32mp15*
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 5f7c6822116..9b933a2ba0b 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -326,8 +326,8 @@ static int adc_measurement(ofnode node, int adc_count, int *min_uV, int *max_uV)
static int board_check_usb_power(void)
{
ofnode node;
- int max_uV = 0;
- int min_uV = USB_START_HIGH_THRESHOLD_UV;
+ int max_uV;
+ int min_uV;
int adc_count, ret;
u32 nb_blink;
u8 i;
@@ -358,6 +358,9 @@ static int board_check_usb_power(void)
/* perform maximum of 2 ADC measurements to detect power supply current */
for (i = 0; i < 2; i++) {
+ max_uV = 0;
+ min_uV = USB_START_HIGH_THRESHOLD_UV;
+
ret = adc_measurement(node, adc_count, &min_uV, &max_uV);
if (ret)
return ret;
@@ -834,24 +837,3 @@ static void board_copro_image_process(ulong fw_image, size_t fw_size)
}
U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_COPRO, board_copro_image_process);
-
-#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 */
diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c
index 43bc583378e..7bc7d2a608f 100644
--- a/board/st/stm32mp2/stm32mp2.c
+++ b/board/st/stm32mp2/stm32mp2.c
@@ -188,24 +188,3 @@ 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 */