1 // SPDX-License-Identifier: GPL-2.0+
3 * Bootdev for sandbox host
5 * Copyright 2021 Google LLC
6 * Written by Simon Glass <sjg@chromium.org>
15 static int host_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
16 struct bootflow *bflow)
21 return log_msg_ret("max", -ESHUTDOWN);
23 bflow->name = strdup(dev->name);
25 return log_msg_ret("name", -ENOMEM);
27 ret = bootmeth_check(bflow->method, iter);
29 return log_msg_ret("check", ret);
31 bflow->state = BOOTFLOWST_MEDIA;
32 bflow->fs_type = FS_TYPE_SANDBOX;
34 ret = bootmeth_read_bootflow(bflow->method, bflow);
36 return log_msg_ret("method", ret);
41 struct bootdev_ops host_bootdev_ops = {
42 .get_bootflow = host_get_bootflow,
45 static const struct udevice_id host_bootdev_ids[] = {
46 { .compatible = "sandbox,bootdev-host" },
50 U_BOOT_DRIVER(host_bootdev) = {
51 .name = "host_bootdev",
53 .ops = &host_bootdev_ops,
54 .of_match = host_bootdev_ids,