1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Verified Boot for Embedded (VBE) vbe-simple common file
5 * Copyright 2022 Google LLC
10 #define __VBE_SIMPLE_H
13 MAX_VERSION_LEN = 256,
15 NVD_HDR_VER_SHIFT = 0,
16 NVD_HDR_VER_MASK = 0xf,
17 NVD_HDR_SIZE_SHIFT = 4,
18 NVD_HDR_SIZE_MASK = 0xf << NVD_HDR_SIZE_SHIFT,
20 /* Firmware key-version is in the top 16 bits of fw_ver */
22 FWVER_FW_MASK = 0xffff,
24 NVD_HDR_VER_CUR = 1, /* current version */
27 /** struct simple_priv - information read from the device tree */
39 /** struct simple_state - state information read from media
41 * @fw_version: Firmware version string
42 * @fw_vernum: Firmware version number
45 char fw_version[MAX_VERSION_LEN];
50 * vbe_simple_read_fw_bootflow() - Read a bootflow for firmware
52 * Locates and loads the firmware image (FIT) needed for the next phase. The FIT
53 * should ideally use external data, to reduce the amount of it that needs to be
56 * @bdev: bootdev device containing the firmwre
57 * @blow: Place to put the created bootflow, on success
58 * @return 0 if OK, -ve on error
60 int vbe_simple_read_bootflow_fw(struct udevice *dev, struct bootflow *bflow);
63 * vbe_simple_read_state() - Read the VBE simple state information
66 * @state: Place to put the state
67 * @return 0 if OK, -ve on error
69 int vbe_simple_read_state(struct udevice *dev, struct simple_state *state);
71 #endif /* __VBE_SIMPLE_H */