1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright 2021 Google LLC
6 * Written by Simon Glass <sjg@chromium.org>
16 static int host_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
17 struct bootflow *bflow)
22 return log_msg_ret("max", -ESHUTDOWN);
24 bflow->name = strdup(dev->name);
26 return log_msg_ret("name", -ENOMEM);
28 ret = bootmeth_check(bflow->method, iter);
30 return log_msg_ret("check", ret);
32 bflow->state = BOOTFLOWST_MEDIA;
33 bflow->fs_type = FS_TYPE_SANDBOX;
35 ret = bootmeth_read_bootflow(bflow->method, bflow);
37 return log_msg_ret("method", ret);
42 struct bootdev_ops host_bootdev_ops = {
43 .get_bootflow = host_get_bootflow,
46 static const struct udevice_id host_bootdev_ids[] = {
47 { .compatible = "sandbox,bootdev-host" },
51 U_BOOT_DRIVER(host_bootdev) = {
52 .name = "host_bootdev",
54 .ops = &host_bootdev_ops,
55 .of_match = host_bootdev_ids,