Skip to contentSkip to conversation

Convert extension support to UCLASS and adds its support to boot flows

PATCH Superseded Kory Maincent (TI.com) 4 participants 40 messages Oct 13, 2025 – Oct 21, 2025 1 message not in the archive

Subsystems (5)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Convert extension support to UCLASS and adds its support to boot flows

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

Changes in v3:
- Reorder the patches inside the series as several config were broken in the middle of the series.
- Use U_BOOT_DRVINFO macro instead of manually bind the drivers.
- Use uclass_first_device_err instead of extension_get_dev function.
- Made few fixes in documentation and Kconfig dependency.
- Made few changes of error value returned.
- Add a patch to document the extension structure.
- Add a patch to fix CAPE_EEPROM_BUS_NUM Kconfig dependency

Changes in v2:
- Fixes few build errors.
- Add patches to move the extension support and board scan out of XPL images build.

---
Kory Maincent (TI.com) (20):
MAINTAINERS: Add maintainer for extension board support
board: ti: Exclude cape detection from XPL builds
board: ti: Fix CAPE_EEPROM_BUS_NUM Kconfig dependency
board: sunxi: Exclude DIP detection from XPL builds
board: compulab: Exclude compulab extension board detection from XPL builds
include: extension_board: Document the extension structure
boot: Move extension board support from cmd/ to boot/
boot: Add UCLASS support for extension boards
board: ti: Refactor cape detection code for readability
board: ti: Convert cape detection to use UCLASS framework
board: sunxi: Refactor CHIP board extension code
board: sunxi: Convert extension support to UCLASS framework
board: sandbox: Improve extension board scan implementation
board: sandbox: Convert extension support to UCLASS framework
board: compulab: Convert imx8mm-cl-iot-gate to UCLASS extension framework
boot: Remove legacy extension board support
boot: extension: Move overlay apply custom logic to command level
boot: pxe_utils: Add extension board devicetree overlay support
boot: bootmeth_efi: Refactor distro_efi_try_bootflow_files return logic
boot: bootmeth_efi: Add extension board devicetree overlay support

 MAINTAINERS                                        |   9 +
 .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c        |  70 ++++----
 board/sandbox/sandbox.c                            |  26 ++-
 board/sunxi/Makefile                               |   2 +-
 board/sunxi/chip.c                                 |  36 ++--
 board/ti/common/Kconfig                            |   2 +-
 board/ti/common/Makefile                           |   2 +-
 board/ti/common/cape_detect.c                      |  56 ++++---
 boot/Kconfig                                       |   4 +
 boot/Makefile                                      |   1 +
 boot/bootmeth_efi.c                                |  79 +++++++--
 boot/extension-uclass.c                            |  93 +++++++++++
 boot/pxe_utils.c                                   |  92 +++++++++++
 cmd/Kconfig                                        |   3 -
 cmd/extension_board.c                              | 183 ++++++++++-----------
 doc/usage/cmd/extension.rst                        |  29 ++--
 include/dm/uclass-id.h                             |   1 +
 include/extension_board.h                          |  85 ++++++++--
 18 files changed, 541 insertions(+), 232 deletions(-)

---
base-commit: 8e7f8c1248e8adfb525a2a4ea56ebf7e54ff5d7a
change-id: 20250916-feature_sysboot_extension_board-958dd0072565

Best regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#1 lore raw

PATCH v3 1/20 MAINTAINERS: Add maintainer for extension board support

Add myself as maintainer for the extension board support that was originally added to track ongoing development and maintenance.

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index 12043a1f82e..e411e266c94 100644
@@ -1182,6 +1182,14 @@ F:	scripts/event_dump.py
 F:	test/common/event.c
 F:	test/py/tests/test_event_dump.py
 
+EXTENSION
+M:	Kory Maincent <[email protected]>
+S:	Maintained
+F:	board/sunxi/chip.c
+F:	board/ti/common/cape_detect.c
+F:	cmd/extension_board.c
+F:	include/extension_board.h
+
 FASTBOOT
 M:	Mattijs Korpershoek <[email protected]>
 S:	Maintained
Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/20 board: ti: Exclude cape detection from XPL builds

In reply to Kory Maincent (TI.com)

Disable cape detection functionality in XPL (eXtended Program Loader) images to reduce size and complexity in the early boot stage.

---

Changes in v2:
- Use PHASE macro instead of XPL check.
- Check SUPPORT_EXTENSION_SCAN instead of CONFIG_CMD_EXTENSION

---
 board/ti/common/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/common/Makefile +1 -1
index caf6b9fa8c1..f58935b4103 100644
@@ -2,6 +2,6 @@
 # Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
 
 obj-${CONFIG_TI_I2C_BOARD_DETECT} += board_detect.o
-obj-${CONFIG_CMD_EXTENSION} += cape_detect.o
+obj-${CONFIG_$(PHASE_)SUPPORT_EXTENSION_SCAN} += cape_detect.o
 obj-${CONFIG_OF_LIBFDT} += fdt_ops.o
 obj-${CONFIG_ARCH_K3} += k3-ddr.o
Signature · 1 line
2.43.0
#3 lore raw

PATCH v3 3/20 board: ti: Fix CAPE_EEPROM_BUS_NUM Kconfig dependency

In reply to Kory Maincent (TI.com)

The CAPE_EEPROM_BUS_NUM configuration option was incorrectly depending on CMD_EXTENSION, which represents the extension board command. However, the cape scan functionality can be built and used independently of the command interface through the SUPPORT_EXTENSION_SCAN option.

Change the dependency from CMD_EXTENSION to SUPPORT_EXTENSION_SCAN to properly reflect that the I2C bus configuration is needed for the cape scan function itself, not specifically for the command.

---

Change in v3:
- New patch

---
 board/ti/common/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/common/Kconfig +1 -1
index f481812247c..9512c5c23f1 100644
@@ -20,7 +20,7 @@ config CAPE_EEPROM_BUS_NUM
 	int "Cape EEPROM's I2C bus address"
 	range 0 8
 	default 2
-	depends on CMD_EXTENSION
+	depends on SUPPORT_EXTENSION_SCAN
 
 config TI_COMMON_CMD_OPTIONS
 	bool "Enable cmd options on TI platforms"
Signature · 1 line
2.43.0
#4 lore raw

PATCH v3 4/20 board: sunxi: Exclude DIP detection from XPL builds

In reply to Kory Maincent (TI.com)

Disable DIP detection functionality in XPL (eXtended Program Loader) images to reduce size and complexity in the early boot stage.

---

Change in v2:
- New patch.

---
 board/sunxi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/sunxi/Makefile +1 -1
index d96b7897b6c..ee82493117a 100644
@@ -11,4 +11,4 @@ obj-$(CONFIG_SUN7I_GMAC)	+= gmac.o
 obj-$(CONFIG_MACH_SUN4I)	+= dram_sun4i_auto.o
 obj-$(CONFIG_MACH_SUN5I)	+= dram_sun5i_auto.o
 obj-$(CONFIG_MACH_SUN7I)	+= dram_sun5i_auto.o
-obj-$(CONFIG_CHIP_DIP_SCAN)	+= chip.o
+obj-$(CONFIG_$(PHASE_)CHIP_DIP_SCAN)	+= chip.o
Signature · 1 line
2.43.0
#5 lore raw

PATCH v3 5/20 board: compulab: Exclude compulab extension board detection from XPL builds

In reply to Kory Maincent (TI.com)

Disable compulab extension board detection functionality in XPL (eXtended Program Loader) images to reduce size and complexity in the early boot stage.

---

Change in v2:
- New patch.

---
 board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c | 3 +++
 1 file changed, 3 insertions(+)
board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c +3 -0
index bda7aac5be4..be4f293bd4a 100644
@@ -249,6 +249,8 @@ int board_mmc_get_env_dev(int devno)
 #define IOT_GATE_IMX8_EXT_I2C_ADDR_GPIO 0x22 /* I2C address of the GPIO
 						extender */
 
+#if !IS_ENABLED(CONFIG_XPL_BUILD)
+
 static int iot_gate_imx8_ext_id = IOT_GATE_EXT_EMPTY; /* Extension board ID */
 static int iot_gate_imx8_ext_ied_id [3] = {
 	IOT_GATE_IMX8_CARD_ID_EMPTY,
@@ -541,6 +543,7 @@ int extension_board_scan(struct list_head *extension_list)
 
         return ret;
 }
