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

Simon Glass sjg at chromium.org
Mon Feb 16 18:19:48 CET 2026


Hi Varadarajan,

On Sun, 15 Feb 2026 at 22:31, Varadarajan Narayanan
<varadarajan.narayanan at oss.qualcomm.com> wrote:
>
> On Fri, Feb 13, 2026 at 01:20:10PM -0700, Simon Glass wrote:
> [ . . . ]
>
> > > > > > 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]
> >
> > Sure, but you are adding a new method, so you could make it take a new
> > struct instead of the string list, still behind your Kconfig option.
>
> Sure.
>
> You want 'request_arg' function pointer to take a structure instead of
> 'char * const argv[]'. Is this understanding correct?
>
> If yes, this string list is what was given in the command line. And is
> passed to the implementation specific handler.
>
>         Command line -> do_reset -> sysreset_walk_arg -> *request_arg
>
> The implementation specific handler can interpret the argv[] as
> applicable to itself. Not sure how to convert/parse this to a struct
> that can be used by EFI app. Am I missing something. Please advice.

Really I'm just trying to have it defined (in the uclass header) what
the behaviour actually is. An arbitrary string list seems too
open-ended, as well as being less efficient.

So I am thinking you can add a struct, define and document the fields
in it and then other people can use the same approach when they hit
this problem. For example, with the existing request() method, we
created an 'enum sysreset_t' to specify the reset type, rather than
using a string arglist. String arglist is good for the cmdline but not
for programmative code.

Regards,
Simon


More information about the U-Boot mailing list