diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 10:48:03 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-23 18:11:41 -0500 |
commit | 0c1f4a9fb13a54780f550d6e5bc4cd37a58f879e (patch) | |
tree | 0195ba57f94d4fca102bf5677d494f2727aa9fe6 /test/boot/bootdev.c | |
parent | 081bdc52c158dd3a4f73910cde3d7e70a5932d56 (diff) |
bootstd: Add a SPI flash bootdev
Add a bootdev for SPI flash so that these devices can be used with
standard boot. It only supports loading a script.
Add a special case for the label, since we want to use "spi", not
"spi_flash".
Enable the new bootdev on sandbox.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/boot/bootdev.c')
-rw-r--r-- | test/boot/bootdev.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index 2ad31a0ef66..ea0703fa5c8 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -243,9 +243,10 @@ static int bootdev_test_hunter(struct unit_test_state *uts) ut_assert_nextline(" 10 mmc mmc_bootdev"); ut_assert_nextline(" 30 nvme nvme_bootdev"); ut_assert_nextline(" 30 scsi scsi_bootdev"); + ut_assert_nextline(" 30 spi_flash sf_bootdev"); ut_assert_nextline(" 40 usb usb_bootdev"); ut_assert_nextline(" 30 virtio virtio_bootdev"); - ut_assert_nextline("(total hunters: 7)"); + ut_assert_nextline("(total hunters: 8)"); ut_assert_console_end(); ut_assertok(bootdev_hunt("usb1", false)); @@ -253,8 +254,8 @@ static int bootdev_test_hunter(struct unit_test_state *uts) "Bus usb@1: scanning bus usb@1 for devices... 5 USB Device(s) found"); ut_assert_console_end(); - /* USB is fifth in the list, so bit 5 */ - ut_asserteq(BIT(5), std->hunters_used); + /* USB is fifth in the list, so bit 6 */ + ut_asserteq(BIT(6), std->hunters_used); return 0; } @@ -274,7 +275,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) ut_assertok(run_command("bootdev hunt -l", 0)); ut_assert_nextline("Prio Used Uclass Hunter"); ut_assert_nextlinen("----"); - ut_assert_skip_to_line("(total hunters: 7)"); + ut_assert_skip_to_line("(total hunters: 8)"); ut_assert_console_end(); /* Scan all hunters */ @@ -288,10 +289,11 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) ut_assert_nextline("Hunting with: nvme"); ut_assert_nextline("Hunting with: scsi"); ut_assert_nextline("scanning bus for devices..."); - ut_assert_skip_to_line("Hunting with: usb"); + ut_assert_skip_to_line("Hunting with: spi_flash"); + ut_assert_nextline("Hunting with: usb"); ut_assert_nextline( "Bus usb@1: scanning bus usb@1 for devices... 5 USB Device(s) found"); - ut_assert_skip_to_line("Hunting with: virtio"); + ut_assert_nextline("Hunting with: virtio"); ut_assert_console_end(); /* List available hunters */ @@ -303,12 +305,13 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) ut_assert_nextline(" 10 * mmc mmc_bootdev"); ut_assert_nextline(" 30 * nvme nvme_bootdev"); ut_assert_nextline(" 30 * scsi scsi_bootdev"); + ut_assert_nextline(" 30 * spi_flash sf_bootdev"); ut_assert_nextline(" 40 * usb usb_bootdev"); ut_assert_nextline(" 30 * virtio virtio_bootdev"); - ut_assert_nextline("(total hunters: 7)"); + ut_assert_nextline("(total hunters: 8)"); ut_assert_console_end(); - ut_asserteq(GENMASK(6, 0), std->hunters_used); + ut_asserteq(GENMASK(7, 0), std->hunters_used); return 0; } |