+#endif
 
 static int setup_mac_address(void)
 {
Signature · 1 line
2.43.0
#6 lore raw

PATCH v3 6/20 include: extension_board: Document the extension structure

In reply to Kory Maincent (TI.com)

Add documentation to describe the extension structure.

---

Change in v3:
- New patch.

---
 include/extension_board.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/extension_board.h +9 -0
index 22e4104bc54..23e36d3c0bf 100644
@@ -9,6 +9,15 @@
 
 #include <linux/list.h>
 
+/**
+ * extension - Description fields of an extension board
+ * @list: List head
+ * @name: Name of the extension
+ * @owner: Owner of the extension
+ * @version: Version of the extension
+ * @overlay: Devicetree overlay name to be loaded for this extension
+ * @other: Other information of this extension
+ */
 struct extension {
 	struct list_head list;
 	char name[32];
Signature · 1 line
2.43.0
#7 lore raw

PATCH v3 7/20 boot: Move extension board support from cmd/ to boot/

In reply to Kory Maincent (TI.com)

Relocate extension board support from cmd/ to boot/ directory in preparation for converting the extension framework to use UCLASS. Also improve code style by applying reverse xmas tree ordering.

---

Change in v3:
- Move the list head in from cmd/extension_board.c to boot/extension.c
- Add OF_LIBFDT_OVERLAY config dependency.

---
 MAINTAINERS               |  1 +
 boot/Kconfig              |  4 ++
 boot/Makefile             |  1 +
 boot/extension.c          | 99 +++++++++++++++++++++++++++++++++++++++++++++++
 cmd/Kconfig               |  3 --
 cmd/extension_board.c     | 99 ++---------------------------------------------
 include/extension_board.h | 16 ++++++++
 7 files changed, 124 insertions(+), 99 deletions(-)
MAINTAINERS +1 -0
index e411e266c94..c67d5ae9d6b 100644
@@ -1187,6 +1187,7 @@ M:	Kory Maincent <[email protected]>
 S:	Maintained
 F:	board/sunxi/chip.c
 F:	board/ti/common/cape_detect.c
+F:	boot/extension.c
 F:	cmd/extension_board.c
 F:	include/extension_board.h
 
boot/Kconfig +4 -0
index dd047365754..a75f6b641ed 100644
@@ -1906,6 +1906,10 @@ endmenu
 
 endif # OF_LIBFDT
 
+config SUPPORT_EXTENSION_SCAN
+	select OF_LIBFDT_OVERLAY
+        bool
+
 config USE_BOOTARGS
 	bool "Enable boot arguments"
 	help
boot/Makefile +1 -0
index 3da6f7a0914..f60d13130b1 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_BOOT_RETRY) += bootretry.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
+obj-$(CONFIG_SUPPORT_EXTENSION_SCAN) += extension.o
 
 obj-$(CONFIG_PXE_UTILS) += pxe_utils.o
 
boot/extension.c new file +99 -0

99 lines not on this page · raw message

cmd/Kconfig +0 -3
index 29de857ba7c..986eeeba807 100644
@@ -545,9 +545,6 @@ config CMD_FDT
 	help
 	  Do FDT related setup before booting into the Operating System.
 
-config SUPPORT_EXTENSION_SCAN
-	bool
-
 config CMD_EXTENSION
 	bool "Extension board management command"
 	select CMD_FDT
cmd/extension_board.c +3 -96

128 lines not on this page · raw message

include/extension_board.h +16 -0
index 23e36d3c0bf..0821dddd8ff 100644
@@ -9,6 +9,8 @@
 
 #include <linux/list.h>
 
+extern struct list_head extension_list;
+
 /**
  * extension - Description fields of an extension board
  * @list: List head
@@ -39,4 +41,18 @@ struct extension {
  */
 int extension_board_scan(struct list_head *extension_list);
 
+/**
+ * extension_apply - Apply extension board overlay to the devicetree
+ * @extension: Extension to be applied
+ * Return: Zero on success, negative on failure.
+ */
+int extension_apply(struct extension *extension);
+
+/**
+ * extension_scan - Scan extension boards available.
+ * @show: Flag to enable verbose log
+ * Return: Zero on success, negative on failure.
+ */
+int extension_scan(bool show);
+
 #endif /* __EXTENSION_SUPPORT_H */
Signature · 1 line
2.43.0
#8 lore raw

PATCH v3 8/20 boot: Add UCLASS support for extension boards

In reply to Kory Maincent (TI.com)

Introduce UCLASS-based extension board support to enable more standardized and automatic loading of extension board device tree overlays in preparation for integration with bootstd and pxe_utils.

Several #if CONFIG_IS_ENABLED are used in cmd/extension_board.c to ease the development but don't worry they are removed later in the series.

---

Change in v3:
- Add OF_LIBFDT_OVERLAY config dependency.
- Update several return errors value following Simon review.
- Use uclass_first_device_err instead of extension_get_dev function.
- Remove the manual bind of extension driver. Use U_BOOT_DRVINFO instead.
- Update documentation.
- Add a helper to get extension ops.

---
 MAINTAINERS                 |   1 +
 boot/Kconfig                |   4 ++
 boot/Makefile               |   1 +
 boot/extension-uclass.c     | 151 ++++++++++++++++++++++++++++++++++++++++++++
 cmd/Kconfig                 |   2 +-
 cmd/extension_board.c       |  50 ++++++++++++++-
 doc/usage/cmd/extension.rst |  29 +++++----
 include/dm/uclass-id.h      |   1 +
 include/extension_board.h   |  70 ++++++++++++++++++++
 9 files changed, 293 insertions(+), 16 deletions(-)
MAINTAINERS +1 -0
index c67d5ae9d6b..a63ffa14ef5 100644
@@ -1187,6 +1187,7 @@ M:	Kory Maincent <[email protected]>
 S:	Maintained
 F:	board/sunxi/chip.c
 F:	board/ti/common/cape_detect.c
+F:	boot/extension-uclass.c
 F:	boot/extension.c
 F:	cmd/extension_board.c
 F:	include/extension_board.h
boot/Kconfig +4 -0
index a75f6b641ed..08d666d4b93 100644
@@ -1910,6 +1910,10 @@ config SUPPORT_EXTENSION_SCAN
 	select OF_LIBFDT_OVERLAY
         bool
 
+config SUPPORT_DM_EXTENSION_SCAN
+	select OF_LIBFDT_OVERLAY
+        bool
+
 config USE_BOOTARGS
 	bool "Enable boot arguments"
 	help
boot/Makefile +1 -0
index f60d13130b1..aa26070fbb8 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
 obj-$(CONFIG_SUPPORT_EXTENSION_SCAN) += extension.o
+obj-$(CONFIG_SUPPORT_DM_EXTENSION_SCAN) += extension-uclass.o
 
 obj-$(CONFIG_PXE_UTILS) += pxe_utils.o
 
boot/extension-uclass.c new file +151 -0

151 lines not on this page · raw message

cmd/Kconfig +1 -1
index 986eeeba807..721bdb87c8a 100644
@@ -548,7 +548,7 @@ config CMD_FDT
 config CMD_EXTENSION
 	bool "Extension board management command"
 	select CMD_FDT
-	depends on SUPPORT_EXTENSION_SCAN
+	depends on SUPPORT_EXTENSION_SCAN || SUPPORT_DM_EXTENSION_SCAN
 	help
 	  Enables the "extension" command, which allows to detect
 	  extension boards connected to the system, and apply
cmd/extension_board.c +47 -3

108 lines not on this page · raw message

doc/usage/cmd/extension.rst +17 -12
index 4c261e74951..fbe95aace79 100644
@@ -25,9 +25,8 @@ Device Tree overlays depending on the detected extension boards.
 
 The "extension" command comes with three sub-commands:
 
- - "extension scan" makes the generic code call the board-specific
-   extension_board_scan() function to retrieve the list of detected
-   extension boards.
+ - "extension scan" makes the generic code call a board-specific extension
+   function to retrieve the list of detected extension boards.
 
  - "extension list" allows to list the detected extension boards.
 
@@ -98,17 +97,23 @@ Simple extension_board_scan function example
 
 .. code-block:: c
 
-    int extension_board_scan(struct list_head *extension_list)
+    static int foo_extension_board_scan(struct alist *extension_list)
     {
-        struct extension *extension;
+        struct extension extension = {0};
 
-        extension = calloc(1, sizeof(struct extension));
-        snprintf(extension->overlay, sizeof(extension->overlay), "overlay.dtbo");
-        snprintf(extension->name, sizeof(extension->name), "extension board");
-        snprintf(extension->owner, sizeof(extension->owner), "sandbox");
-        snprintf(extension->version, sizeof(extension->version), "1.1");
-        snprintf(extension->other, sizeof(extension->other), "Extension board information");
-        list_add_tail(&extension->list, extension_list);
+        snprintf(extension.overlay, sizeof(extension.overlay), "overlay.dtbo");
+        snprintf(extension.name, sizeof(extension.name), "extension board");
+        snprintf(extension.owner, sizeof(extension.owner), "sandbox");
+        snprintf(extension.version, sizeof(extension.version), "1.1");
+        snprintf(extension.other, sizeof(extension.other), "Extension board information");
+        if (!alist_add(extension_list, extension))
+                return -ENOMEM;
 
         return 1;
     }
+
+    U_BOOT_EXTENSION(foo_extension_name, foo_extension_board_scan);
+
+    U_BOOT_DRVINFO(foo_extension_name) = {
+        .name = "foo_extension_name",
+    };
include/dm/uclass-id.h +1 -0
index 6be59093160..eb6416b5917 100644
@@ -63,6 +63,7 @@ enum uclass_id {
 	UCLASS_ETH,		/* Ethernet device */
 	UCLASS_ETH_PHY,		/* Ethernet PHY device */
 	UCLASS_EXTCON,		/* External Connector Class */
+	UCLASS_EXTENSION,	/* Extension board */
 	UCLASS_FFA,		/* Arm Firmware Framework for Armv8-A */
 	UCLASS_FFA_EMUL,		/* sandbox FF-A device emulator */
 	UCLASS_FIRMWARE,	/* Firmware */
include/extension_board.h +70 -0

86 lines not on this page · raw message

Signature · 1 line
2.43.0
Reviewed-by on v3 8/20
#9 lore raw

Re: [PATCH v3 08/20] boot: Add UCLASS support for extension boards

Quoted 18 lines · Kory Maincent (TI.com)

Introduce UCLASS-based extension board support to enable more standardized and automatic loading of extension board device tree overlays in preparation for integration with bootstd and pxe_utils.

Several #if CONFIG_IS_ENABLED are used in cmd/extension_board.c to ease the development but don't worry they are removed later in the series.

---

Change in v3:
- Add OF_LIBFDT_OVERLAY config dependency.
- Update several return errors value following Simon review.
- Use uclass_first_device_err instead of extension_get_dev function.
- Remove the manual bind of extension driver. Use U_BOOT_DRVINFO instead.
- Update documentation.
- Add a helper to get extension ops.

Quoted 11 lines
---
 MAINTAINERS                 |   1 +
 boot/Kconfig                |   4 ++
 boot/Makefile               |   1 +
 boot/extension-uclass.c     | 151 ++++++++++++++++++++++++++++++++++++++++++++
 cmd/Kconfig                 |   2 +-
 cmd/extension_board.c       |  50 ++++++++++++++-
 doc/usage/cmd/extension.rst |  29 +++++----
 include/dm/uclass-id.h      |   1 +
 include/extension_board.h   |  70 ++++++++++++++++++++
 9 files changed, 293 insertions(+), 16 deletions(-)
#10 lore raw

PATCH v3 9/20 board: ti: Refactor cape detection code for readability

In reply to Kory Maincent (TI.com)

Clean up and reorganize cape detection code structure for improved maintainability and readability.

---
 board/ti/common/cape_detect.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)
board/ti/common/cape_detect.c +19 -17
index da805befabc..7786bdda5d1 100644
@@ -24,19 +24,18 @@ static void sanitize_field(char *text, size_t size)
 
 int extension_board_scan(struct list_head *extension_list)
 {
-	struct extension *cape;
-	struct am335x_cape_eeprom_id eeprom_header;
-
-	int num_capes = 0;
-	int ret, i;
-	struct udevice *dev;
 	unsigned char addr;
-
-	char process_cape_part_number[17] = {'0'};
-	char process_cape_version[5] = {'0'};
-	uint8_t cursor = 0;
+	int num_capes = 0;
 
 	for (addr = CAPE_EEPROM_FIRST_ADDR; addr <= CAPE_EEPROM_LAST_ADDR; addr++) {
+		struct am335x_cape_eeprom_id eeprom_header;
+		char process_cape_part_number[17] = {'0'};
+		char process_cape_version[5] = {'0'};
+		struct extension *cape;
+		struct udevice *dev;
+		u8 cursor = 0;
+		int ret, i;
+
 		ret = i2c_get_chip_for_busnum(CONFIG_CAPE_EEPROM_BUS_NUM, addr, 1, &dev);
 		if (ret)
 			continue;
@@ -59,8 +58,8 @@ int extension_board_scan(struct list_head *extension_list)
 		sanitize_field(eeprom_header.part_number, sizeof(eeprom_header.part_number));
 
 		/* Process cape part_number */
-		memset(process_cape_part_number, 0, sizeof(process_cape_part_number));
-		strncpy(process_cape_part_number, eeprom_header.part_number, 16);
+		strlcpy(process_cape_part_number, eeprom_header.part_number,
+			sizeof(process_cape_part_number));
 		/* Some capes end with '.' */
 		for (i = 15; i >= 0; i--) {
 			if (process_cape_part_number[i] == '.')
@@ -70,8 +69,8 @@ int extension_board_scan(struct list_head *extension_list)
 		}
 
 		/* Process cape version */
-		memset(process_cape_version, 0, sizeof(process_cape_version));
-		strncpy(process_cape_version, eeprom_header.version, 4);
+		strlcpy(process_cape_version, eeprom_header.version,
+			sizeof(process_cape_version));
 		for (i = 0; i < 4; i++) {
 			if (process_cape_version[i] == 0)
 				process_cape_version[i] = '0';
@@ -87,9 +86,12 @@ int extension_board_scan(struct list_head *extension_list)
 
 		snprintf(cape->overlay, sizeof(cape->overlay), "%s-%s.dtbo",
 			 process_cape_part_number, process_cape_version);
-		strncpy(cape->name, eeprom_header.board_name, 32);
-		strncpy(cape->version, process_cape_version, 4);
-		strncpy(cape->owner, eeprom_header.manufacturer, 16);
+		strlcpy(cape->name, eeprom_header.board_name,
+			sizeof(eeprom_header.board_name));
+		strlcpy(cape->version, process_cape_version,
+			sizeof(process_cape_version));
+		strlcpy(cape->owner, eeprom_header.manufacturer,
+			sizeof(eeprom_header.manufacturer) + 1);
 		list_add_tail(&cape->list, extension_list);
 		num_capes++;
 	}
Signature · 1 line
2.43.0
#11 lore raw

PATCH v3 10/20 board: ti: Convert cape detection to use UCLASS framework

In reply to Kory Maincent (TI.com)

Migrate TI board cape detection from legacy extension support to the new UCLASS-based extension board framework.

---

Change in v3:
- Use U_BOOT_DRVINFO.

---
 arch/arm/mach-omap2/am33xx/Kconfig |  2 +-
 arch/arm/mach-omap2/omap5/Kconfig  |  2 +-
 board/ti/common/Kconfig            |  2 +-
 board/ti/common/Makefile           |  2 +-
 board/ti/common/cape_detect.c      | 28 +++++++++++++++-------------
 5 files changed, 19 insertions(+), 17 deletions(-)
arch/arm/mach-omap2/am33xx/Kconfig +1 -1
index dff4f1cf202..77f7938305b 100644
@@ -15,7 +15,7 @@ config TARGET_AM335X_EVM
 	select DM_GPIO
 	select DM_SERIAL
 	select TI_I2C_BOARD_DETECT
-	select SUPPORT_EXTENSION_SCAN
+	select SUPPORT_DM_EXTENSION_SCAN
 	imply CMD_DM
 	imply SPL_DM
 	imply SPL_DM_SEQ_ALIAS
arch/arm/mach-omap2/omap5/Kconfig +1 -1
index 5394529658b..819490a8cf8 100644
@@ -38,7 +38,7 @@ config TARGET_AM57XX_EVM
 	select CMD_DDR3
 	select DRA7XX
 	select TI_I2C_BOARD_DETECT
-	select SUPPORT_EXTENSION_SCAN
+	select SUPPORT_DM_EXTENSION_SCAN
 	imply DM_THERMAL
 	imply SCSI
 	imply SPL_THERMAL
board/ti/common/Kconfig +1 -1
index 9512c5c23f1..feb05b4bf95 100644
@@ -20,7 +20,7 @@ config CAPE_EEPROM_BUS_NUM
 	int "Cape EEPROM's I2C bus address"
 	range 0 8
 	default 2
-	depends on SUPPORT_EXTENSION_SCAN
+	depends on SUPPORT_DM_EXTENSION_SCAN
 
 config TI_COMMON_CMD_OPTIONS
 	bool "Enable cmd options on TI platforms"
board/ti/common/Makefile +1 -1
index f58935b4103..b42273d3a5a 100644
@@ -2,6 +2,6 @@
 # Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
 
 obj-${CONFIG_TI_I2C_BOARD_DETECT} += board_detect.o
-obj-${CONFIG_$(PHASE_)SUPPORT_EXTENSION_SCAN} += cape_detect.o
+obj-${CONFIG_$(PHASE_)SUPPORT_DM_EXTENSION_SCAN} += cape_detect.o
 obj-${CONFIG_OF_LIBFDT} += fdt_ops.o
 obj-${CONFIG_ARCH_K3} += k3-ddr.o
board/ti/common/cape_detect.c +15 -13
index 7786bdda5d1..0bd4a38c187 100644
@@ -22,7 +22,8 @@ static void sanitize_field(char *text, size_t size)
 	}
 }
 
-int extension_board_scan(struct list_head *extension_list)
+static int ti_extension_board_scan(struct udevice *dev,
+				   struct alist *extension_list)
 {
 	unsigned char addr;
 	int num_capes = 0;
@@ -31,7 +32,7 @@ int extension_board_scan(struct list_head *extension_list)
 		struct am335x_cape_eeprom_id eeprom_header;
 		char process_cape_part_number[17] = {'0'};
 		char process_cape_version[5] = {'0'};
-		struct extension *cape;
+		struct extension cape = {0};
 		struct udevice *dev;
 		u8 cursor = 0;
 		int ret, i;
@@ -78,22 +79,23 @@ int extension_board_scan(struct list_head *extension_list)
 
 		printf("BeagleBone Cape: %s (0x%x)\n", eeprom_header.board_name, addr);
 
-		cape = calloc(1, sizeof(struct extension));
-		if (!cape) {
-			printf("Error in memory allocation\n");
-			return num_capes;
-		}
-
-		snprintf(cape->overlay, sizeof(cape->overlay), "%s-%s.dtbo",
+		snprintf(cape.overlay, sizeof(cape.overlay), "%s-%s.dtbo",
 			 process_cape_part_number, process_cape_version);
-		strlcpy(cape->name, eeprom_header.board_name,
+		strlcpy(cape.name, eeprom_header.board_name,
 			sizeof(eeprom_header.board_name));
-		strlcpy(cape->version, process_cape_version,
+		strlcpy(cape.version, process_cape_version,
 			sizeof(process_cape_version));
-		strlcpy(cape->owner, eeprom_header.manufacturer,
+		strlcpy(cape.owner, eeprom_header.manufacturer,
 			sizeof(eeprom_header.manufacturer) + 1);
-		list_add_tail(&cape->list, extension_list);
+		if (!alist_add(extension_list, cape))
+			return -ENOMEM;
 		num_capes++;
 	}
 	return num_capes;
 }
+
+U_BOOT_EXTENSION(cape, ti_extension_board_scan);
+
+U_BOOT_DRVINFO(cape) = {
+	.name	= "cape",
+};
Signature · 1 line
2.43.0
#12 lore raw

PATCH v3 11/20 board: sunxi: Refactor CHIP board extension code

In reply to Kory Maincent (TI.com)

Clean up and improve code structure in the sunxi CHIP board extension detection implementation.

---

Changes in v2:
- Fix a build error.

---
 board/sunxi/chip.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
board/sunxi/chip.c +8 -8
index 270af2506d2..5e5ec0d1d89 100644
@@ -42,14 +42,9 @@ struct dip_w1_header {
 
 int extension_board_scan(struct list_head *extension_list)
 {
-	struct extension *dip;
-	struct dip_w1_header w1_header;
 	struct udevice *bus, *dev;
-	u32 vid;
-	u16 pid;
-	int ret;
-
 	int num_dip = 0;
+	int ret;
 
 	sunxi_gpio_set_pull(SUNXI_GPD(2), SUNXI_GPIO_PULL_UP);
 
@@ -60,6 +55,11 @@ int extension_board_scan(struct list_head *extension_list)
 	}
 
 	for_each_w1_device(bus, &dev) {
+		struct dip_w1_header w1_header;
+		struct extension *dip;
+		u32 vid;
+		u16 pid;
+
 		if (w1_get_device_family(dev) != W1_FAMILY_DS2431)
 			continue;
 
@@ -90,8 +90,8 @@ int extension_board_scan(struct list_head *extension_list)
 
 		snprintf(dip->overlay, sizeof(dip->overlay), "dip-%x-%x.dtbo",
 			 vid, pid);
-		strncpy(dip->name, w1_header.product_name, 32);
-		strncpy(dip->owner, w1_header.vendor_name, 32);
+		strlcpy(dip->name, w1_header.product_name, sizeof(dip->name));
+		strlcpy(dip->owner, w1_header.vendor_name, sizeof(dip->owner));
 		list_add_tail(&dip->list, extension_list);
 		num_dip++;
 	}
Signature · 1 line
2.43.0
#13 lore raw

PATCH v3 12/20 board: sunxi: Convert extension support to UCLASS framework

In reply to Kory Maincent (TI.com)

Migrate sunxi board extension detection from legacy implementation to the new UCLASS-based extension board framework.

---

Change in v3:
- Use U_BOOT_DRVINFO.

Changes in v2:
- Fix build error.

---
 arch/arm/mach-sunxi/Kconfig |  2 +-
 board/sunxi/chip.c          | 26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 13 deletions(-)
arch/arm/mach-sunxi/Kconfig +1 -1
index b04ec671696..f5696199516 100644
@@ -1223,7 +1223,7 @@ config BLUETOOTH_DT_DEVICE_FIXUP
 
 config CHIP_DIP_SCAN
 	bool "Enable DIPs detection for CHIP board"
-	select SUPPORT_EXTENSION_SCAN
+	select SUPPORT_DM_EXTENSION_SCAN
 	select W1
 	select W1_GPIO
 	select W1_EEPROM
board/sunxi/chip.c +14 -12
index 5e5ec0d1d89..b60a739df41 100644
@@ -40,7 +40,8 @@ struct dip_w1_header {
 	u8      data[16];               /* user data, per-dip specific */
 } __packed;
 
-int extension_board_scan(struct list_head *extension_list)
+static int sunxi_extension_board_scan(struct udevice *udev,
+				      struct alist *extension_list)
 {
 	struct udevice *bus, *dev;
 	int num_dip = 0;
@@ -55,8 +56,8 @@ int extension_board_scan(struct list_head *extension_list)
 	}
 
 	for_each_w1_device(bus, &dev) {
+		struct extension dip = {0};
 		struct dip_w1_header w1_header;
-		struct extension *dip;
 		u32 vid;
 		u16 pid;
 
@@ -82,18 +83,19 @@ int extension_board_scan(struct list_head *extension_list)
 		       w1_header.product_name, pid,
 		       w1_header.vendor_name, vid);
 
-		dip = calloc(1, sizeof(struct extension));
-		if (!dip) {
-			printf("Error in memory allocation\n");
-			return num_dip;
-		}
-
-		snprintf(dip->overlay, sizeof(dip->overlay), "dip-%x-%x.dtbo",
+		snprintf(dip.overlay, sizeof(dip.overlay), "dip-%x-%x.dtbo",
 			 vid, pid);
-		strlcpy(dip->name, w1_header.product_name, sizeof(dip->name));
-		strlcpy(dip->owner, w1_header.vendor_name, sizeof(dip->owner));
-		list_add_tail(&dip->list, extension_list);
+		strlcpy(dip.name, w1_header.product_name, sizeof(dip.name));
+		strlcpy(dip.owner, w1_header.vendor_name, sizeof(dip.owner));
+		if (!alist_add(extension_list, dip))
+			return -ENOMEM;
 		num_dip++;
 	}
 	return num_dip;
 }
+
+U_BOOT_EXTENSION(dip, sunxi_extension_board_scan);
+
+U_BOOT_DRVINFO(dip) = {
+	.name = "dip",
+};
Signature · 1 line
2.43.0
#14 lore raw

PATCH v3 13/20 board: sandbox: Improve extension board scan implementation

In reply to Kory Maincent (TI.com)

Enhance the extension board scanning code in sandbox with better error handling and code organization.

---
 board/sandbox/sandbox.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
board/sandbox/sandbox.c +5 -1
index 0dc23a27dfc..c5d7b9651a9 100644
@@ -113,11 +113,15 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
 #ifdef CONFIG_CMD_EXTENSION
 int extension_board_scan(struct list_head *extension_list)
 {
-	struct extension *extension;
 	int i;
 
 	for (i = 0; i < 2; i++) {
+		struct extension *extension;
+
 		extension = calloc(1, sizeof(struct extension));
+		if (!extension)
+			return -ENOMEM;
+
 		snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i);
 		snprintf(extension->name, sizeof(extension->name), "extension board %d", i);
 		snprintf(extension->owner, sizeof(extension->owner), "sandbox");
Signature · 1 line
2.43.0
#15 lore raw

PATCH v3 14/20 board: sandbox: Convert extension support to UCLASS framework

In reply to Kory Maincent (TI.com)

Migrate sandbox extension board detection from legacy implementation to the new UCLASS-based extension board framework.

---

Change in v3:
- Use U_BOOT_DRVINFO.

---
 arch/Kconfig            |  2 +-
 board/sandbox/sandbox.c | 28 ++++++++++++++++------------
 2 files changed, 17 insertions(+), 13 deletions(-)
arch/Kconfig +1 -1
index 7e05e0c2263..5bb65a29f8d 100644
@@ -215,7 +215,7 @@ config SANDBOX
 	select SYSRESET_CMD_POWEROFF if CMD_POWEROFF
 	select SYS_CACHE_SHIFT_4
 	select IRQ
-	select SUPPORT_EXTENSION_SCAN if CMDLINE
+	select SUPPORT_DM_EXTENSION_SCAN if CMDLINE
 	select SUPPORT_ACPI
 	imply BITREVERSE
 	select BLOBLIST
board/sandbox/sandbox.c +16 -12
index c5d7b9651a9..77e5a0478ca 100644
@@ -111,27 +111,31 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
 }
 
 #ifdef CONFIG_CMD_EXTENSION
-int extension_board_scan(struct list_head *extension_list)
+static int sandbox_extension_board_scan(struct udevice *dev,
+					struct alist *extension_list)
 {
 	int i;
 
 	for (i = 0; i < 2; i++) {
-		struct extension *extension;
-
-		extension = calloc(1, sizeof(struct extension));
-		if (!extension)
+		struct extension extension = {0};
+
+		snprintf(extension.overlay, sizeof(extension.overlay), "overlay%d.dtbo", i);
+		snprintf(extension.name, sizeof(extension.name), "extension board %d", i);
+		snprintf(extension.owner, sizeof(extension.owner), "sandbox");
+		snprintf(extension.version, sizeof(extension.version), "1.1");
+		snprintf(extension.other, sizeof(extension.other), "Fictional extension board");
+		if (!alist_add(extension_list, extension))
 			return -ENOMEM;
-
-		snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i);
-		snprintf(extension->name, sizeof(extension->name), "extension board %d", i);
-		snprintf(extension->owner, sizeof(extension->owner), "sandbox");
-		snprintf(extension->version, sizeof(extension->version), "1.1");
-		snprintf(extension->other, sizeof(extension->other), "Fictional extension board");
-		list_add_tail(&extension->list, extension_list);
 	}
 
 	return i;
 }
+
+U_BOOT_EXTENSION(sandbox_extension, sandbox_extension_board_scan);
+
+U_BOOT_DRVINFO(sandbox_extension) = {
+	.name = "sandbox_extension",
+};
 #endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
Signature · 1 line
2.43.0
Reviewed-by on v3 14/20
#16 lore raw

Re: [PATCH v3 14/20] board: sandbox: Convert extension support to UCLASS framework

Quoted 5 lines · Kory Maincent (TI.com)

Migrate sandbox extension board detection from legacy implementation to the new UCLASS-based extension board framework.

Quoted 9 lines

---

Change in v3:
- Use U_BOOT_DRVINFO.

---
 arch/Kconfig            |  2 +-
 board/sandbox/sandbox.c | 28 ++++++++++++++++------------
 2 files changed, 17 insertions(+), 13 deletions(-)
#17 lore raw

PATCH v3 15/20 board: compulab: Convert imx8mm-cl-iot-gate to UCLASS extension framework

In reply to Kory Maincent (TI.com)

Migrate CompuLab imx8mm-cl-iot-gate board extension detection from legacy implementation to the new UCLASS-based extension board framework.

---

Change in v3:
- Use U_BOOT_DRVINFO.

Change in v2:
- Fix build errors.

---
 arch/arm/mach-imx/imx8m/Kconfig                    |  4 +-
 .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c        | 67 +++++++++++-----------
 2 files changed, 35 insertions(+), 36 deletions(-)
arch/arm/mach-imx/imx8m/Kconfig +2 -2
index e7bc154b805..5324eff3084 100644
@@ -359,14 +359,14 @@ config TARGET_IMX8MM_CL_IOT_GATE
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
-	select SUPPORT_EXTENSION_SCAN
+	select SUPPORT_DM_EXTENSION_SCAN
 
 config TARGET_IMX8MM_CL_IOT_GATE_OPTEE
 	bool "CompuLab iot-gate-imx8 with optee support"
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
-	select SUPPORT_EXTENSION_SCAN
+	select SUPPORT_DM_EXTENSION_SCAN
 
 config TARGET_IMX8MP_RSB3720A1_4G
 	bool "Support i.MX8MP RSB3720A1 4G"
board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c +33 -34

139 lines not on this page · raw message

Signature · 1 line
2.43.0
#18 lore raw

PATCH v3 16/20 boot: Remove legacy extension board support

In reply to Kory Maincent (TI.com)

Remove the legacy extension board implementation now that all boards have been converted to use the new UCLASS-based framework. This eliminates lines of legacy code while preserving functionality through the modern driver model approach.

---

Changes in v2:
- Remove a missing DM_EXTENSION_SCAN in cmd/Kconfig

---
 MAINTAINERS                        |  1 -
 arch/Kconfig                       |  2 +-
 arch/arm/mach-imx/imx8m/Kconfig    |  4 +-
 arch/arm/mach-omap2/am33xx/Kconfig |  2 +-
 arch/arm/mach-omap2/omap5/Kconfig  |  2 +-
 arch/arm/mach-sunxi/Kconfig        |  2 +-
 board/ti/common/Kconfig            |  2 +-
 board/ti/common/Makefile           |  2 +-
 boot/Kconfig                       |  4 --
 boot/Makefile                      |  3 +-
 boot/extension-uclass.c            | 18 +++----
 boot/extension.c                   | 99 --------------------------------------
 cmd/Kconfig                        |  2 +-
 cmd/extension_board.c              | 72 +++------------------------
 include/extension_board.h          | 56 ++++++---------------
 15 files changed, 41 insertions(+), 230 deletions(-)
MAINTAINERS +0 -1
index a63ffa14ef5..a75e59453d7 100644
@@ -1188,7 +1188,6 @@ S:	Maintained
 F:	board/sunxi/chip.c
 F:	board/ti/common/cape_detect.c
 F:	boot/extension-uclass.c
-F:	boot/extension.c
 F:	cmd/extension_board.c
 F:	include/extension_board.h
 
arch/Kconfig +1 -1
index 5bb65a29f8d..7e05e0c2263 100644
@@ -215,7 +215,7 @@ config SANDBOX
 	select SYSRESET_CMD_POWEROFF if CMD_POWEROFF
 	select SYS_CACHE_SHIFT_4
 	select IRQ
-	select SUPPORT_DM_EXTENSION_SCAN if CMDLINE
+	select SUPPORT_EXTENSION_SCAN if CMDLINE
 	select SUPPORT_ACPI
 	imply BITREVERSE
 	select BLOBLIST
arch/arm/mach-imx/imx8m/Kconfig +2 -2
index 5324eff3084..e7bc154b805 100644
@@ -359,14 +359,14 @@ config TARGET_IMX8MM_CL_IOT_GATE
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
-	select SUPPORT_DM_EXTENSION_SCAN
+	select SUPPORT_EXTENSION_SCAN
 
 config TARGET_IMX8MM_CL_IOT_GATE_OPTEE
 	bool "CompuLab iot-gate-imx8 with optee support"
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
-	select SUPPORT_DM_EXTENSION_SCAN
+	select SUPPORT_EXTENSION_SCAN
 
 config TARGET_IMX8MP_RSB3720A1_4G
 	bool "Support i.MX8MP RSB3720A1 4G"
arch/arm/mach-omap2/am33xx/Kconfig +1 -1
index 77f7938305b..dff4f1cf202 100644
@@ -15,7 +15,7 @@ config TARGET_AM335X_EVM
 	select DM_GPIO
 	select DM_SERIAL
 	select TI_I2C_BOARD_DETECT
-	select SUPPORT_DM_EXTENSION_SCAN
+	select SUPPORT_EXTENSION_SCAN
 	imply CMD_DM
 	imply SPL_DM
 	imply SPL_DM_SEQ_ALIAS
arch/arm/mach-omap2/omap5/Kconfig +1 -1
index 819490a8cf8..5394529658b 100644
@@ -38,7 +38,7 @@ config TARGET_AM57XX_EVM
 	select CMD_DDR3
 	select DRA7XX
 	select TI_I2C_BOARD_DETECT
-	select SUPPORT_DM_EXTENSION_SCAN
+	select SUPPORT_EXTENSION_SCAN
 	imply DM_THERMAL
 	imply SCSI
 	imply SPL_THERMAL
arch/arm/mach-sunxi/Kconfig +1 -1
index f5696199516..b04ec671696 100644
@@ -1223,7 +1223,7 @@ config BLUETOOTH_DT_DEVICE_FIXUP
 
 config CHIP_DIP_SCAN
 	bool "Enable DIPs detection for CHIP board"
-	select SUPPORT_DM_EXTENSION_SCAN
+	select SUPPORT_EXTENSION_SCAN
 	select W1
 	select W1_GPIO
 	select W1_EEPROM
board/ti/common/Kconfig +1 -1
index feb05b4bf95..9512c5c23f1 100644
@@ -20,7 +20,7 @@ config CAPE_EEPROM_BUS_NUM
 	int "Cape EEPROM's I2C bus address"
 	range 0 8
 	default 2
-	depends on SUPPORT_DM_EXTENSION_SCAN
+	depends on SUPPORT_EXTENSION_SCAN
 
 config TI_COMMON_CMD_OPTIONS
 	bool "Enable cmd options on TI platforms"
board/ti/common/Makefile +1 -1
index b42273d3a5a..f58935b4103 100644
@@ -2,6 +2,6 @@
 # Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
 
 obj-${CONFIG_TI_I2C_BOARD_DETECT} += board_detect.o
-obj-${CONFIG_$(PHASE_)SUPPORT_DM_EXTENSION_SCAN} += cape_detect.o
+obj-${CONFIG_$(PHASE_)SUPPORT_EXTENSION_SCAN} += cape_detect.o
 obj-${CONFIG_OF_LIBFDT} += fdt_ops.o
 obj-${CONFIG_ARCH_K3} += k3-ddr.o
boot/Kconfig +0 -4
index 08d666d4b93..a75f6b641ed 100644
@@ -1910,10 +1910,6 @@ config SUPPORT_EXTENSION_SCAN
 	select OF_LIBFDT_OVERLAY
         bool
 
-config SUPPORT_DM_EXTENSION_SCAN
-	select OF_LIBFDT_OVERLAY
-        bool
-
 config USE_BOOTARGS
 	bool "Enable boot arguments"
 	help
boot/Makefile +1 -2
index aa26070fbb8..7fb56e7ef37 100644
@@ -9,8 +9,7 @@ obj-$(CONFIG_BOOT_RETRY) += bootretry.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
-obj-$(CONFIG_SUPPORT_EXTENSION_SCAN) += extension.o
-obj-$(CONFIG_SUPPORT_DM_EXTENSION_SCAN) += extension-uclass.o
+obj-$(CONFIG_SUPPORT_EXTENSION_SCAN) += extension-uclass.o
 
 obj-$(CONFIG_PXE_UTILS) += pxe_utils.o
 
boot/extension-uclass.c +9 -9
index 914971215af..35f751237eb 100644
@@ -14,7 +14,7 @@
 #include <dm/lists.h>
 #include <dm/uclass.h>
 
-struct alist *dm_extension_get_list(void)
+struct alist *extension_get_list(void)
 {
 	struct udevice *dev;
 
@@ -24,7 +24,7 @@ struct alist *dm_extension_get_list(void)
 	return dev_get_priv(dev);
 }
 
-int dm_extension_probe(struct udevice *dev)
+int extension_probe(struct udevice *dev)
 {
 	struct alist *extension_list = dev_get_priv(dev);
 
@@ -32,7 +32,7 @@ int dm_extension_probe(struct udevice *dev)
 	return 0;
 }
 
-int dm_extension_remove(struct udevice *dev)
+int extension_remove(struct udevice *dev)
 {
 	struct alist *extension_list = dev_get_priv(dev);
 
@@ -40,9 +40,9 @@ int dm_extension_remove(struct udevice *dev)
 	return 0;
 }
 
-int dm_extension_scan(void)
+int extension_scan(void)
 {
-	struct alist *extension_list = dm_extension_get_list();
+	struct alist *extension_list = extension_get_list();
 	const struct extension_ops *ops;
 	struct udevice *dev;
 	int ret;
@@ -109,9 +109,9 @@ static int _extension_apply(const struct extension *extension)
 	return ret;
 }
 
-int dm_extension_apply(int extension_num)
+int extension_apply(int extension_num)
 {
-	struct alist *extension_list = dm_extension_get_list();
+	struct alist *extension_list = extension_get_list();
 	const struct extension *extension;
 
 	if (!extension_list)
@@ -127,9 +127,9 @@ int dm_extension_apply(int extension_num)
 	return _extension_apply(extension);
 }
 
-int dm_extension_apply_all(void)
+int extension_apply_all(void)
 {
-	struct alist *extension_list = dm_extension_get_list();
+	struct alist *extension_list = extension_get_list();
 	const struct extension *extension;
 	int ret;
 
boot/extension.c deleted +0 -99

99 lines not on this page · raw message

cmd/Kconfig +1 -1
index 721bdb87c8a..986eeeba807 100644
@@ -548,7 +548,7 @@ config CMD_FDT
 config CMD_EXTENSION
 	bool "Extension board management command"
 	select CMD_FDT
-	depends on SUPPORT_EXTENSION_SCAN || SUPPORT_DM_EXTENSION_SCAN
+	depends on SUPPORT_EXTENSION_SCAN
 	help
 	  Enables the "extension" command, which allows to detect
 	  extension boards connected to the system, and apply
cmd/extension_board.c +8 -64

118 lines not on this page · raw message

include/extension_board.h +14 -42

109 lines not on this page · raw message

Signature · 1 line
2.43.0
#19 lore raw

PATCH v3 17/20 boot: extension: Move overlay apply custom logic to command level

In reply to Kory Maincent (TI.com)

The extension_overlay_cmd environment variable approach is specific to the U-Boot extension_board command, while other boot flows (pxe_utils, bootstd) handle overlay loading differently.

Move the extension_overlay_cmd execution out of the core extension framework to the command level. This decouples the framework from command-specific behavior and prepares for future extension support in other boot flows.

---
 boot/extension-uclass.c   | 68 +++--------------------------------
 cmd/extension_board.c     | 92 +++++++++++++++++++++++++++++++++++++++++++++--
 include/extension_board.h | 12 ++-----
 3 files changed, 98 insertions(+), 74 deletions(-)
boot/extension-uclass.c +5 -63
index 35f751237eb..4b3dd1bc0cd 100644
@@ -59,92 +59,34 @@ int extension_scan(void)
 	return ops->scan(dev, extension_list);
 }
 
-static int _extension_apply(const struct extension *extension)
+int extension_apply(struct fdt_header *working_fdt, ulong size)
 {
-	ulong extrasize, overlay_addr;
 	struct fdt_header *blob;
-	char *overlay_cmd;
+	ulong overlay_addr;
 	int ret;
 
-	if (!working_fdt) {
-		printf("No FDT memory address configured. Please configure\n"
-		       "the FDT address via \"fdt addr <address>\" command.\n");
-		return -EINVAL;
-	}
-
-	overlay_cmd = env_get("extension_overlay_cmd");
-	if (!overlay_cmd) {
-		printf("Environment extension_overlay_cmd is missing\n");
-		return -EINVAL;
-	}
-
 	overlay_addr = env_get_hex("extension_overlay_addr", 0);
 	if (!overlay_addr) {
 		printf("Environment extension_overlay_addr is missing\n");
 		return -EINVAL;
 	}
 
-	env_set("extension_overlay_name", extension->overlay);
-	ret = run_command(overlay_cmd, 0);
-	if (ret)
-		return ret;
-
-	extrasize = env_get_hex("filesize", 0);
-	if (!extrasize)
-		return -EINVAL;
-
-	fdt_shrink_to_minimum(working_fdt, extrasize);
+	fdt_shrink_to_minimum(working_fdt, size);
 
 	blob = map_sysmem(overlay_addr, 0);
 	if (!fdt_valid(&blob)) {
-		printf("Invalid overlay devicetree %s\n", extension->overlay);
+		printf("Invalid overlay devicetree\n");
 		return -EINVAL;
 	}
 
 	/* Apply method prints messages on error */
 	ret = fdt_overlay_apply_verbose(working_fdt, blob);
 	if (ret)
-		printf("Failed to apply overlay %s\n", extension->overlay);
+		printf("Failed to apply overlay\n");
 
 	return ret;
 }
 
-int extension_apply(int extension_num)
-{
-	struct alist *extension_list = extension_get_list();
-	const struct extension *extension;
-
-	if (!extension_list)
-		return -ENOENT;
-
-	extension = alist_get(extension_list, extension_num,
-			      struct extension);
-	if (!extension) {
-		printf("Wrong extension number\n");
-		return -EINVAL;
-	}
-
-	return _extension_apply(extension);
-}
-
-int extension_apply_all(void)
-{
-	struct alist *extension_list = extension_get_list();
-	const struct extension *extension;
-	int ret;
-
-	if (!extension_list)
-		return -ENOENT;
-
-	alist_for_each(extension, extension_list) {
-		ret = _extension_apply(extension);
-		if (ret)
-			return ret;
-	}
-
-	return 0;
-}
-
 UCLASS_DRIVER(extension) = {
 	.name	= "extension",
 	.id	= UCLASS_EXTENSION,
cmd/extension_board.c +90 -2

110 lines not on this page · raw message

include/extension_board.h +3 -9
index 251482d0287..61d7c5f668f 100644
@@ -44,17 +44,11 @@ int extension_scan(void);
 
 /**
  * extension_apply - Apply extension board overlay to the devicetree
- * @extension_num: Extension number to be applied
+ * @working_fdt: Pointer to working flattened device tree
+ * @size: Size of the devicetree overlay
  * Return: Zero on success, negative on failure.
  */
-int extension_apply(int extension_num);
-
-/**
- * extension_apply_all - Apply all extension board overlays to the
- *			    devicetree
- * Return: Zero on success, negative on failure.
- */
-int extension_apply_all(void);
+int extension_apply(struct fdt_header *working_fdt, ulong size);
 
 /**
  * extension - Description fields of an extension board
Signature · 1 line
2.43.0
#20 lore raw

PATCH v3 18/20 boot: pxe_utils: Add extension board devicetree overlay support

In reply to Kory Maincent (TI.com)

Add support for scanning and applying extension board devicetree overlays during PXE boot. After loading the main board devicetree, the system now scans for available extension boards and applies their overlays automatically.

This enables dynamic hardware configuration for systems with extension boards during boot scenarios which are using pxe_utils.

---

Changes in v3:
- Added error log if the overlay does not load or apply.

---
 boot/pxe_utils.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)
boot/pxe_utils.c +92 -0
index eb4d7723481..038416203fc 100644
@@ -10,6 +10,7 @@
 #include <command.h>
 #include <dm.h>
 #include <env.h>
+#include <extension_board.h>
 #include <image.h>
 #include <log.h>
 #include <malloc.h>
@@ -432,6 +433,95 @@ skip_overlay:
 }
 #endif
 
+/*
+ * label_boot_extension - scan extension boards and load overlay associated
+ */
+
+static void label_boot_extension(struct pxe_context *ctx,
+				 struct pxe_label *label)
+{
+#if CONFIG_IS_ENABLED(SUPPORT_EXTENSION_SCAN)
+	const struct extension *extension;
+	struct fdt_header *working_fdt;
+	struct alist *extension_list;
+	int ret, dir_len, len;
+	char *overlay_dir;
+	const char *slash;
+	ulong fdt_addr;
+
+	ret = extension_scan();
+	if (ret < 0)
+		return;
+
+	extension_list = extension_get_list();
+	if (!extension_list)
+		return;
+
+	/* Get the main fdt and map it */
+	fdt_addr = env_get_hex("fdt_addr_r", 0);
+	working_fdt = map_sysmem(fdt_addr, 0);
+	if (fdt_check_header(working_fdt))
+		return;
+
+	/* Use fdtdir for now as the overlay devicetree directory */
+	if (label->fdtdir) {
+		len = strlen(label->fdtdir);
+		if (!len)
+			slash = "./";
+		else if (label->fdtdir[len - 1] != '/')
+			slash = "/";
+		else
+			slash = "";
+
+		dir_len = strlen(label->fdtdir) + strlen(slash) + 1;
+		overlay_dir = calloc(1, len);
+		if (!overlay_dir)
+			return;
+
+		snprintf(overlay_dir, dir_len, "%s%s", label->fdtdir,
+			 slash);
+	} else {
+		dir_len = 2;
+		snprintf(overlay_dir, dir_len, "/");
+	}
+
+	alist_for_each(extension, extension_list) {
+		char *overlay_file;
+		ulong size;
+
+		len = dir_len + strlen(extension->overlay);
+		overlay_file = calloc(1, len);
+		if (!overlay_file)
+			goto cleanup;
+
+		snprintf(overlay_file, len, "%s%s", overlay_dir,
+			 extension->overlay);
+
+		/* Load extension overlay file */
+		ret = get_relfile_envaddr(ctx, overlay_file,
+					  "extension_overlay_addr",
+					  (enum bootflow_img_t)IH_TYPE_FLATDT,
+					  &size);
+		if (ret < 0) {
+			printf("Failed loading overlay %s\n", overlay_file);
+			free(overlay_file);
+			continue;
+		}
+
+		ret = extension_apply(working_fdt, size);
+		if (ret) {
+			printf("Failed applying overlay %s\n", overlay_file);
+			free(overlay_file);
+			continue;
+		}
+		free(overlay_file);
+	}
+
+cleanup:
+	free(overlay_dir);
+#endif
+}
+
 /**
  * label_boot() - Boot according to the contents of a pxe_label
  *
@@ -685,6 +775,8 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label)
 			if (label->fdtoverlays)
 				label_boot_fdtoverlay(ctx, label);
 #endif
+			label_boot_extension(ctx, label);
+
 		} else {
 			bootm_argv[3] = NULL;
 		}
Signature · 1 line
2.43.0
#21 lore raw

PATCH v3 19/20 boot: bootmeth_efi: Refactor distro_efi_try_bootflow_files return logic

In reply to Kory Maincent (TI.com)

Simplify the return path in distro_efi_try_bootflow_files() to prepare for adding extension board support in a subsequent commit.

---
 boot/bootmeth_efi.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
boot/bootmeth_efi.c +16 -15
index 0af23df3a4a..64de5c08b7b 100644
@@ -148,25 +148,26 @@ static int distro_efi_try_bootflow_files(struct udevice *dev,
 			return log_msg_ret("fil", -ENOMEM);
 	}
 
-	if (!ret) {
-		bflow->fdt_size = size;
-		bflow->fdt_addr = fdt_addr;
-
-		/*
-		 * TODO: Apply extension overlay
-		 *
-		 * Here we need to load and apply the extension overlay. This is
-		 * not implemented. See do_extension_apply(). The extension
-		 * stuff needs an implementation in boot/extension.c so it is
-		 * separate from the command code. Really the extension stuff
-		 * should use the device tree and a uclass / driver interface
-		 * rather than implementing its own list
-		 */
-	} else {
+	if (ret) {
 		log_debug("No device tree available\n");
 		bflow->flags |= BOOTFLOWF_USE_BUILTIN_FDT;
+		return 0;
 	}
 
+	bflow->fdt_size = size;
+	bflow->fdt_addr = fdt_addr;
+
+	/*
+	 * TODO: Apply extension overlay
+	 *
+	 * Here we need to load and apply the extension overlay. This is
+	 * not implemented. See do_extension_apply(). The extension
+	 * stuff needs an implementation in boot/extension.c so it is
+	 * separate from the command code. Really the extension stuff
+	 * should use the device tree and a uclass / driver interface
+	 * rather than implementing its own list
+	 */
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
#22 lore raw

PATCH v3 20/20 boot: bootmeth_efi: Add extension board devicetree overlay support

In reply to Kory Maincent (TI.com)

Add support for scanning and applying extension board devicetree overlays during EFI boot. After loading the main board devicetree, the system now scans for available extension boards and applies their overlays automatically.

---

Not yet tested, need to find a board with extension boards and supporting EFI boot. Roger Quadros could you test it on your side?

Changes in v3:
- Added error log if the overlay does not load or apply.

---
 boot/bootmeth_efi.c | 68 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 57 insertions(+), 11 deletions(-)
boot/bootmeth_efi.c +57 -11
index 64de5c08b7b..f592fec07f6 100644
@@ -16,6 +16,7 @@
 #include <efi.h>
 #include <efi_loader.h>
 #include <env.h>
+#include <extension_board.h>
 #include <fs.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -99,8 +100,11 @@ static int distro_efi_check(struct udevice *dev, struct bootflow_iter *iter)
 static int distro_efi_try_bootflow_files(struct udevice *dev,
 					 struct bootflow *bflow)
 {
+	ulong fdt_addr, size, overlay_addr;
+	const struct extension *extension;
+	struct fdt_header *working_fdt;
 	struct blk_desc *desc = NULL;
-	ulong fdt_addr, size;
+	struct alist *extension_list;
 	char fname[256];
 	int ret, seq;
 
@@ -157,16 +161,58 @@ static int distro_efi_try_bootflow_files(struct udevice *dev,
 	bflow->fdt_size = size;
 	bflow->fdt_addr = fdt_addr;
 
-	/*
-	 * TODO: Apply extension overlay
-	 *
-	 * Here we need to load and apply the extension overlay. This is
-	 * not implemented. See do_extension_apply(). The extension
-	 * stuff needs an implementation in boot/extension.c so it is
-	 * separate from the command code. Really the extension stuff
-	 * should use the device tree and a uclass / driver interface
-	 * rather than implementing its own list
-	 */
+	if (!CONFIG_IS_ENABLED(SUPPORT_EXTENSION_SCAN))
+		return 0;
+
+	ret = extension_scan();
+	if (ret < 0)
+		return 0;
+
+	extension_list = extension_get_list();
+	if (!extension_list)
+		return 0;
+
+	working_fdt = map_sysmem(fdt_addr, 0);
+	if (fdt_check_header(working_fdt))
+		return 0;
+
+	overlay_addr = env_get_hex("extension_overlay_addr", 0);
+	if (!overlay_addr) {
+		log_debug("Environment extension_overlay_addr is missing\n");
+		return 0;
+	}
+
+	alist_for_each(extension, extension_list) {
+		char *overlay_file;
+		int len;
+
+		len = sizeof(EFI_DIRNAME) + strlen(extension->overlay);
+		overlay_file = calloc(1, len);
+		if (!overlay_file)
+			return -ENOMEM;
+
+		snprintf(overlay_file, len, "%s%s", EFI_DIRNAME,
+			 extension->overlay);
+
+		ret = bootmeth_common_read_file(dev, bflow, overlay_file,
+						overlay_addr,
+						(enum bootflow_img_t)IH_TYPE_FLATDT,
+						&size);
+		if (ret) {
+			log_debug("Failed loading overlay %s\n", overlay_file);
+			free(overlay_file);
+			continue;
+		}
+
+		ret = extension_apply(working_fdt, size);
+		if (ret) {
+			log_debug("Failed applying overlay %s\n", overlay_file);
+			free(overlay_file);
+			continue;
+		}
+		bflow->fdt_size += size;
+		free(overlay_file);
+	}
 
 	return 0;
 }
Signature · 1 line
2.43.0
#23 lore raw
In reply to Kory Maincent (TI.com)

Hi Kory,

Quoted 9 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

Quoted 63 lines

Changes in v3:
- Reorder the patches inside the series as several config were broken in the middle of the series.
- Use U_BOOT_DRVINFO macro instead of manually bind the drivers.
- Use uclass_first_device_err instead of extension_get_dev function.
- Made few fixes in documentation and Kconfig dependency.
- Made few changes of error value returned.
- Add a patch to document the extension structure.
- Add a patch to fix CAPE_EEPROM_BUS_NUM Kconfig dependency

Changes in v2:
- Fixes few build errors.
- Add patches to move the extension support and board scan out of XPL images build.

---
Kory Maincent (TI.com) (20):
MAINTAINERS: Add maintainer for extension board support
board: ti: Exclude cape detection from XPL builds
board: ti: Fix CAPE_EEPROM_BUS_NUM Kconfig dependency
board: sunxi: Exclude DIP detection from XPL builds
board: compulab: Exclude compulab extension board detection from XPL builds
include: extension_board: Document the extension structure
boot: Move extension board support from cmd/ to boot/
boot: Add UCLASS support for extension boards
board: ti: Refactor cape detection code for readability
board: ti: Convert cape detection to use UCLASS framework
board: sunxi: Refactor CHIP board extension code
board: sunxi: Convert extension support to UCLASS framework
board: sandbox: Improve extension board scan implementation
board: sandbox: Convert extension support to UCLASS framework
board: compulab: Convert imx8mm-cl-iot-gate to UCLASS extension framework
boot: Remove legacy extension board support
boot: extension: Move overlay apply custom logic to command level
boot: pxe_utils: Add extension board devicetree overlay support
boot: bootmeth_efi: Refactor distro_efi_try_bootflow_files return logic
boot: bootmeth_efi: Add extension board devicetree overlay support

 MAINTAINERS                                        |   9 +
 .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c        |  70 ++++----
 board/sandbox/sandbox.c                            |  26 ++-
 board/sunxi/Makefile                               |   2 +-
 board/sunxi/chip.c                                 |  36 ++--
 board/ti/common/Kconfig                            |   2 +-
 board/ti/common/Makefile                           |   2 +-
 board/ti/common/cape_detect.c                      |  56 ++++---
 boot/Kconfig                                       |   4 +
 boot/Makefile                                      |   1 +
 boot/bootmeth_efi.c                                |  79 +++++++--
 boot/extension-uclass.c                            |  93 +++++++++++
 boot/pxe_utils.c                                   |  92 +++++++++++
 cmd/Kconfig                                        |   3 -
 cmd/extension_board.c                              | 183 ++++++++++-----------
 doc/usage/cmd/extension.rst                        |  29 ++--
 include/dm/uclass-id.h                             |   1 +
 include/extension_board.h                          |  85 ++++++++--
 18 files changed, 541 insertions(+), 232 deletions(-)

---
base-commit: 8e7f8c1248e8adfb525a2a4ea56ebf7e54ff5d7a
change-id: 20250916-feature_sysboot_extension_board-958dd0072565

Quoted 6 lines

Best regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Regards,
Simon

#24 lore raw
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 6 lines
Quoted 3 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Signature · 1 line
Tom
#25 lore raw
Quoted 15 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 14 lines · Simon Glass

Hi Kory,

Quoted 9 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

Quoted 5 lines
Quoted 2 lines

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

=> bootflow scan -l
Scanning for bootflows in all bootdevs

Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------

---------------- Scanning global bootmeth 'efi_mgr':
efi_var_to_file() Cannot persist EFI variables without system partition
efi_tcg2_register() Missing TPMv2 device for EFI_TCG_PROTOCOL
efi_rng_register() Missing RNG device for EFI_RNG_PROTOCOL
Hunting with: simple_bus
Found 2 extension board(s).
Hunting with: mmc
Hunting with: nvme
Hunting with: qfw
Hunting with: scsi
scanning bus for devices...
Hunting with: spi_flash
Hunting with: virtio
Scanning bootdev 'qfw_sandbox.bootdev':
[1] 487232 segmentation fault (core dumped) ./u-boot

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#26 lore raw
Quoted 18 lines · Kory Maincent
Quoted 15 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 14 lines · Simon Glass

Hi Kory,

Quoted 9 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

Signature · 1 line
Tom
#27 lore raw
Quoted 22 lines · Tom Rini
Quoted 21 lines · Kory Maincent
Quoted 18 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 16 lines · Simon Glass

Hi Kory,

Quoted 9 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board.
I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

Signature · 1 line
Tom
#28 lore raw
Quoted 27 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 26 lines · Tom Rini
Quoted 25 lines · Kory Maincent
Quoted 21 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 7 lines
Quoted 4 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board. I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the sandbox_defconfig:
https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19)
Test: bootdev_test_any: bootdev.c (flat tree)
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but there is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#29 lore raw
Quoted 52 lines · Kory Maincent
Quoted 27 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 26 lines · Tom Rini
Quoted 25 lines · Kory Maincent
Quoted 21 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 7 lines
Quoted 4 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board. I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the sandbox_defconfig:
https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19)
Test: bootdev_test_any: bootdev.c (flat tree)
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Quoted 8 lines

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but there is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should help get you started, and you can just run all of the ut tests under that.

Signature · 1 line
Tom
#30 lore raw
Quoted 60 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 59 lines · Kory Maincent
Quoted 28 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 27 lines · Tom Rini
Quoted 26 lines · Kory Maincent
Quoted 22 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 7 lines
Quoted 4 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board. I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the sandbox_defconfig:
https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test:
bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but there is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

Quoted 8 lines
Quoted 3 lines

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should help get you started, and you can just run all of the ut tests under that.

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#31 lore raw
Quoted 67 lines · Kory Maincent
Quoted 64 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 62 lines · Kory Maincent
Quoted 28 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 27 lines · Tom Rini
Quoted 26 lines · Kory Maincent
Quoted 22 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 7 lines
Quoted 4 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board. I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the sandbox_defconfig:
https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test:
bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but there is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

Quoted 8 lines
Quoted 4 lines

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should help get you started, and you can just run all of the ut tests under that.

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k ut" should work, as I tried that (via my wrapper around all this) as well as just running all the tests (which is longer).

Signature · 1 line
Tom
#32 lore raw
Quoted 73 lines · Tom Rini
Quoted 72 lines · Kory Maincent
Quoted 68 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 54 lines · Kory Maincent
Quoted 28 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 27 lines · Tom Rini
Quoted 26 lines · Kory Maincent
Quoted 22 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Simon Glass

Hi Kory,

Quoted 6 lines · Kory Maincent (TI.com)

This series converts the extension board framework to use UCLASS as requested by Simon Glass, then adds extension support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the standard boot process.

Quoted 7 lines
Quoted 4 lines

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this board. I also can't test the efi bootmeth change as I don't have such board.

You can test this with sandbox, using one of the bootmeth tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It seems the bootlflow scan is not working on the sandbox on next branch. Is this issue known?

Is it fine on master? The next branch will be out of date until it re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the sandbox_defconfig:
https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test:
bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Quoted 8 lines

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but there is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should help get you started, and you can just run all of the ut tests under that.

Quoted 7 lines
Quoted 3 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k ut" should work, as I tried that (via my wrapper around all this) as well as just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 3 lines
Signature · 2 lines
-- 
Tom

A message that is not in the archive (sent off-list or not yet received): 20251021110225.2d94a13b@kmaincent-XPS-13-7390

#34 lore raw

Hi Kory,

Quoted 129 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 17 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 15 lines · Tom Rini
Quoted 14 lines · Kory Maincent
Quoted 11 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Kory Maincent
Quoted 7 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 6 lines · Tom Rini
Quoted 4 lines · Kory Maincent
Quoted 1 line · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon Glass

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Kory,

Quoted 2 lines · Kory Maincent (TI.com)

This series converts the extension board framework to

use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

UCLASS as requested by Simon Glass, then adds

extension

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

support to pxe_utils and bootmeth_efi (not tested) to enable extension boards devicetree load in the

standard

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

boot process.

I can't test the imx8 extension scan enabled by the imx8mm-cl-iot-gate_defconfig as I don't have this

board.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I also can't test the efi bootmeth change as I don't

have

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox

on next

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

branch. Is this issue known?

Is it fine on master? The next branch will be out of date

until it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should

help

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

get you started, and you can just run all of the ut tests under

that.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 1 line
Quoted 1 line

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 25 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

Regards,
Simon

Quoted 6 lines

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

#35 lore raw
Quoted 143 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 129 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 17 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 15 lines · Tom Rini
Quoted 14 lines · Kory Maincent
Quoted 11 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Kory Maincent
Quoted 7 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 6 lines · Tom Rini
Quoted 4 lines · Kory Maincent
Quoted 1 line · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon Glass

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Kory,

Quoted 2 lines · Kory Maincent (TI.com)

This series converts the extension board framework to

use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

UCLASS as requested by Simon Glass, then adds

extension

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

support to pxe_utils and bootmeth_efi (not tested) to
enable extension boards devicetree load in the

standard

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

boot process.

I can't test the imx8 extension scan enabled by the
imx8mm-cl-iot-gate_defconfig as I don't have this

board.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I also can't test the efi bootmeth change as I don't

have

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox

on next

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

branch. Is this issue known?

Is it fine on master? The next branch will be out of date

until it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should

help

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

get you started, and you can just run all of the ut tests under

that.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 1 line
Quoted 1 line

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 25 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd  

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 4 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c
test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

Also I saw that as I removed the extension hunter in this series it brings new test errors that need to be fixed.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#36 lore raw
Quoted 162 lines · Kory Maincent
Quoted 143 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 129 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 17 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 15 lines · Tom Rini
Quoted 14 lines · Kory Maincent
Quoted 11 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 10 lines · Kory Maincent
Quoted 7 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 6 lines · Tom Rini
Quoted 4 lines · Kory Maincent
Quoted 1 line · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon Glass

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Kory,

On Mon, 13 Oct 2025 at 14:32, Kory Maincent (TI.com)
<[email protected]> wrote:

This series converts the extension board framework to

use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

UCLASS as requested by Simon Glass, then adds

extension

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

support to pxe_utils and bootmeth_efi (not tested) to
enable extension boards devicetree load in the

standard

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

boot process.

I can't test the imx8 extension scan enabled by the
imx8mm-cl-iot-gate_defconfig as I don't have this

board.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I also can't test the efi bootmeth change as I don't

have

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

tests, perhaps. Let me know if you need help with this.

But the question is, does the real hardware platform work before/after this, not does the sandbox test still work before/after this.

It seems the bootlflow scan is not working on the sandbox

on next

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

branch. Is this issue known?

Is it fine on master? The next branch will be out of date

until it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html should

help

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

get you started, and you can just run all of the ut tests under

that.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 1 line
Quoted 1 line

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 25 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd  

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 4 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c
test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

Quoted 5 lines

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

No, I can do:

$ git clean -dfx
$ ./test/py/test.py --bd sandbox --build -k test_ut
And the result is:
=============== 872 passed, 1 skipped, 608 deselected, 13398 warnings in 55.73s ===============

And this is on top of tree master right now.

Signature · 1 line
Tom
#37 lore raw
Quoted 185 lines · On Tue, 21 Oct 2025 07:49:07 -0600 Tom Rini <[email protected]> wrote:
Quoted 178 lines · Kory Maincent
Quoted 157 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 143 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 19 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 17 lines · Tom Rini
Quoted 16 lines · Kory Maincent
Quoted 13 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 11 lines · Kory Maincent
Quoted 8 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 7 lines · Tom Rini
Quoted 5 lines · Kory Maincent
Quoted 2 lines · On Sun, 19 Oct 2025 10:48:37 -0600 Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon Glass

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Hi Kory,

On Mon, 13 Oct 2025 at 14:32, Kory Maincent (TI.com)
<[email protected]> wrote:

This series converts the extension board framework
to

use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

UCLASS as requested by Simon Glass, then adds

extension

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support to pxe_utils and bootmeth_efi (not tested)
to enable extension boards devicetree load in the

standard

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

boot process.

I can't test the imx8 extension scan enabled by the
imx8mm-cl-iot-gate_defconfig as I don't have this

board.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I also can't test the efi bootmeth change as I
don't

have

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

tests, perhaps. Let me know if you need help with
this.

But the question is, does the real hardware platform
work before/after this, not does the sandbox test
still work before/after this.

It seems the bootlflow scan is not working on the
sandbox

on next

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

branch. Is this issue known?

Is it fine on master? The next branch will be out of date

until it

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html
should

help

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

get you started, and you can just run all of the ut tests under

that.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 2 lines
Quoted 2 lines

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 25 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd    

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 5 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c
test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

Quoted 5 lines

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

Quoted 8 lines

No, I can do:

$ git clean -dfx
$ ./test/py/test.py --bd sandbox --build -k test_ut
And the result is:
=============== 872 passed, 1 skipped, 608 deselected, 13398 warnings in
55.73s ===============

And this is on top of tree master right now.

Oh ok weird, I just tried again on my side but still got 6 tests that failed. These tests are not related to my series so lets ignore these.

Anyway, I don't see how I can test the extension support in bootmeth efi with sandbox, and it would be better to test it on a real board. Or at least that it does not break bootmeth efi for the current hardware platform.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#38 lore raw
Quoted 195 lines · Kory Maincent
Quoted 192 lines · On Tue, 21 Oct 2025 07:49:07 -0600 Tom Rini <[email protected]> wrote:
Quoted 178 lines · Kory Maincent
Quoted 157 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 143 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 19 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 17 lines · Tom Rini
Quoted 16 lines · Kory Maincent
Quoted 13 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 11 lines · Kory Maincent
Quoted 8 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 7 lines · Tom Rini
Quoted 5 lines · Kory Maincent

On Sun, 19 Oct 2025 10:48:37 -0600
Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon Glass

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Hi Kory,

On Mon, 13 Oct 2025 at 14:32, Kory Maincent (TI.com)
<[email protected]> wrote:

This series converts the extension board framework
to

use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

UCLASS as requested by Simon Glass, then adds

extension

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support to pxe_utils and bootmeth_efi (not tested)
to enable extension boards devicetree load in the

standard

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

boot process.

I can't test the imx8 extension scan enabled by the
imx8mm-cl-iot-gate_defconfig as I don't have this

board.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I also can't test the efi bootmeth change as I
don't

have

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

tests, perhaps. Let me know if you need help with
this.

But the question is, does the real hardware platform
work before/after this, not does the sandbox test
still work before/after this.

It seems the bootlflow scan is not working on the
sandbox

on next

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

branch. Is this issue known?

Is it fine on master? The next branch will be out of date

until it

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

re-opens with -rc2 being released (2 weeks from today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow test:
./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html
should

help

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

get you started, and you can just run all of the ut tests under

that.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following command:
./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 2 lines
Quoted 2 lines

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 25 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd    

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 5 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c
test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

Quoted 5 lines

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

No, I can do:

$ git clean -dfx
$ ./test/py/test.py --bd sandbox --build -k test_ut
And the result is:
=============== 872 passed, 1 skipped, 608 deselected, 13398 warnings in
55.73s ===============
Quoted 8 lines
Quoted 1 line

And this is on top of tree master right now.

Oh ok weird, I just tried again on my side but still got 6 tests that failed. These tests are not related to my series so lets ignore these.

Anyway, I don't see how I can test the extension support in bootmeth efi with sandbox, and it would be better to test it on a real board. Or at least that it does not break bootmeth efi for the current hardware platform.

Do you have other changes for v3? If not, I'll apply that soon and we can add more tests in a follow-up, if Simon can explain his thinking on how it would work. If you do have changes for v4, same comments about testing apply but I'll move v3 to superseded in patchwork so I don't forget.

Signature · 1 line
Tom
#39 lore raw
Quoted 214 lines · On Tue, 21 Oct 2025 08:36:26 -0600 Tom Rini <[email protected]> wrote:
Quoted 205 lines · Kory Maincent
Quoted 193 lines · On Tue, 21 Oct 2025 07:49:07 -0600 Tom Rini <[email protected]> wrote:
Quoted 185 lines · Kory Maincent
Quoted 164 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 150 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 21 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 19 lines · Tom Rini
Quoted 17 lines · Kory Maincent
Quoted 14 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 12 lines · Kory Maincent
Quoted 9 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:
Quoted 7 lines · Tom Rini

On Mon, Oct 20, 2025 at 11:50:09AM +0200, Kory Maincent
wrote:
On Sun, 19 Oct 2025 10:48:37 -0600
Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon
Glass

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Hi Kory,

On Mon, 13 Oct 2025 at 14:32, Kory Maincent
(TI.com) <[email protected]> wrote:

This series converts the extension board
framework to

use

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

UCLASS as requested by Simon Glass, then adds

extension

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support to pxe_utils and bootmeth_efi (not
tested) to enable extension boards devicetree
load in the

standard

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

boot process.

I can't test the imx8 extension scan enabled
by the imx8mm-cl-iot-gate_defconfig as I don't
have this

board.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I also can't test the efi bootmeth change as I
don't

have

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

tests, perhaps. Let me know if you need help with
this.

But the question is, does the real hardware
platform work before/after this, not does the
sandbox test still work before/after this.

It seems the bootlflow scan is not working on the
sandbox

on next

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

branch. Is this issue known?

Is it fine on master? The next branch will be out of
date

until it

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

re-opens with -rc2 being released (2 weeks from
today).

... out of sync local calendar, 3 weeks from today, not 2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow
test: ./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html
should

help

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

get you started, and you can just run all of the ut tests under

that.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following
command: ./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 2 lines
Quoted 2 lines

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 26 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see
setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd      

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 5 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

Quoted 6 lines

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

Quoted 8 lines

No, I can do:

$ git clean -dfx
$ ./test/py/test.py --bd sandbox --build -k test_ut
And the result is:
=============== 872 passed, 1 skipped, 608 deselected, 13398 warnings in
55.73s ===============

And this is on top of tree master right now.

Quoted 7 lines

Oh ok weird, I just tried again on my side but still got 6 tests that failed. These tests are not related to my series so lets ignore these.

Anyway, I don't see how I can test the extension support in bootmeth efi with sandbox, and it would be better to test it on a real board. Or at least that it does not break bootmeth efi for the current hardware platform.

Quoted 5 lines

Do you have other changes for v3? If not, I'll apply that soon and we can add more tests in a follow-up, if Simon can explain his thinking on how it would work. If you do have changes for v4, same comments about testing apply but I'll move v3 to superseded in patchwork so I don't forget.

As I said: "I saw that as I removed the extension hunter in this series it brings new test errors that need to be fixed."
I think it is better avoid these CI build test errors and send a v4.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#40 lore raw
Quoted 223 lines · Kory Maincent
Quoted 214 lines · On Tue, 21 Oct 2025 08:36:26 -0600 Tom Rini <[email protected]> wrote:
Quoted 205 lines · Kory Maincent
Quoted 193 lines · On Tue, 21 Oct 2025 07:49:07 -0600 Tom Rini <[email protected]> wrote:
Quoted 185 lines · Kory Maincent
Quoted 164 lines · On Tue, 21 Oct 2025 10:52:05 +0100 Simon Glass <[email protected]> wrote:

Hi Kory,

Quoted 150 lines · On Tue, Oct 21, 2025, 10:02 Kory Maincent <[email protected]> wrote:
Quoted 21 lines · On Tue, 21 Oct 2025 09:40:58 +0200 Mattijs Korpershoek…
Quoted 19 lines · Tom Rini
Quoted 17 lines · Kory Maincent
Quoted 14 lines · On Mon, 20 Oct 2025 10:05:27 -0600 Tom Rini <[email protected]> wrote:
Quoted 12 lines · Kory Maincent
Quoted 9 lines · On Mon, 20 Oct 2025 08:37:29 -0600 Tom Rini <[email protected]> wrote:

On Mon, Oct 20, 2025 at 08:15:48AM -0600, Tom Rini
wrote:
On Mon, Oct 20, 2025 at 11:50:09AM +0200, Kory Maincent
wrote:
On Sun, 19 Oct 2025 10:48:37 -0600
Tom Rini <[email protected]> wrote:

On Sun, Oct 19, 2025 at 02:05:51PM +0100, Simon
Glass

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Hi Kory,

On Mon, 13 Oct 2025 at 14:32, Kory Maincent
(TI.com) <[email protected]> wrote:

This series converts the extension board
framework to

use

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

UCLASS as requested by Simon Glass, then adds

extension

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support to pxe_utils and bootmeth_efi (not
tested) to enable extension boards devicetree
load in the

standard

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

boot process.

I can't test the imx8 extension scan enabled
by the imx8mm-cl-iot-gate_defconfig as I don't
have this

board.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I also can't test the efi bootmeth change as I
don't

have

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

such board.

You can test this with sandbox, using one of the

bootmeth

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

tests, perhaps. Let me know if you need help with
this.

But the question is, does the real hardware
platform work before/after this, not does the
sandbox test still work before/after this.

It seems the bootlflow scan is not working on the
sandbox

on next

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

branch. Is this issue known?

Is it fine on master? The next branch will be out of
date

until it

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

re-opens with -rc2 being released (2 weeks from
today).

... out of sync local calendar, 3 weeks from today, not
2.

bootstd test suit is not working on master with the

sandbox_defconfig:

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

https://termbin.com/un0p

Noticeable things are;
test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test: bootdev_test_any: bootdev.c (flat tree) test/boot/bootdev.c:160, bootdev_test_any(): 0 == bootdev_find_by_any(seq, &dev, &mflags): Expected 0x0 (0), got 0xffffffed (-19) Test 'bootdev_test_any' failed 2 times

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

And a nice segfault:
Test: bootflow_set_arg: bootflow.c
Test: bootflow_system: bootflow.c
[3] 569337 segmentation fault (core dumped) ./u-boot

Maybe things are missing to run sandbox_defconfig on my computer? With the sandbox64_defconfig there is not core dump anymore but

there

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

is still the failed line:
Test 'bootdev_test_bootable' failed 2 times

And the uboot is reboot infinitely during the bootflow
test: ./u-boot -T -c "ut bootstd"
https://termbin.com/alu5

I see the same thing you do when running them outside of pytest, but they're also fine within pytest.
https://docs.u-boot.org/en/latest/develop/pytest/usage.html
should

help

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

get you started, and you can just run all of the ut tests under

that.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Weird I got errors also within pytest.
See the html test log attached generated by the following
command: ./test/py/test.py --bd sandbox -k bootstd

Same. There's some implicit dependencies around I believe. Doing "-k

ut"

Quoted 2 lines
Quoted 2 lines

should work, as I tried that (via my wrapper around all this) as well

as

Quoted 26 lines
Quoted 1 line

just running all the tests (which is longer).

That's my understanding as well

In Kory's log we see:

MMC: Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
mmc_probe() mmc1 - probe failed: -1
mmc2: 2 (SD)Can't map file 'mmc1.img': Invalid argument
sandbox_mmc_probe() mmc1: Unable to map file 'mmc1.img'
, mmc0: 0 (SD)

These mmc1.img are needed for the bootstd tests to run properly.

These mmc*.img are generated in test_ut.py (see
setup_cros_image() for example)

So, In order to only run the bootstd tests, I think we need to to run:

    $ ./test/py/test.py --bd sandbox --build -k test_ut
    $ ./test/py/test.py --bd sandbox --build -k bootstd
Quoted 9 lines
Quoted 3 lines

Then we can just call:

    $ ./test/py/test.py --bd sandbox --build -k bootstd      

Ok after installing missing dependencies and running test_ut tests I have less
errors but there are still bootflow errors. See the test-log attached. I suppose all the tests should pass, right?

Quoted 5 lines

How are you running the tests? This is described in the docs. Search for 'tests'.

https://docs.u-boot.org/en/latest/develop/tests_sandbox.html#running-sandbox-tests-directly

As discussed in the email thread running test directly does not work and segfault for the bootflow command.
We have to run it under the test.py command to makes it work.

The log I sent was for the following command:

$ ./test/py/test.py --bd sandbox --build -k test_ut

The two errors on bootflow on master are:
Test: bootflow_cmd_menu: bootflow.c test/boot/bootflow.c:673, bootflow_cmd_menu(): 0 == run_command("bootflow menu", 0): Expected 0x0 (0), got 0x1 (1)

Quoted 6 lines

test/boot/bootflow.c:718, bootflow_scan_menu(): console:
Expected 'Selected: Armbian',

     got '<no-more-output>'

Tom do you face the same errors? If that's the case we should fix these.

Quoted 8 lines

No, I can do:

$ git clean -dfx
$ ./test/py/test.py --bd sandbox --build -k test_ut
And the result is:
=============== 872 passed, 1 skipped, 608 deselected, 13398 warnings in
55.73s ===============

And this is on top of tree master right now.

Quoted 7 lines

Oh ok weird, I just tried again on my side but still got 6 tests that failed. These tests are not related to my series so lets ignore these.

Anyway, I don't see how I can test the extension support in bootmeth efi with sandbox, and it would be better to test it on a real board. Or at least that it does not break bootmeth efi for the current hardware platform.

Quoted 5 lines

Do you have other changes for v3? If not, I'll apply that soon and we can add more tests in a follow-up, if Simon can explain his thinking on how it would work. If you do have changes for v4, same comments about testing apply but I'll move v3 to superseded in patchwork so I don't forget.

Quoted 3 lines

As I said: "I saw that as I removed the extension hunter in this series it brings new test errors that need to be fixed."
I think it is better avoid these CI build test errors and send a v4.

Thanks for clarifying, yes, I missed that at some point in this long thread. :(

Signature · 1 line
Tom