1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Verified Boot for Embedded (VBE) support
4 * See doc/develop/vbe.rst
6 * Copyright 2022 Google LLC
7 * Written by Simon Glass <sjg@chromium.org>
14 * enum vbe_phase_t - current phase of VBE
16 * VBE operates in two distinct phases. In VPL it has to choose which firmware
17 * to run (SPL, U-Boot, OP-TEE, etc.). It then carries on running until it gets
18 * to U-Boot, where it decides which OS to run
20 * @VBE_PHASE_FIRMWARE: Selecting the firmware to run
21 * @VBE_PHASE_OS: Selecting the Operating System to run
29 * struct vbe_handoff - information about VBE progress
31 * @phases: Indicates which phases used the VBE bootmeth (1 << PHASE_...)
38 * vbe_phase() - get current VBE phase
40 * Returns: Current VBE phase
42 static inline enum vbe_phase_t vbe_phase(void)
44 if (IS_ENABLED(CONFIG_SPL_BUILD))
45 return VBE_PHASE_FIRMWARE;
51 * vbe_list() - List the VBE bootmeths
53 * This shows a list of the VBE bootmeth devices
60 * vbe_find_by_any() - Find a VBE bootmeth by name or sequence
62 * @name: name (e.g. "vbe-simple"), or sequence ("2") to find
63 * @devp: returns the device found, on success
64 * Return: 0 if OK, -ve on error
66 int vbe_find_by_any(const char *name, struct udevice **devp);
69 * vbe_find_first_device() - Find the first VBE bootmeth
71 * @devp: Returns first available VBE bootmeth, or NULL if none
74 int vbe_find_first_device(struct udevice **devp);
77 * vbe_find_next_device() - Find the next available VBE bootmeth
79 * @devp: Previous device to start from. Returns next available VBE bootmeth,
83 int vbe_find_next_device(struct udevice **devp);