summaryrefslogtreecommitdiff
path: root/boot/vbe_simple.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-20 18:23:11 -0600
committerTom Rini <trini@konsulko.com>2022-10-31 11:03:36 -0400
commitc263e21bcb01f19e6ccb2452fdcc601ff84942db (patch)
tree67e9eccea2682287fe43b33d8ca801e3f939d279 /boot/vbe_simple.h
parentd2b22ae23196604fda88e1ad9ec9f0e8fd285d07 (diff)
vbe: Move OS implementation into a separate file
Move this into its own file so it can be built only by U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/vbe_simple.h')
-rw-r--r--boot/vbe_simple.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/boot/vbe_simple.h b/boot/vbe_simple.h
index e37a9fae37..56d319206f 100644
--- a/boot/vbe_simple.h
+++ b/boot/vbe_simple.h
@@ -9,6 +9,21 @@
#ifndef __VBE_SIMPLE_H
#define __VBE_SIMPLE_H
+enum {
+ MAX_VERSION_LEN = 256,
+
+ NVD_HDR_VER_SHIFT = 0,
+ NVD_HDR_VER_MASK = 0xf,
+ NVD_HDR_SIZE_SHIFT = 4,
+ NVD_HDR_SIZE_MASK = 0xf << NVD_HDR_SIZE_SHIFT,
+
+ /* Firmware key-version is in the top 16 bits of fw_ver */
+ FWVER_KEY_SHIFT = 16,
+ FWVER_FW_MASK = 0xffff,
+
+ NVD_HDR_VER_CUR = 1, /* current version */
+};
+
/** struct simple_priv - information read from the device tree */
struct simple_priv {
u32 area_start;
@@ -21,6 +36,16 @@ struct simple_priv {
const char *storage;
};
+/** struct simple_state - state information read from media
+ *
+ * @fw_version: Firmware version string
+ * @fw_vernum: Firmware version number
+ */
+struct simple_state {
+ char fw_version[MAX_VERSION_LEN];
+ u32 fw_vernum;
+};
+
/**
* vbe_simple_read_fw_bootflow() - Read a bootflow for firmware
*
@@ -34,4 +59,13 @@ struct simple_priv {
*/
int vbe_simple_read_bootflow_fw(struct udevice *dev, struct bootflow *bflow);
+/**
+ * vbe_simple_read_state() - Read the VBE simple state information
+ *
+ * @dev: VBE bootmeth
+ * @state: Place to put the state
+ * @return 0 if OK, -ve on error
+ */
+int vbe_simple_read_state(struct udevice *dev, struct simple_state *state);
+
#endif /* __VBE_SIMPLE_H */