* [PATCH 0/3] ARM: stm32mp: Add Avenger96 board support
@ 2025-11-28 0:51 Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 1/3] common: bbu: refactor flash operations into separate function Sohaib Mohamed
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sohaib Mohamed @ 2025-11-28 0:51 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Sohaib Mohamed
Add support for Arrow STM32MP157A Avenger96 board with bootloader
update handlers for MMC and NOR flash.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
Sohaib Mohamed (3):
common: bbu: refactor flash operations into separate function
ARM: stm32mp: bbu: add NOR flash FIP update handler
ARM: stm32mp: add support for STM32MP157A Avenger96 board
arch/arm/boards/Makefile | 1 +
arch/arm/boards/dhcor-stm32mp1/Makefile | 2 +
arch/arm/boards/dhcor-stm32mp1/board.c | 47 ++++++++++++++++++
arch/arm/configs/multi_v7_defconfig | 2 +
arch/arm/configs/stm32mp_defconfig | 2 +
arch/arm/dts/Makefile | 1 +
arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts | 4 ++
arch/arm/mach-stm32mp/Kconfig | 4 ++
arch/arm/mach-stm32mp/bbu.c | 77 +++++++++++++++++++++++++++++
common/bbu.c | 17 ++++---
include/bbu.h | 2 +
include/mach/stm32mp/bbu.h | 10 ++++
12 files changed, 163 insertions(+), 6 deletions(-)
---
base-commit: a831f32782a5ce216301ccb52e4d27e3462632f3
change-id: 20251128-avenger96-2b70277cdd7a
Best regards,
--
Sohaib Mohamed <sohaib.amhmd@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] common: bbu: refactor flash operations into separate function
2025-11-28 0:51 [PATCH 0/3] ARM: stm32mp: Add Avenger96 board support Sohaib Mohamed
@ 2025-11-28 0:51 ` Sohaib Mohamed
2025-11-28 9:35 ` Ahmad Fatoum
2025-11-28 0:51 ` [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board Sohaib Mohamed
2 siblings, 1 reply; 8+ messages in thread
From: Sohaib Mohamed @ 2025-11-28 0:51 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Sohaib Mohamed
Extract flash logic (protect, erase, write) from bbu_std_file_handler()
into a new flash() function that accepts an offset parameter, so it can
be used from further barebox update handlers as well.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
common/bbu.c | 17 +++++++++++------
include/bbu.h | 2 ++
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/common/bbu.c b/common/bbu.c
index 03261583fe..39db87e823 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -431,8 +431,7 @@ int bbu_mmcboot_register_handler(const char *name,
return ret;
}
-int bbu_std_file_handler(struct bbu_handler *handler,
- struct bbu_data *data)
+int bbu_flash(struct bbu_data *data, loff_t offset)
{
int fd, ret;
struct stat s;
@@ -458,25 +457,25 @@ int bbu_std_file_handler(struct bbu_handler *handler,
if (fd < 0)
return fd;
- ret = protect(fd, data->len, 0, 0);
+ ret = protect(fd, data->len, offset, 0);
if (ret && (ret != -ENOSYS) && (ret != -ENOTSUPP)) {
printf("unprotecting %s failed with %pe\n", data->devicefile,
ERR_PTR(ret));
goto err_close;
}
- ret = erase(fd, data->len, 0, ERASE_TO_WRITE);
+ ret = erase(fd, data->len, offset, ERASE_TO_WRITE);
if (ret && ret != -ENOSYS) {
printf("erasing %s failed with %pe\n", data->devicefile,
ERR_PTR(ret));
goto err_close;
}
- ret = write_full(fd, data->image, data->len);
+ ret = pwrite_full(fd, data->image, data->len, offset);
if (ret < 0)
goto err_close;
- protect(fd, data->len, 0, 1);
+ protect(fd, data->len, offset, 1);
ret = 0;
@@ -486,6 +485,12 @@ int bbu_std_file_handler(struct bbu_handler *handler,
return ret;
}
+int bbu_std_file_handler(struct bbu_handler *handler,
+ struct bbu_data *data)
+{
+ return bbu_flash(data, 0);
+}
+
static int bbu_std_file_handler_checked(struct bbu_handler *handler,
struct bbu_data *data)
{
diff --git a/include/bbu.h b/include/bbu.h
index 94006563c9..f5b74b32ac 100644
--- a/include/bbu.h
+++ b/include/bbu.h
@@ -56,6 +56,8 @@ int bbu_mmcboot_handler(struct bbu_handler *, struct bbu_data *,
int bbu_std_file_handler(struct bbu_handler *handler,
struct bbu_data *data);
+int bbu_flash(struct bbu_data *data, loff_t offset);
+
#ifdef CONFIG_BAREBOX_UPDATE
bool bbu_handlers_available(void);
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler
2025-11-28 0:51 [PATCH 0/3] ARM: stm32mp: Add Avenger96 board support Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 1/3] common: bbu: refactor flash operations into separate function Sohaib Mohamed
@ 2025-11-28 0:51 ` Sohaib Mohamed
2025-11-28 9:39 ` Ahmad Fatoum
2025-12-01 10:38 ` Sascha Hauer
2025-11-28 0:51 ` [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board Sohaib Mohamed
2 siblings, 2 replies; 8+ messages in thread
From: Sohaib Mohamed @ 2025-11-28 0:51 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Sohaib Mohamed
Add support for updating STM32MP1 bootloader in NOR flash. The handler
automatically detects FIP location (256K or 512K offset) and flashes
FSBL at offset 0 and FIP at offset 512K. FIP is truncated if it exceeds
available space.
The handler detects the FIP location within the image (at either 256K
or 512K offset) and flashes components to their appropriate locations:
- FSBL at offset 0 (first 256K)
- FIP at offset 512K (remainder of flash)
When flashing from eMMC boot partitions to NOR, the FIP is truncated if
needed since eMMC boot partitions are typically larger than available
NOR flash space.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
arch/arm/mach-stm32mp/bbu.c | 77 +++++++++++++++++++++++++++++++++++++++++++++
include/mach/stm32mp/bbu.h | 10 ++++++
2 files changed, 87 insertions(+)
diff --git a/arch/arm/mach-stm32mp/bbu.c b/arch/arm/mach-stm32mp/bbu.c
index 07b5111341..e8d0138cc7 100644
--- a/arch/arm/mach-stm32mp/bbu.c
+++ b/arch/arm/mach-stm32mp/bbu.c
@@ -193,3 +193,80 @@ int stm32mp_bbu_mmc_fip_register(const char *name,
return ret;
}
+
+static int stm32mp_bbu_nor_fip_handler(struct bbu_handler *handler,
+ struct bbu_data *data)
+{
+ struct bbu_data *fsbl_data, *fip_data;
+ enum filetype filetype;
+ int ret;
+
+ filetype = file_detect_type(data->image, data->len);
+ if (filetype == filetype_fip) {
+ pr_debug("Flashing FIP at offset 512K\n");
+ return bbu_flash(data, SZ_512K);
+ }
+
+ if (filetype != filetype_stm32_image_fsbl_v1) {
+ if (!bbu_force(data, "incorrect image type. Expected: %s, got %s",
+ file_type_to_string(filetype_stm32_image_fsbl_v1),
+ file_type_to_string(filetype)))
+ return -EINVAL;
+
+ /* Force: Let's assume it's an FSBL and flash anyway */
+ }
+
+ if (data->len > SZ_256K)
+ filetype = file_detect_type(data->image + SZ_256K,
+ data->len - SZ_256K);
+ else
+ filetype = filetype_unknown;
+
+ /* Not an eMMC image, just flash 1:1 */
+ if (filetype != filetype_fip) {
+ pr_debug("Flashing FSBL at offset 0\n");
+ return bbu_flash(data, 0);
+ }
+
+ /* On SPI-NOR, offset 256K is FSBL2. If we get a FIP image there
+ * instead, let's assume that's an eMMC boot partition image
+ * and flash the FSBL to offset 0 and the remainder to offset 512K
+ */
+
+ pr_debug("Flashing FSBL at offset 0\n");
+ fsbl_data = data;
+ fsbl_data->image = data->image;
+ fsbl_data->len = SZ_256K;
+
+ ret = bbu_flash(fsbl_data, 0);
+ if (ret < 0)
+ return ret;
+
+ pr_debug("Flashing FIP from file offset 256K at offset 512K\n");
+ fip_data = data;
+ fip_data->image = data->image + SZ_256K;
+ fip_data->len = data->len - SZ_256K;
+
+ return bbu_flash(fip_data, SZ_512K);
+}
+
+int stm32mp_bbu_nor_fip_register(const char *name,
+ const char *devicefile,
+ unsigned long flags)
+{
+ struct stm32mp_bbu_handler *priv;
+ int ret;
+
+ priv = xzalloc(sizeof(*priv));
+
+ priv->handler.flags = flags;
+ priv->handler.devicefile = devicefile;
+ priv->handler.name = name;
+ priv->handler.handler = stm32mp_bbu_nor_fip_handler;
+
+ ret = bbu_register_handler(&priv->handler);
+ if (ret)
+ free(priv);
+
+ return ret;
+}
diff --git a/include/mach/stm32mp/bbu.h b/include/mach/stm32mp/bbu.h
index 233bcf6478..87b29f1527 100644
--- a/include/mach/stm32mp/bbu.h
+++ b/include/mach/stm32mp/bbu.h
@@ -10,6 +10,9 @@
int stm32mp_bbu_mmc_fip_register(const char *name, const char *devicefile,
unsigned long flags);
+int stm32mp_bbu_nor_fip_register(const char *name, const char *devicefile,
+ unsigned long flags);
+
#else
static inline int stm32mp_bbu_mmc_fip_register(const char *name,
@@ -19,6 +22,13 @@ static inline int stm32mp_bbu_mmc_fip_register(const char *name,
return -ENOSYS;
}
+static inline int stm32mp_bbu_nor_fip_register(const char *name,
+ const char *devicefile,
+ unsigned long flags)
+{
+ return -ENOSYS;
+}
+
#endif
#endif /* MACH_STM32MP_BBU_H_ */
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board
2025-11-28 0:51 [PATCH 0/3] ARM: stm32mp: Add Avenger96 board support Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 1/3] common: bbu: refactor flash operations into separate function Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler Sohaib Mohamed
@ 2025-11-28 0:51 ` Sohaib Mohamed
2025-11-28 9:40 ` Ahmad Fatoum
2 siblings, 1 reply; 8+ messages in thread
From: Sohaib Mohamed @ 2025-11-28 0:51 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Sohaib Mohamed
Add board support for the Arrow Electronics STM32MP157A Avenger96 board.
This commit adds:
- Board initialization code with boot source detection
- barebox_update handlers for SD card, eMMC
Tested with STM32MP157A DHCOR SoM on Avenger96 carrier board.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
arch/arm/boards/Makefile | 1 +
arch/arm/boards/dhcor-stm32mp1/Makefile | 2 ++
arch/arm/boards/dhcor-stm32mp1/board.c | 47 +++++++++++++++++++++++++++++
arch/arm/configs/multi_v7_defconfig | 2 ++
arch/arm/configs/stm32mp_defconfig | 2 ++
arch/arm/dts/Makefile | 1 +
arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts | 4 +++
arch/arm/mach-stm32mp/Kconfig | 4 +++
8 files changed, 63 insertions(+)
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index f73285ede9..f75277bc17 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -135,6 +135,7 @@ obj-$(CONFIG_MACH_LXA_MC1) += lxa-mc1/
obj-$(CONFIG_MACH_LXA_TAC) += lxa-tac/
obj-$(CONFIG_MACH_LXA_FAIRYTUX2) += lxa-fairytux2/
obj-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp15x-ev1/
+obj-$(CONFIG_MACH_DHCOR_STM32MP1) += dhcor-stm32mp1/
obj-$(CONFIG_MACH_TECHNEXION_PICO_HOBBIT) += technexion-pico-hobbit/
obj-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += technexion-wandboard/
obj-$(CONFIG_MACH_TNY_A9260) += tny-a926x/
diff --git a/arch/arm/boards/dhcor-stm32mp1/Makefile b/arch/arm/boards/dhcor-stm32mp1/Makefile
new file mode 100644
index 0000000000..bcca1a9f84
--- /dev/null
+++ b/arch/arm/boards/dhcor-stm32mp1/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0+
+obj-y += board.o
diff --git a/arch/arm/boards/dhcor-stm32mp1/board.c b/arch/arm/boards/dhcor-stm32mp1/board.c
new file mode 100644
index 0000000000..2a02942d6c
--- /dev/null
+++ b/arch/arm/boards/dhcor-stm32mp1/board.c
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2025, Sohaib Mohamed <sohaib.amhmd@gmail.com>
+#include <filetype.h>
+#include <common.h>
+#include <init.h>
+#include <asm/memory.h>
+#include <mach/stm32mp/bbu.h>
+#include <bootsource.h>
+#include <of.h>
+
+static int dhcor_stm32mp1_probe(struct device *dev)
+{
+ int emmc_bbu_flag = 0;
+ int sd_bbu_flag = 0;
+ int nor_bbu_flag = 0;
+
+ if (bootsource_get() == BOOTSOURCE_MMC) {
+ if (bootsource_get_instance() == 2)
+ emmc_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
+ else
+ sd_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
+ } else if (bootsource_get() == BOOTSOURCE_NOR) {
+ nor_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
+ } else {
+ emmc_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
+ }
+
+ stm32mp_bbu_mmc_fip_register("sd", "/dev/mmc0", sd_bbu_flag);
+ stm32mp_bbu_mmc_fip_register("emmc", "/dev/mmc1", emmc_bbu_flag);
+ stm32mp_bbu_nor_fip_register("nor", "/dev/m25p0", nor_bbu_flag);
+
+ return 0;
+}
+
+static const struct of_device_id dhcor_stm32mp1_of_match[] = {
+ { .compatible = "dh,stm32mp157a-dhcor-som" },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, dhcor_stm32mp1_of_match);
+BAREBOX_DEEP_PROBE_ENABLE(dhcor_stm32mp1_of_match);
+
+static struct driver dhcor_stm32mp1_driver = {
+ .name = "dhcor_stm32mp1",
+ .probe = dhcor_stm32mp1_probe,
+ .of_compatible = dhcor_stm32mp1_of_match,
+};
+device_platform_driver(dhcor_stm32mp1_driver);
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 93f79c79d2..ef4e106148 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -82,6 +82,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y
CONFIG_MACH_LXA_MC1=y
CONFIG_MACH_LXA_TAC=y
CONFIG_MACH_LXA_FAIRYTUX2=y
+CONFIG_MACH_DHCOR_STM32MP1=y
CONFIG_MACH_SEEED_ODYSSEY=y
CONFIG_MACH_STM32MP15X_EV1=y
CONFIG_MACH_PROTONIC_STM32MP1=y
@@ -214,6 +215,7 @@ CONFIG_DEEP_PROBE_DEFAULT=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_AIODEV=y
CONFIG_STM32_ADC=y
+CONFIG_STM32_QSPI=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_DRIVER_SERIAL_STM32=y
CONFIG_DRIVER_SERIAL_NS16550=y
diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig
index 4df7b371f3..1d1b75fbb0 100644
--- a/arch/arm/configs/stm32mp_defconfig
+++ b/arch/arm/configs/stm32mp_defconfig
@@ -4,6 +4,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y
CONFIG_MACH_LXA_MC1=y
CONFIG_MACH_LXA_TAC=y
CONFIG_MACH_LXA_FAIRYTUX2=y
+CONFIG_MACH_DHCOR_STM32MP1=y
CONFIG_MACH_SEEED_ODYSSEY=y
CONFIG_MACH_STM32MP15X_EV1=y
CONFIG_MACH_PROTONIC_STM32MP1=y
@@ -104,6 +105,7 @@ CONFIG_NET_FASTBOOT=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_AIODEV=y
CONFIG_STM32_ADC=y
+CONFIG_STM32_QSPI=y
CONFIG_DRIVER_SERIAL_STM32=y
CONFIG_DRIVER_NET_DESIGNWARE_STM32=y
CONFIG_AT803X_PHY=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index e78722a9a7..3cd1d8fe59 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -169,6 +169,7 @@ lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o stm32mp157c-lxa-mc1-scmi
lwl-$(CONFIG_MACH_LXA_TAC) += stm32mp157c-lxa-tac-gen1.dtb.o stm32mp157c-lxa-tac-gen2.dtb.o \
stm32mp153c-lxa-tac-gen3.dtb.o
lwl-$(CONFIG_MACH_LXA_FAIRYTUX2) += stm32mp153c-lxa-fairytux2-gen1.dtb.o stm32mp153c-lxa-fairytux2-gen2.dtb.o
+lwl-$(CONFIG_MACH_DHCOR_STM32MP1) += stm32mp157a-dhcor-stm32mp1.dtb.o
lwl-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp157c-ev1.dtb.o stm32mp157c-ev1-scmi.dtb.o
lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o
lwl-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += imx6q-wandboard.dtb.o imx6dl-wandboard.dtb.o
diff --git a/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts b/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts
new file mode 100644
index 0000000000..5187cc882f
--- /dev/null
+++ b/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+
+#include <arm/st/stm32mp157a-dhcor-avenger96.dts>
+#include "stm32mp151.dtsi"
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 5ea0c4004f..54ce644d73 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -39,6 +39,10 @@ config MACH_LXA_FAIRYTUX2
bool "Linux Automation FairyTux 2"
select BOARD_LXA
+config MACH_DHCOR_STM32MP1
+ select ARCH_STM32MP157
+ bool "DHCOR STM32MP1 boards including Arrow Avenger96"
+
config MACH_SEEED_ODYSSEY
select ARCH_STM32MP157
bool "Seeed Studio Odyssey"
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] common: bbu: refactor flash operations into separate function
2025-11-28 0:51 ` [PATCH 1/3] common: bbu: refactor flash operations into separate function Sohaib Mohamed
@ 2025-11-28 9:35 ` Ahmad Fatoum
0 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 9:35 UTC (permalink / raw)
To: Sohaib Mohamed, Sascha Hauer, BAREBOX
On 11/28/25 1:51 AM, Sohaib Mohamed wrote:
> Extract flash logic (protect, erase, write) from bbu_std_file_handler()
> into a new flash() function that accepts an offset parameter, so it can
> be used from further barebox update handlers as well.
>
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> common/bbu.c | 17 +++++++++++------
> include/bbu.h | 2 ++
> 2 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/common/bbu.c b/common/bbu.c
> index 03261583fe..39db87e823 100644
> --- a/common/bbu.c
> +++ b/common/bbu.c
> @@ -431,8 +431,7 @@ int bbu_mmcboot_register_handler(const char *name,
> return ret;
> }
>
> -int bbu_std_file_handler(struct bbu_handler *handler,
> - struct bbu_data *data)
> +int bbu_flash(struct bbu_data *data, loff_t offset)
> {
> int fd, ret;
> struct stat s;
> @@ -458,25 +457,25 @@ int bbu_std_file_handler(struct bbu_handler *handler,
> if (fd < 0)
> return fd;
>
> - ret = protect(fd, data->len, 0, 0);
> + ret = protect(fd, data->len, offset, 0);
> if (ret && (ret != -ENOSYS) && (ret != -ENOTSUPP)) {
> printf("unprotecting %s failed with %pe\n", data->devicefile,
> ERR_PTR(ret));
> goto err_close;
> }
>
> - ret = erase(fd, data->len, 0, ERASE_TO_WRITE);
> + ret = erase(fd, data->len, offset, ERASE_TO_WRITE);
> if (ret && ret != -ENOSYS) {
> printf("erasing %s failed with %pe\n", data->devicefile,
> ERR_PTR(ret));
> goto err_close;
> }
>
> - ret = write_full(fd, data->image, data->len);
> + ret = pwrite_full(fd, data->image, data->len, offset);
> if (ret < 0)
> goto err_close;
>
> - protect(fd, data->len, 0, 1);
> + protect(fd, data->len, offset, 1);
>
> ret = 0;
>
> @@ -486,6 +485,12 @@ int bbu_std_file_handler(struct bbu_handler *handler,
> return ret;
> }
>
> +int bbu_std_file_handler(struct bbu_handler *handler,
> + struct bbu_data *data)
> +{
> + return bbu_flash(data, 0);
> +}
> +
> static int bbu_std_file_handler_checked(struct bbu_handler *handler,
> struct bbu_data *data)
> {
> diff --git a/include/bbu.h b/include/bbu.h
> index 94006563c9..f5b74b32ac 100644
> --- a/include/bbu.h
> +++ b/include/bbu.h
> @@ -56,6 +56,8 @@ int bbu_mmcboot_handler(struct bbu_handler *, struct bbu_data *,
> int bbu_std_file_handler(struct bbu_handler *handler,
> struct bbu_data *data);
>
> +int bbu_flash(struct bbu_data *data, loff_t offset);
> +
> #ifdef CONFIG_BAREBOX_UPDATE
>
> bool bbu_handlers_available(void);
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler
2025-11-28 0:51 ` [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler Sohaib Mohamed
@ 2025-11-28 9:39 ` Ahmad Fatoum
2025-12-01 10:38 ` Sascha Hauer
1 sibling, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 9:39 UTC (permalink / raw)
To: Sohaib Mohamed, Sascha Hauer, BAREBOX
On 11/28/25 1:51 AM, Sohaib Mohamed wrote:
> Add support for updating STM32MP1 bootloader in NOR flash. The handler
> automatically detects FIP location (256K or 512K offset) and flashes
> FSBL at offset 0 and FIP at offset 512K. FIP is truncated if it exceeds
> available space.
>
> The handler detects the FIP location within the image (at either 256K
> or 512K offset) and flashes components to their appropriate locations:
> - FSBL at offset 0 (first 256K)
> - FIP at offset 512K (remainder of flash)
Above two paragraphs just repeat the same info.
> When flashing from eMMC boot partitions to NOR, the FIP is truncated if
> needed since eMMC boot partitions are typically larger than available
> NOR flash space.
This doesn't reflect what the code is doing. It just passes it along to
bbu_flash. I would expect flashing a too big image would just fail with
-ENOSPC, because pwrite_full() couldn't write all bytes and not
truncation as the commit message claims.
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/arm/mach-stm32mp/bbu.c | 77 +++++++++++++++++++++++++++++++++++++++++++++
> include/mach/stm32mp/bbu.h | 10 ++++++
> 2 files changed, 87 insertions(+)
>
> diff --git a/arch/arm/mach-stm32mp/bbu.c b/arch/arm/mach-stm32mp/bbu.c
> index 07b5111341..e8d0138cc7 100644
> --- a/arch/arm/mach-stm32mp/bbu.c
> +++ b/arch/arm/mach-stm32mp/bbu.c
> @@ -193,3 +193,80 @@ int stm32mp_bbu_mmc_fip_register(const char *name,
>
> return ret;
> }
> +
> +static int stm32mp_bbu_nor_fip_handler(struct bbu_handler *handler,
> + struct bbu_data *data)
> +{
> + struct bbu_data *fsbl_data, *fip_data;
> + enum filetype filetype;
> + int ret;
> +
> + filetype = file_detect_type(data->image, data->len);
> + if (filetype == filetype_fip) {
> + pr_debug("Flashing FIP at offset 512K\n");
> + return bbu_flash(data, SZ_512K);
> + }
> +
> + if (filetype != filetype_stm32_image_fsbl_v1) {
> + if (!bbu_force(data, "incorrect image type. Expected: %s, got %s",
> + file_type_to_string(filetype_stm32_image_fsbl_v1),
> + file_type_to_string(filetype)))
> + return -EINVAL;
> +
> + /* Force: Let's assume it's an FSBL and flash anyway */
> + }
> +
> + if (data->len > SZ_256K)
> + filetype = file_detect_type(data->image + SZ_256K,
> + data->len - SZ_256K);
> + else
> + filetype = filetype_unknown;
> +
> + /* Not an eMMC image, just flash 1:1 */
> + if (filetype != filetype_fip) {
> + pr_debug("Flashing FSBL at offset 0\n");
> + return bbu_flash(data, 0);
> + }
> +
> + /* On SPI-NOR, offset 256K is FSBL2. If we get a FIP image there
> + * instead, let's assume that's an eMMC boot partition image
> + * and flash the FSBL to offset 0 and the remainder to offset 512K
> + */
> +
> + pr_debug("Flashing FSBL at offset 0\n");
> + fsbl_data = data;
> + fsbl_data->image = data->image;
> + fsbl_data->len = SZ_256K;
> +
> + ret = bbu_flash(fsbl_data, 0);
> + if (ret < 0)
> + return ret;
> +
> + pr_debug("Flashing FIP from file offset 256K at offset 512K\n");
> + fip_data = data;
> + fip_data->image = data->image + SZ_256K;
> + fip_data->len = data->len - SZ_256K;
> +
> + return bbu_flash(fip_data, SZ_512K);
> +}
> +
> +int stm32mp_bbu_nor_fip_register(const char *name,
> + const char *devicefile,
> + unsigned long flags)
> +{
> + struct stm32mp_bbu_handler *priv;
> + int ret;
> +
> + priv = xzalloc(sizeof(*priv));
> +
> + priv->handler.flags = flags;
> + priv->handler.devicefile = devicefile;
> + priv->handler.name = name;
> + priv->handler.handler = stm32mp_bbu_nor_fip_handler;
> +
> + ret = bbu_register_handler(&priv->handler);
> + if (ret)
> + free(priv);
> +
> + return ret;
> +}
> diff --git a/include/mach/stm32mp/bbu.h b/include/mach/stm32mp/bbu.h
> index 233bcf6478..87b29f1527 100644
> --- a/include/mach/stm32mp/bbu.h
> +++ b/include/mach/stm32mp/bbu.h
> @@ -10,6 +10,9 @@
> int stm32mp_bbu_mmc_fip_register(const char *name, const char *devicefile,
> unsigned long flags);
>
> +int stm32mp_bbu_nor_fip_register(const char *name, const char *devicefile,
> + unsigned long flags);
> +
> #else
>
> static inline int stm32mp_bbu_mmc_fip_register(const char *name,
> @@ -19,6 +22,13 @@ static inline int stm32mp_bbu_mmc_fip_register(const char *name,
> return -ENOSYS;
> }
>
> +static inline int stm32mp_bbu_nor_fip_register(const char *name,
> + const char *devicefile,
> + unsigned long flags)
> +{
> + return -ENOSYS;
> +}
> +
> #endif
>
> #endif /* MACH_STM32MP_BBU_H_ */
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board
2025-11-28 0:51 ` [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board Sohaib Mohamed
@ 2025-11-28 9:40 ` Ahmad Fatoum
0 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 9:40 UTC (permalink / raw)
To: Sohaib Mohamed, Sascha Hauer, BAREBOX
On 11/28/25 1:51 AM, Sohaib Mohamed wrote:
> Add board support for the Arrow Electronics STM32MP157A Avenger96 board.
>
> This commit adds:
> - Board initialization code with boot source detection
> - barebox_update handlers for SD card, eMMC
>
> Tested with STM32MP157A DHCOR SoM on Avenger96 carrier board.
>
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/arm/boards/Makefile | 1 +
> arch/arm/boards/dhcor-stm32mp1/Makefile | 2 ++
> arch/arm/boards/dhcor-stm32mp1/board.c | 47 +++++++++++++++++++++++++++++
> arch/arm/configs/multi_v7_defconfig | 2 ++
> arch/arm/configs/stm32mp_defconfig | 2 ++
> arch/arm/dts/Makefile | 1 +
> arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts | 4 +++
> arch/arm/mach-stm32mp/Kconfig | 4 +++
> 8 files changed, 63 insertions(+)
>
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index f73285ede9..f75277bc17 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -135,6 +135,7 @@ obj-$(CONFIG_MACH_LXA_MC1) += lxa-mc1/
> obj-$(CONFIG_MACH_LXA_TAC) += lxa-tac/
> obj-$(CONFIG_MACH_LXA_FAIRYTUX2) += lxa-fairytux2/
> obj-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp15x-ev1/
> +obj-$(CONFIG_MACH_DHCOR_STM32MP1) += dhcor-stm32mp1/
> obj-$(CONFIG_MACH_TECHNEXION_PICO_HOBBIT) += technexion-pico-hobbit/
> obj-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += technexion-wandboard/
> obj-$(CONFIG_MACH_TNY_A9260) += tny-a926x/
> diff --git a/arch/arm/boards/dhcor-stm32mp1/Makefile b/arch/arm/boards/dhcor-stm32mp1/Makefile
> new file mode 100644
> index 0000000000..bcca1a9f84
> --- /dev/null
> +++ b/arch/arm/boards/dhcor-stm32mp1/Makefile
> @@ -0,0 +1,2 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +obj-y += board.o
> diff --git a/arch/arm/boards/dhcor-stm32mp1/board.c b/arch/arm/boards/dhcor-stm32mp1/board.c
> new file mode 100644
> index 0000000000..2a02942d6c
> --- /dev/null
> +++ b/arch/arm/boards/dhcor-stm32mp1/board.c
> @@ -0,0 +1,47 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// SPDX-FileCopyrightText: Copyright (c) 2025, Sohaib Mohamed <sohaib.amhmd@gmail.com>
> +#include <filetype.h>
> +#include <common.h>
> +#include <init.h>
> +#include <asm/memory.h>
> +#include <mach/stm32mp/bbu.h>
> +#include <bootsource.h>
> +#include <of.h>
> +
> +static int dhcor_stm32mp1_probe(struct device *dev)
> +{
> + int emmc_bbu_flag = 0;
> + int sd_bbu_flag = 0;
> + int nor_bbu_flag = 0;
> +
> + if (bootsource_get() == BOOTSOURCE_MMC) {
> + if (bootsource_get_instance() == 2)
> + emmc_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
> + else
> + sd_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
> + } else if (bootsource_get() == BOOTSOURCE_NOR) {
> + nor_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
> + } else {
> + emmc_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
> + }
> +
> + stm32mp_bbu_mmc_fip_register("sd", "/dev/mmc0", sd_bbu_flag);
> + stm32mp_bbu_mmc_fip_register("emmc", "/dev/mmc1", emmc_bbu_flag);
> + stm32mp_bbu_nor_fip_register("nor", "/dev/m25p0", nor_bbu_flag);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id dhcor_stm32mp1_of_match[] = {
> + { .compatible = "dh,stm32mp157a-dhcor-som" },
> + { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, dhcor_stm32mp1_of_match);
> +BAREBOX_DEEP_PROBE_ENABLE(dhcor_stm32mp1_of_match);
> +
> +static struct driver dhcor_stm32mp1_driver = {
> + .name = "dhcor_stm32mp1",
> + .probe = dhcor_stm32mp1_probe,
> + .of_compatible = dhcor_stm32mp1_of_match,
> +};
> +device_platform_driver(dhcor_stm32mp1_driver);
> diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
> index 93f79c79d2..ef4e106148 100644
> --- a/arch/arm/configs/multi_v7_defconfig
> +++ b/arch/arm/configs/multi_v7_defconfig
> @@ -82,6 +82,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y
> CONFIG_MACH_LXA_MC1=y
> CONFIG_MACH_LXA_TAC=y
> CONFIG_MACH_LXA_FAIRYTUX2=y
> +CONFIG_MACH_DHCOR_STM32MP1=y
> CONFIG_MACH_SEEED_ODYSSEY=y
> CONFIG_MACH_STM32MP15X_EV1=y
> CONFIG_MACH_PROTONIC_STM32MP1=y
> @@ -214,6 +215,7 @@ CONFIG_DEEP_PROBE_DEFAULT=y
> CONFIG_OF_BAREBOX_DRIVERS=y
> CONFIG_AIODEV=y
> CONFIG_STM32_ADC=y
> +CONFIG_STM32_QSPI=y
> CONFIG_SERIAL_AMBA_PL011=y
> CONFIG_DRIVER_SERIAL_STM32=y
> CONFIG_DRIVER_SERIAL_NS16550=y
> diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig
> index 4df7b371f3..1d1b75fbb0 100644
> --- a/arch/arm/configs/stm32mp_defconfig
> +++ b/arch/arm/configs/stm32mp_defconfig
> @@ -4,6 +4,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y
> CONFIG_MACH_LXA_MC1=y
> CONFIG_MACH_LXA_TAC=y
> CONFIG_MACH_LXA_FAIRYTUX2=y
> +CONFIG_MACH_DHCOR_STM32MP1=y
> CONFIG_MACH_SEEED_ODYSSEY=y
> CONFIG_MACH_STM32MP15X_EV1=y
> CONFIG_MACH_PROTONIC_STM32MP1=y
> @@ -104,6 +105,7 @@ CONFIG_NET_FASTBOOT=y
> CONFIG_OF_BAREBOX_DRIVERS=y
> CONFIG_AIODEV=y
> CONFIG_STM32_ADC=y
> +CONFIG_STM32_QSPI=y
> CONFIG_DRIVER_SERIAL_STM32=y
> CONFIG_DRIVER_NET_DESIGNWARE_STM32=y
> CONFIG_AT803X_PHY=y
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index e78722a9a7..3cd1d8fe59 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -169,6 +169,7 @@ lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o stm32mp157c-lxa-mc1-scmi
> lwl-$(CONFIG_MACH_LXA_TAC) += stm32mp157c-lxa-tac-gen1.dtb.o stm32mp157c-lxa-tac-gen2.dtb.o \
> stm32mp153c-lxa-tac-gen3.dtb.o
> lwl-$(CONFIG_MACH_LXA_FAIRYTUX2) += stm32mp153c-lxa-fairytux2-gen1.dtb.o stm32mp153c-lxa-fairytux2-gen2.dtb.o
> +lwl-$(CONFIG_MACH_DHCOR_STM32MP1) += stm32mp157a-dhcor-stm32mp1.dtb.o
> lwl-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp157c-ev1.dtb.o stm32mp157c-ev1-scmi.dtb.o
> lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o
> lwl-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += imx6q-wandboard.dtb.o imx6dl-wandboard.dtb.o
> diff --git a/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts b/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts
> new file mode 100644
> index 0000000000..5187cc882f
> --- /dev/null
> +++ b/arch/arm/dts/stm32mp157a-dhcor-stm32mp1.dts
> @@ -0,0 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +
> +#include <arm/st/stm32mp157a-dhcor-avenger96.dts>
> +#include "stm32mp151.dtsi"
> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
> index 5ea0c4004f..54ce644d73 100644
> --- a/arch/arm/mach-stm32mp/Kconfig
> +++ b/arch/arm/mach-stm32mp/Kconfig
> @@ -39,6 +39,10 @@ config MACH_LXA_FAIRYTUX2
> bool "Linux Automation FairyTux 2"
> select BOARD_LXA
>
> +config MACH_DHCOR_STM32MP1
> + select ARCH_STM32MP157
> + bool "DHCOR STM32MP1 boards including Arrow Avenger96"
> +
> config MACH_SEEED_ODYSSEY
> select ARCH_STM32MP157
> bool "Seeed Studio Odyssey"
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler
2025-11-28 0:51 ` [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler Sohaib Mohamed
2025-11-28 9:39 ` Ahmad Fatoum
@ 2025-12-01 10:38 ` Sascha Hauer
1 sibling, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2025-12-01 10:38 UTC (permalink / raw)
To: Sohaib Mohamed; +Cc: BAREBOX
On Fri, Nov 28, 2025 at 01:51:18AM +0100, Sohaib Mohamed wrote:
> Add support for updating STM32MP1 bootloader in NOR flash. The handler
> automatically detects FIP location (256K or 512K offset) and flashes
The "or 512K offset" part isn't implemented, right?
> FSBL at offset 0 and FIP at offset 512K. FIP is truncated if it exceeds
> available space.
>
> The handler detects the FIP location within the image (at either 256K
> or 512K offset) and flashes components to their appropriate locations:
> - FSBL at offset 0 (first 256K)
> - FIP at offset 512K (remainder of flash)
>
> When flashing from eMMC boot partitions to NOR, the FIP is truncated if
> needed since eMMC boot partitions are typically larger than available
> NOR flash space.
I guess you mean that not the FIP image is truncated, but the input
image (/dev/mmcx.boot) is truncated to the actual FIP image size.
But like Ahmad I can't find this part implemented. Should we just drop
this sentence for now?
Sascha
>
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
> ---
> arch/arm/mach-stm32mp/bbu.c | 77 +++++++++++++++++++++++++++++++++++++++++++++
> include/mach/stm32mp/bbu.h | 10 ++++++
> 2 files changed, 87 insertions(+)
>
> diff --git a/arch/arm/mach-stm32mp/bbu.c b/arch/arm/mach-stm32mp/bbu.c
> index 07b5111341..e8d0138cc7 100644
> --- a/arch/arm/mach-stm32mp/bbu.c
> +++ b/arch/arm/mach-stm32mp/bbu.c
> @@ -193,3 +193,80 @@ int stm32mp_bbu_mmc_fip_register(const char *name,
>
> return ret;
> }
> +
> +static int stm32mp_bbu_nor_fip_handler(struct bbu_handler *handler,
> + struct bbu_data *data)
> +{
> + struct bbu_data *fsbl_data, *fip_data;
> + enum filetype filetype;
> + int ret;
> +
> + filetype = file_detect_type(data->image, data->len);
> + if (filetype == filetype_fip) {
> + pr_debug("Flashing FIP at offset 512K\n");
> + return bbu_flash(data, SZ_512K);
> + }
> +
> + if (filetype != filetype_stm32_image_fsbl_v1) {
> + if (!bbu_force(data, "incorrect image type. Expected: %s, got %s",
> + file_type_to_string(filetype_stm32_image_fsbl_v1),
> + file_type_to_string(filetype)))
> + return -EINVAL;
> +
> + /* Force: Let's assume it's an FSBL and flash anyway */
> + }
> +
> + if (data->len > SZ_256K)
> + filetype = file_detect_type(data->image + SZ_256K,
> + data->len - SZ_256K);
> + else
> + filetype = filetype_unknown;
> +
> + /* Not an eMMC image, just flash 1:1 */
> + if (filetype != filetype_fip) {
> + pr_debug("Flashing FSBL at offset 0\n");
> + return bbu_flash(data, 0);
> + }
> +
> + /* On SPI-NOR, offset 256K is FSBL2. If we get a FIP image there
> + * instead, let's assume that's an eMMC boot partition image
> + * and flash the FSBL to offset 0 and the remainder to offset 512K
> + */
> +
> + pr_debug("Flashing FSBL at offset 0\n");
> + fsbl_data = data;
> + fsbl_data->image = data->image;
> + fsbl_data->len = SZ_256K;
> +
> + ret = bbu_flash(fsbl_data, 0);
> + if (ret < 0)
> + return ret;
> +
> + pr_debug("Flashing FIP from file offset 256K at offset 512K\n");
> + fip_data = data;
> + fip_data->image = data->image + SZ_256K;
> + fip_data->len = data->len - SZ_256K;
> +
> + return bbu_flash(fip_data, SZ_512K);
> +}
> +
> +int stm32mp_bbu_nor_fip_register(const char *name,
> + const char *devicefile,
> + unsigned long flags)
> +{
> + struct stm32mp_bbu_handler *priv;
> + int ret;
> +
> + priv = xzalloc(sizeof(*priv));
> +
> + priv->handler.flags = flags;
> + priv->handler.devicefile = devicefile;
> + priv->handler.name = name;
> + priv->handler.handler = stm32mp_bbu_nor_fip_handler;
> +
> + ret = bbu_register_handler(&priv->handler);
> + if (ret)
> + free(priv);
> +
> + return ret;
> +}
> diff --git a/include/mach/stm32mp/bbu.h b/include/mach/stm32mp/bbu.h
> index 233bcf6478..87b29f1527 100644
> --- a/include/mach/stm32mp/bbu.h
> +++ b/include/mach/stm32mp/bbu.h
> @@ -10,6 +10,9 @@
> int stm32mp_bbu_mmc_fip_register(const char *name, const char *devicefile,
> unsigned long flags);
>
> +int stm32mp_bbu_nor_fip_register(const char *name, const char *devicefile,
> + unsigned long flags);
> +
> #else
>
> static inline int stm32mp_bbu_mmc_fip_register(const char *name,
> @@ -19,6 +22,13 @@ static inline int stm32mp_bbu_mmc_fip_register(const char *name,
> return -ENOSYS;
> }
>
> +static inline int stm32mp_bbu_nor_fip_register(const char *name,
> + const char *devicefile,
> + unsigned long flags)
> +{
> + return -ENOSYS;
> +}
> +
> #endif
>
> #endif /* MACH_STM32MP_BBU_H_ */
>
> --
> 2.43.0
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-12-01 10:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-28 0:51 [PATCH 0/3] ARM: stm32mp: Add Avenger96 board support Sohaib Mohamed
2025-11-28 0:51 ` [PATCH 1/3] common: bbu: refactor flash operations into separate function Sohaib Mohamed
2025-11-28 9:35 ` Ahmad Fatoum
2025-11-28 0:51 ` [PATCH 2/3] ARM: stm32mp: bbu: add NOR flash FIP update handler Sohaib Mohamed
2025-11-28 9:39 ` Ahmad Fatoum
2025-12-01 10:38 ` Sascha Hauer
2025-11-28 0:51 ` [PATCH 3/3] ARM: stm32mp: add support for STM32MP157A Avenger96 board Sohaib Mohamed
2025-11-28 9:40 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox