diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bootdev.h | 15 | ||||
-rw-r--r-- | include/bootflow.h | 15 |
2 files changed, 26 insertions, 4 deletions
diff --git a/include/bootdev.h b/include/bootdev.h index deef7890489..db03c5c032e 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -222,19 +222,26 @@ int bootdev_next_bootflow(struct bootflow **bflowp); * @label: Label to look up (e.g. "mmc1" or "mmc0") * @devp: Returns the bootdev device found, or NULL if none (note it does not * return the media device, but its bootdev child) + * @method_flagsp: If non-NULL, returns any flags implied by the label + * (enum bootflow_meth_flags_t), 0 if none. Unset if function fails * Return: 0 if OK, -EINVAL if the uclass is not supported by this board, - * -ENOENT if there is no device with that number + * -ENOENT if there is no device with that number */ -int bootdev_find_by_label(const char *label, struct udevice **devp); +int bootdev_find_by_label(const char *label, struct udevice **devp, + int *method_flagsp); /** * bootdev_find_by_any() - Find a bootdev by name, label or sequence * * @name: name (e.g. "mmc2.bootdev"), label ("mmc2"), or sequence ("2") to find * @devp: returns the device found, on success - * Return: 0 if OK, -ve on error + * @method_flagsp: If non-NULL, returns any flags implied by the label + * (enum bootflow_meth_flags_t), 0 if none. Unset if function fails + * Return: 0 if OK, -EINVAL if the uclass is not supported by this board, + * -ENOENT if there is no device with that number */ -int bootdev_find_by_any(const char *name, struct udevice **devp); +int bootdev_find_by_any(const char *name, struct udevice **devp, + int *method_flagsp); /** * bootdev_setup_iter_order() - Set up the ordering of bootdevs to scan diff --git a/include/bootflow.h b/include/bootflow.h index 319dda8e0be..9c6610bb922 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -105,6 +105,21 @@ enum bootflow_flags_t { }; /** + * enum bootflow_meth_flags_t - flags controlling which bootmeths are used + * + * Used during iteration, e.g. by bootdev_find_by_label(), to determine which + * bootmeths are used for the current bootdev. The flags reset when the bootdev + * changes + * + * @BOOTFLOW_METHF_DHCP_ONLY: Only use dhcp (scripts and EFI) + * @BOOTFLOW_METHF_PXE_ONLY: Only use pxe (PXE boot) + */ +enum bootflow_meth_flags_t { + BOOTFLOW_METHF_DHCP_ONLY = 1 << 0, + BOOTFLOW_METHF_PXE_ONLY = 1 << 1, +}; + +/** * struct bootflow_iter - state for iterating through bootflows * * This starts at with the first bootdev/partition/bootmeth and can be used to |