summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Mukhin <[email protected]>2026-06-23 15:06:30 -0700
committerTom Rini <[email protected]>2026-07-03 10:14:25 -0600
commit93e9af685fefc454580dcf567b03c139a2fe8ebc (patch)
tree5c341a5b2908aab52ace915bde5b60ebdbe922d0 /include
parent264ba13f14767fbe7a881d25167d305fa5d7f6b6 (diff)
test: bootdev: scan with a broken high-priority device
Add bootdev_hunt_fallthrough() test to verify that 'bootflow scan -l' falls back to a lower-priority bootdev when a higher-priority hunter fails. Introduce a simple 'sandbox-bootdev' device for the test. The new bootdev can be configured to produce an error at the hunting stage. Introduce new host_set_flags_by_label() API and a flags field to 'host_sb_plat' to simulate a bootdev hunter failure for the test. Adjust boot{dev,flow} tests which depend on bootdev hunters. Signed-off-by: Denis Mukhin <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sandbox_host.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/sandbox_host.h b/include/sandbox_host.h
index f7a5fc67230..1330358ef7a 100644
--- a/include/sandbox_host.h
+++ b/include/sandbox_host.h
@@ -9,16 +9,25 @@
#define __SANDBOX_HOST__
/**
+ * Device flags.
+ */
+enum host_platform_flags {
+ HOST_FLAG_BROKEN = BIT(0), /** Simulate broken device */
+};
+
+/**
* struct host_sb_plat - platform data for a host device
*
* @label: Label for this device (allocated)
* @filename: Name of file this is attached to, or NULL (allocated)
* @fd: File descriptor of file, or 0 for none (file is not open)
+ * @flags: Device flags (e.g. for unit tests).
*/
struct host_sb_plat {
char *label;
char *filename;
int fd;
+ unsigned int flags;
};
/**
@@ -122,4 +131,13 @@ struct udevice *host_get_cur_dev(void);
*/
void host_set_cur_dev(struct udevice *dev);
+/**
+ * host_set_flags_by_label() - Set the host device test flags
+ *
+ * @label: Label of the attachment, e.g. "test1"
+ * @flags: Device flags
+ * Returns: 0 if OK, -ve on error
+ */
+int host_set_flags_by_label(const char *label, unsigned int flags);
+
#endif /* __SANDBOX_HOST__ */