[PATCH v6 2/5] drivers: sysreset: Add sysreset op that can take arguments

Varadarajan Narayanan varadarajan.narayanan at oss.qualcomm.com
Fri Feb 13 10:42:12 CET 2026


On Wed, Feb 04, 2026 at 01:23:05PM +1300, Simon Glass wrote:
> Hi Varadarajan,
>
> On Tue, 27 Jan 2026 at 17:18, Varadarajan Narayanan
> <varadarajan.narayanan at oss.qualcomm.com> wrote:
> >
> > On Mon, Jan 26, 2026 at 06:15:34PM +1300, Simon Glass wrote:
> > > Hi,
> > >
> > > On Wed, 21 Jan 2026 at 19:39, Varadarajan Narayanan
> > > <varadarajan.narayanan at oss.qualcomm.com> wrote:
> > > >
> > > > Add a 'request_arg' op to struct sysreset_ops to enable sysreset drivers
> > > > to receive arguments given to the 'reset' command. Process the
> > > > request_arg() op before the usual request() op.
> > > >
> > > > Reviewed-by: Casey Connolly <casey.connolly at linaro.org>
> > > > Reviewed-by: Sumit Garg <sumit.garg at oss.qualcomm.com>
> > > > Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan at oss.qualcomm.com>
> > > > ---
> > > > v6: Wrap this functionality inside CONFIG_SYSRESET_CMD_RESET_ARGS
> > > > ---
> > > >  drivers/sysreset/Kconfig           |  8 +++++++
> > > >  drivers/sysreset/sysreset-uclass.c | 37 ++++++++++++++++++++++++++++++
> > > >  include/sysreset.h                 | 18 +++++++++++++++
> > > >  3 files changed, 63 insertions(+)
> > > >
> > > > diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> > > > index 0181f6cd581..6fb0ca81dc6 100644
> > > > --- a/drivers/sysreset/Kconfig
> > > > +++ b/drivers/sysreset/Kconfig
> > > > @@ -49,6 +49,14 @@ config SYSRESET_CMD_RESET
> > > >         help
> > > >           Enable sysreset implementation of the reset command.
> > > >
> > > > +config SYSRESET_CMD_RESET_ARGS
> > > > +       bool "Enable reset command to take arguments"
> > > > +       help
> > > > +         Pass on the arguments received by the 'reset' command to the
> > > > +         sysreset driver(s). The sysreset driver(s) may make use of the
> > > > +         additional arguments for implementing arch/board specific
> > > > +         functionality.
> > > > +
> > >
> > > I haven't been following this, but what sort of args are you planning to pass?
> >
> > As of now, an argument to indicate reboot to emergency download mode.
>
> So how about adding a struct in sysreset.h where you can include a
> flag word and create a single flag for your case? We should be able to
> handle reset without the cmdline being enabled.
>
> There are other cases where this would be useful, e.g. an EFI app
> rebooting into setup boot.

Previously, i.e. v5 [1] didn't have SYSRESET_CMD_RESET_ARGS config
option. This was added to avoid bloat code size for platforms that will
not need this. Please see [2]

Thanks
Varada

1 - https://lore.kernel.org/u-boot/20260113103840.1948029-3-varadarajan.narayanan@oss.qualcomm.com/
2 - https://lore.kernel.org/u-boot/20260119170701.GD3416603@bill-the-cat/


More information about the U-Boot mailing list