summaryrefslogtreecommitdiff
path: root/boot/vbe_common.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-02-03 16:01:44 -0600
committerTom Rini <trini@konsulko.com>2025-02-03 16:01:44 -0600
commit3e69c75e86e1c32c8c0fd6153bcc10aa00fb3616 (patch)
tree676898552baf386cc0c4119ee4bf7edc1ba8aee0 /boot/vbe_common.h
parent752321b62530dcbd6e8b5872aff4cf761809d76b (diff)
parentf1eb367d76c9b28053b3adcb6bdeb865c6eda5fd (diff)
Merge patch series "vbe: Series part G"
Simon Glass <sjg@chromium.org> says: This includes the VBE ABrec (A/B/recovery) implementation as well as a number of patches needed to make it work: - marking some code as used by SPL_RELOC - selection of images from a FIT based on the boot phase - removal of unwanted hash code which increases code-size too much - a few Kconfig-related additions for VPL Note: The goal for the next series (part H) is to enable VBE on rk3399-generic, i.e. able to boot on multiple rk3399-based boards with only the TPL phase being different for each board. Link: https://lore.kernel.org/r/20250126184333.4058848-1-sjg@chromium.org/
Diffstat (limited to 'boot/vbe_common.h')
-rw-r--r--boot/vbe_common.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/boot/vbe_common.h b/boot/vbe_common.h
index 84117815a19..493cbdc3694 100644
--- a/boot/vbe_common.h
+++ b/boot/vbe_common.h
@@ -9,6 +9,8 @@
#ifndef __VBE_COMMON_H
#define __VBE_COMMON_H
+#include <dm/ofnode_decl.h>
+#include <linux/bitops.h>
#include <linux/types.h>
struct spl_image_info;
@@ -39,6 +41,40 @@ enum {
};
/**
+ * enum vbe_try_result - result of trying a firmware pick
+ *
+ * @VBETR_UNKNOWN: Unknown / invalid result
+ * @VBETR_TRYING: Firmware pick is being tried
+ * @VBETR_OK: Firmware pick is OK and can be used from now on
+ * @VBETR_BAD: Firmware pick is bad and should be removed
+ */
+enum vbe_try_result {
+ VBETR_UNKNOWN,
+ VBETR_TRYING,
+ VBETR_OK,
+ VBETR_BAD,
+};
+
+/**
+ * enum vbe_flags - flags controlling operation
+ *
+ * @VBEF_TRY_COUNT_MASK: mask for the 'try count' value
+ * @VBEF_TRY_B: Try the B slot
+ * @VBEF_RECOVERY: Use recovery slot
+ */
+enum vbe_flags {
+ VBEF_TRY_COUNT_MASK = 0x3,
+ VBEF_TRY_B = BIT(2),
+ VBEF_RECOVERY = BIT(3),
+
+ VBEF_RESULT_SHIFT = 4,
+ VBEF_RESULT_MASK = 3 << VBEF_RESULT_SHIFT,
+
+ VBEF_PICK_SHIFT = 6,
+ VBEF_PICK_MASK = 3 << VBEF_PICK_SHIFT,
+};
+
+/**
* struct vbe_nvdata - basic storage format for non-volatile data
*
* This is used for all VBE methods
@@ -134,4 +170,11 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size,
struct spl_image_info *image, ulong *load_addrp, ulong *lenp,
char **namep);
+/**
+ * vbe_get_node() - Get the node containing the VBE settings
+ *
+ * Return: VBE node (typically "/bootstd/firmware0")
+ */
+ofnode vbe_get_node(void);
+
#endif /* __VBE_ABREC_H */