bootstd: Drop the system bootdev
This was a work-around for the fact that global bootmeths such as EFI bootmgr and VBE don't use a particular bootdev, or at least select it themselves so that we don't need to scan all bootdevs when using that bootmeth. Drop the system bootdev entirely. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
bd18b69de1
commit
2ff5490d7d
@ -18,7 +18,7 @@ obj-y += image.o image-board.o
|
|||||||
obj-$(CONFIG_ANDROID_AB) += android_ab.o
|
obj-$(CONFIG_ANDROID_AB) += android_ab.o
|
||||||
obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o
|
obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o
|
||||||
|
|
||||||
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootdev-uclass.o system_bootdev.o
|
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootdev-uclass.o
|
||||||
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o
|
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o
|
||||||
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o
|
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o
|
||||||
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o
|
obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o
|
||||||
|
@ -145,12 +145,6 @@ int dm_scan_other(bool pre_reloc_only)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the system bootdev too */
|
|
||||||
ret = device_bind_driver(bootstd, "system_bootdev", "system-bootdev",
|
|
||||||
&dev);
|
|
||||||
if (ret)
|
|
||||||
return log_msg_ret("sys", ret);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0+
|
|
||||||
/*
|
|
||||||
* Bootdevice for system, used for bootmeths not tied to any partition device
|
|
||||||
*
|
|
||||||
* Copyright 2021 Google LLC
|
|
||||||
* Written by Simon Glass <sjg@chromium.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LOG_CATEGORY UCLASS_BOOTSTD
|
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <bootdev.h>
|
|
||||||
#include <bootflow.h>
|
|
||||||
#include <bootmeth.h>
|
|
||||||
#include <command.h>
|
|
||||||
#include <distro.h>
|
|
||||||
#include <dm.h>
|
|
||||||
#include <log.h>
|
|
||||||
#include <net.h>
|
|
||||||
|
|
||||||
static int system_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
|
|
||||||
struct bootflow *bflow)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Must be an bootstd device */
|
|
||||||
ret = bootflow_iter_uses_system(iter);
|
|
||||||
if (ret)
|
|
||||||
return log_msg_ret("net", ret);
|
|
||||||
|
|
||||||
ret = bootmeth_check(bflow->method, iter);
|
|
||||||
if (ret)
|
|
||||||
return log_msg_ret("check", ret);
|
|
||||||
|
|
||||||
ret = bootmeth_read_bootflow(bflow->method, bflow);
|
|
||||||
if (ret)
|
|
||||||
return log_msg_ret("method", ret);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int system_bootdev_bind(struct udevice *dev)
|
|
||||||
{
|
|
||||||
struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
|
|
||||||
|
|
||||||
ucp->prio = BOOTDEVP_6_SYSTEM;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct bootdev_ops system_bootdev_ops = {
|
|
||||||
.get_bootflow = system_get_bootflow,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct udevice_id system_bootdev_ids[] = {
|
|
||||||
{ .compatible = "u-boot,bootdev-system" },
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
U_BOOT_DRIVER(system_bootdev) = {
|
|
||||||
.name = "system_bootdev",
|
|
||||||
.id = UCLASS_BOOTDEV,
|
|
||||||
.ops = &system_bootdev_ops,
|
|
||||||
.bind = system_bootdev_bind,
|
|
||||||
.of_match = system_bootdev_ids,
|
|
||||||
};
|
|
@ -12,7 +12,6 @@
|
|||||||
#include <bootstd.h>
|
#include <bootstd.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <asm/test.h>
|
#include <asm/test.h>
|
||||||
#include <dm/device-internal.h>
|
|
||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
#include <test/suites.h>
|
#include <test/suites.h>
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
@ -337,7 +336,7 @@ static int bootflow_system(struct unit_test_state *uts)
|
|||||||
ut_assert_skip_to_line(
|
ut_assert_skip_to_line(
|
||||||
" 0 efi_mgr ready (none) 0 <NULL> <NULL>");
|
" 0 efi_mgr ready (none) 0 <NULL> <NULL>");
|
||||||
ut_assert_skip_to_line("No more bootdevs");
|
ut_assert_skip_to_line("No more bootdevs");
|
||||||
ut_assert_skip_to_line("(6 bootflows, 6 valid)");
|
ut_assert_skip_to_line("(5 bootflows, 5 valid)");
|
||||||
ut_assert_console_end();
|
ut_assert_console_end();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -358,10 +357,6 @@ static int bootflow_iter_disable(struct unit_test_state *uts)
|
|||||||
ut_assertok(device_bind_driver(bootstd, "bootmeth_sandbox", "sandbox",
|
ut_assertok(device_bind_driver(bootstd, "bootmeth_sandbox", "sandbox",
|
||||||
&dev));
|
&dev));
|
||||||
|
|
||||||
/* Add the system bootdev that it uses */
|
|
||||||
ut_assertok(device_bind_driver(bootstd, "system_bootdev",
|
|
||||||
"system-bootdev", &dev));
|
|
||||||
|
|
||||||
ut_assertok(bootstd_test_drop_bootdev_order(uts));
|
ut_assertok(bootstd_test_drop_bootdev_order(uts));
|
||||||
|
|
||||||
bootstd_clear_glob();
|
bootstd_clear_glob();
|
||||||
|
Loading…
Reference in New Issue
Block a user