bootstd: Support running bootdev hunters

Add a way to run a bootdev hunter to find bootdevs of a certain type. Add
this to the 'bootdev hunt' command. Test for this are added in a later
patch, since a useful test needs some hunters to work with.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-01-17 10:47:34 -07:00 committed by Tom Rini
parent bd90b09288
commit c7b63d500d
4 changed files with 84 additions and 1 deletions

View file

@ -263,6 +263,20 @@ int bootdev_setup_iter_order(struct bootflow_iter *iter, struct udevice **devp);
*/
void bootdev_list_hunters(struct bootstd_priv *std);
/**
* bootdev_hunt() - Hunt for bootdevs matching a particular spec
*
* This runs the selected hunter (or all if @spec is NULL) to try to find new
* bootdevs.
*
* @spec: Spec to match, e.g. "mmc0", or NULL for any. If provided, this must
* match a uclass name so that the hunter can be determined. Any trailing number
* is ignored
* @show: true to show each hunter before using it
* Returns: 0 if OK, -ve on error
*/
int bootdev_hunt(const char *spec, bool show);
#if CONFIG_IS_ENABLED(BOOTSTD)
/**
* bootdev_setup_for_dev() - Bind a new bootdev device (deprecated)