1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Standard U-Boot boot framework
5 * Copyright 2021 Google LLC
6 * Written by Simon Glass <sjg@chromium.org>
15 * struct bootstd_priv - priv data for the bootstd driver
17 * This is attached to the (only) bootstd device, so there is only one instance
18 * of this struct. It provides overall information about bootdevs and bootflows.
20 * @prefixes: NULL-terminated list of prefixes to use for bootflow filenames,
21 * e.g. "/", "/boot/"; NULL if none
22 * @bootdev_order: Order to use for bootdevs (or NULL if none), with each item
23 * being a bootdev label, e.g. "mmc2", "mmc1";
24 * @cur_bootdev: Currently selected bootdev (for commands)
25 * @cur_bootflow: Currently selected bootflow (for commands)
26 * @glob_head: Head for the global list of all bootflows across all bootdevs
27 * @bootmeth_count: Number of bootmeth devices in @bootmeth_order
28 * @bootmeth_order: List of bootmeth devices to use, in order, NULL-terminated
29 * @vbe_bootmeth: Currently selected VBE bootmeth, NULL if none
32 const char **prefixes;
33 const char **bootdev_order;
34 struct udevice *cur_bootdev;
35 struct bootflow *cur_bootflow;
36 struct list_head glob_head;
38 struct udevice **bootmeth_order;
39 struct udevice *vbe_bootmeth;
43 * bootstd_get_bootdev_order() - Get the boot-order list
45 * This reads the boot order, e.g. {"mmc0", "mmc2", NULL}
47 * The list is alloced by the bootstd driver so should not be freed. That is the
48 * reason for all the const stuff in the function signature
50 * Return: list of string points, terminated by NULL; or NULL if no boot order
52 const char *const *const bootstd_get_bootdev_order(struct udevice *dev);
55 * bootstd_get_prefixes() - Get the filename-prefixes list
57 * This reads the prefixes, e.g. {"/", "/bpot", NULL}
59 * The list is alloced by the bootstd driver so should not be freed. That is the
60 * reason for all the const stuff in the function signature
62 * Return: list of string points, terminated by NULL; or NULL if no boot order
64 const char *const *const bootstd_get_prefixes(struct udevice *dev);
67 * bootstd_get_priv() - Get the (single) state for the bootstd system
69 * The state holds a global list of all bootflows that have been found.
71 * Return: 0 if OK, -ve if the uclass does not exist
73 int bootstd_get_priv(struct bootstd_priv **stdp);
76 * bootstd_clear_glob() - Clear the global list of bootflows
78 * This removes all bootflows globally and across all bootdevs.
80 void bootstd_clear_glob(void);