[PATCH 09/11] reboot-mode: reboot method activation support

Simon Glass sjg at chromium.org
Fri Jun 26 12:41:51 CEST 2026


Hi Sam,

On 2026-06-06T08:47:32, Sam Day via B4 Relay
<devnull+me.samcday.com at kernel.org> wrote:
> reboot-mode: reboot method activation support
>
> Until now, the reboot-mode uclass didn't wire up a producer path to
> allow arbitrary changes to the reboot mode. The current impl only uses
> reboot_mode_ops->set to clear the reboot mode once it has been read at
> boot-time.
>
> The public API is expanded with a dm_reboot_mode_activate method, which
> will instruct the given device to activate a particular reboot mode.
>
> The first producer, fastboot reboot, will be introduced in the next
> commit.
>
> Signed-off-by: Sam Day <me at samcday.com>
>
> drivers/reboot-mode/reboot-mode-uclass.c | 18 ++++++++++++++++++
>  include/reboot-mode/reboot-mode.h        | 12 ++++++++++++
>  2 files changed, 30 insertions(+)

> diff --git a/include/reboot-mode/reboot-mode.h b/include/reboot-mode/reboot-mode.h
> @@ -53,4 +53,16 @@ struct reboot_mode_ops {
> + * dm_reboot_mode_activate() - activate a reboot mode by name
> + *
> + * This will read the given @dev plat_data for a named mode, and write the
> + * magic value for that mode to the device.
> + *
> + * @dev Device to write reboot magic to
> + * @mode name of the mode to lookup for magic value
> + * Return: 0 on success, -ve on error
> + */
> +int dm_reboot_mode_activate(struct udevice *dev, const char *mode);

Please follow the kernel-doc style used by dm_reboot_mode_update()
just above - @dev: and @mode: with a colon and tab, sentence-cased
descriptions, and 'Return: 0 if OK, -ve on error' to match the rest of
the file.

> diff --git a/drivers/reboot-mode/reboot-mode-uclass.c b/drivers/reboot-mode/reboot-mode-uclass.c
> @@ -9,6 +9,24 @@
> +int dm_reboot_mode_activate(struct udevice *dev, const char *mode)
> +{
> +     struct reboot_mode_ops *ops = reboot_mode_get_ops(dev);
> +     int i;
> +     const struct reboot_mode_uclass_platdata *plat_data =
> +             dev_get_uclass_plat(dev);

Nit: please group the variable declarations - put plat_data next to
ops, with int i at the end, matching dm_reboot_mode_update() style.

Regards,
Simon


More information about the U-Boot mailing list