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
31 const char **prefixes;
32 const char **bootdev_order;
33 struct udevice *cur_bootdev;
34 struct bootflow *cur_bootflow;
35 struct list_head glob_head;
37 struct udevice **bootmeth_order;
41 * bootstd_get_bootdev_order() - Get the boot-order list
43 * This reads the boot order, e.g. {"mmc0", "mmc2", NULL}
45 * The list is alloced by the bootstd driver so should not be freed. That is the
46 * reason for all the const stuff in the function signature
48 * Return: list of string points, terminated by NULL; or NULL if no boot order
50 const char *const *const bootstd_get_bootdev_order(struct udevice *dev);
53 * bootstd_get_prefixes() - Get the filename-prefixes list
55 * This reads the prefixes, e.g. {"/", "/bpot", NULL}
57 * The list is alloced by the bootstd driver so should not be freed. That is the
58 * reason for all the const stuff in the function signature
60 * Return: list of string points, terminated by NULL; or NULL if no boot order
62 const char *const *const bootstd_get_prefixes(struct udevice *dev);
65 * bootstd_get_priv() - Get the (single) state for the bootstd system
67 * The state holds a global list of all bootflows that have been found.
69 * Return: 0 if OK, -ve if the uclass does not exist
71 int bootstd_get_priv(struct bootstd_priv **stdp);
74 * bootstd_clear_glob() - Clear the global list of bootflows
76 * This removes all bootflows globally and across all bootdevs.
78 void bootstd_clear_glob(void);