mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
part: Add a function to find the first bootable partition
If a disk has a bootable partition we are expected to use it to locate the boot files. Add a function to find it. To test this, update mmc1 to have two paritions, fixing up other tests accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -93,3 +93,16 @@ static int dm_test_part(struct unit_test_state *uts)
|
||||
return ret;
|
||||
}
|
||||
DM_TEST(dm_test_part, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||
|
||||
static int dm_test_part_bootable(struct unit_test_state *uts)
|
||||
{
|
||||
struct blk_desc *desc;
|
||||
struct udevice *dev;
|
||||
|
||||
ut_assertok(uclass_get_device_by_name(UCLASS_BLK, "mmc1.blk", &dev));
|
||||
desc = dev_get_uclass_plat(dev);
|
||||
ut_asserteq(1, part_get_bootable(desc));
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_part_bootable, UT_TESTF_SCAN_FDT);
|
||||
|
||||
Reference in New Issue
Block a user