summaryrefslogtreecommitdiff
path: root/test/boot
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-11-03 10:12:05 -0600
committerTom Rini <[email protected]>2025-11-03 10:12:05 -0600
commit9ccda31f54881d3321263a81599454a1d6efb65e (patch)
tree71c250bf67f39df36d05ef55512692132b99fa40 /test/boot
parentc2637036b8f0c90a2cfc59900f7da31eae646b03 (diff)
parente9dc6c12958fc5d909848fc3999e6be5df1cd3ae (diff)
Merge patch series "Convert extension support to UCLASS and adds its support to boot flows"
Kory Maincent (TI.com) <[email protected]> says: 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. Link: https://lore.kernel.org/r/20251030-feature_sysboot_extension_board-v5-0-cfb77672fc68@bootlin.com
Diffstat (limited to 'test/boot')
-rw-r--r--test/boot/bootdev.c32
-rw-r--r--test/boot/bootflow.c6
-rw-r--r--test/boot/bootstd_common.h4
3 files changed, 17 insertions, 25 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index a5f3d4462a9..0820bf10ee0 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -380,7 +380,6 @@ static int bootdev_test_hunter(struct unit_test_state *uts)
ut_assert_nextline("Prio Used Uclass Hunter");
ut_assert_nextlinen("----");
ut_assert_nextline(" 6 ethernet eth_bootdev");
- ut_assert_nextline(" 1 simple_bus (none)");
ut_assert_nextline(" 5 ide ide_bootdev");
ut_assert_nextline(" 2 mmc mmc_bootdev");
ut_assert_nextline(" 4 nvme nvme_bootdev");
@@ -389,15 +388,15 @@ static int bootdev_test_hunter(struct unit_test_state *uts)
ut_assert_nextline(" 4 spi_flash sf_bootdev");
ut_assert_nextline(" 5 usb usb_bootdev");
ut_assert_nextline(" 4 virtio virtio_bootdev");
- ut_assert_nextline("(total hunters: 10)");
+ ut_assert_nextline("(total hunters: 9)");
ut_assert_console_end();
ut_assertok(bootdev_hunt("usb1", false));
ut_assert_skip_to_line("Bus usb@1: 5 USB Device(s) found");
ut_assert_console_end();
- /* USB is 7th in the list, so bit 8 */
- ut_asserteq(BIT(8), std->hunters_used);
+ /* USB is 8th in the list, so bit 7 */
+ ut_asserteq(BIT(7), std->hunters_used);
return 0;
}
@@ -418,7 +417,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
ut_assert_nextline("Prio Used Uclass Hunter");
ut_assert_nextlinen("----");
ut_assert_nextline(" 6 ethernet eth_bootdev");
- ut_assert_skip_to_line("(total hunters: 10)");
+ ut_assert_skip_to_line("(total hunters: 9)");
ut_assert_console_end();
/* Use the MMC hunter and see that it updates */
@@ -426,7 +425,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
ut_assertok(run_command("bootdev hunt -l", 0));
ut_assert_skip_to_line(" 5 ide ide_bootdev");
ut_assert_nextline(" 2 * mmc mmc_bootdev");
- ut_assert_skip_to_line("(total hunters: 10)");
+ ut_assert_skip_to_line("(total hunters: 9)");
ut_assert_console_end();
/* Scan all hunters */
@@ -436,8 +435,6 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
ut_assert_nextline("Hunting with: ethernet");
/* This is the extension feature which has no uclass at present */
- ut_assert_nextline("Hunting with: simple_bus");
- ut_assert_nextline("Found 2 extension board(s).");
ut_assert_nextline("Hunting with: ide");
/* mmc hunter has already been used so should not run again */
@@ -457,7 +454,6 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
ut_assert_nextlinen("Prio");
ut_assert_nextlinen("----");
ut_assert_nextline(" 6 * ethernet eth_bootdev");
- ut_assert_nextline(" 1 * simple_bus (none)");
ut_assert_nextline(" 5 * ide ide_bootdev");
ut_assert_nextline(" 2 * mmc mmc_bootdev");
ut_assert_nextline(" 4 * nvme nvme_bootdev");
@@ -466,7 +462,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
ut_assert_nextline(" 4 * spi_flash sf_bootdev");
ut_assert_nextline(" 5 * usb usb_bootdev");
ut_assert_nextline(" 4 * virtio virtio_bootdev");
- ut_assert_nextline("(total hunters: 10)");
+ ut_assert_nextline("(total hunters: 9)");
ut_assert_console_end();
ut_asserteq(GENMASK(MAX_HUNTER, 0), std->hunters_used);
@@ -490,7 +486,7 @@ static int bootdev_test_hunt_scan(struct unit_test_state *uts)
ut_assertok(bootflow_scan_first(NULL, NULL, &iter,
BOOTFLOWIF_SHOW | BOOTFLOWIF_HUNT |
BOOTFLOWIF_SKIP_GLOBAL, &bflow));
- ut_asserteq(BIT(MMC_HUNTER) | BIT(1), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER), std->hunters_used);
return 0;
}
@@ -650,8 +646,8 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
ut_asserteq_str("scsi.id0lun0.bootdev", dev->name);
ut_asserteq(BOOTFLOW_METHF_SINGLE_UCLASS, mflags);
- /* SCSI is 7th in the list, so bit 6 */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(6), std->hunters_used);
+ /* SCSI is 6th in the list, so bit 5 */
+ ut_asserteq(BIT(MMC_HUNTER) | BIT(5), std->hunters_used);
ut_assertok(bootdev_next_label(&iter, &dev, &mflags));
ut_assert_console_end();
@@ -661,7 +657,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
mflags);
/* dhcp: Ethernet is first so bit 0 */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
ut_assertok(bootdev_next_label(&iter, &dev, &mflags));
ut_assert_console_end();
@@ -671,7 +667,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
mflags);
/* pxe: Ethernet is first so bit 0 */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
mflags = 123;
ut_asserteq(-ENODEV, bootdev_next_label(&iter, &dev, &mflags));
@@ -679,7 +675,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
ut_assert_console_end();
/* no change */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
return 0;
}
@@ -724,12 +720,10 @@ static int bootdev_test_next_prio(struct unit_test_state *uts)
ut_assertok(bootdev_next_prio(&iter, &dev));
ut_asserteq_str("mmc2.bootdev", dev->name);
- ut_assert_nextline("Hunting with: simple_bus");
- ut_assert_nextline("Found 2 extension board(s).");
ut_assert_nextline("Hunting with: mmc");
ut_assert_console_end();
- ut_asserteq(BIT(MMC_HUNTER) | BIT(1), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER), std->hunters_used);
ut_assertok(bootdev_next_prio(&iter, &dev));
ut_asserteq_str("mmc1.bootdev", dev->name);
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index cc5eed75d83..a56435d053f 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -861,7 +861,7 @@ static int bootflow_cmd_hunt_single(struct unit_test_state *uts)
ut_assert_console_end();
/* check that the hunter was used */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(1), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER), std->hunters_used);
return 0;
}
@@ -883,14 +883,12 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts)
ut_assertok(run_command("bootflow scan -l mmc", 0));
/* check that the hunter was used */
- ut_asserteq(BIT(MMC_HUNTER) | BIT(1), std->hunters_used);
+ ut_asserteq(BIT(MMC_HUNTER), std->hunters_used);
/* check that we got the mmc1 bootflow */
ut_assert_nextline("Scanning for bootflows with label 'mmc'");
ut_assert_nextlinen("Seq");
ut_assert_nextlinen("---");
- ut_assert_nextline("Hunting with: simple_bus");
- ut_assert_nextline("Found 2 extension board(s).");
ut_assert_nextline("Hunting with: mmc");
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
diff --git a/test/boot/bootstd_common.h b/test/boot/bootstd_common.h
index c61698adc02..dd769313a84 100644
--- a/test/boot/bootstd_common.h
+++ b/test/boot/bootstd_common.h
@@ -21,8 +21,8 @@
#define TEST_VERNUM 0x00010002
enum {
- MAX_HUNTER = 9,
- MMC_HUNTER = 3, /* ID of MMC hunter */
+ MAX_HUNTER = 8,
+ MMC_HUNTER = 2, /* ID of MMC hunter */
};
struct unit_test_state;