U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
To: Simon Glass <sjg@chromium.org>
Cc: trini@konsulko.com, casey.connolly@linaro.org,
	neil.armstrong@linaro.org,  sumit.garg@kernel.org,
	jerome@forissier.org, marek.vasut+renesas@mailbox.org,
	ilias.apalodimas@linaro.org, me@samcday.com,
	aswin.murugan@oss.qualcomm.com, clamor95@gmail.com,
	michal.simek@amd.com, u-boot@lists.denx.de,
	u-boot-qcom@groups.io, Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: Re: [PATCH v6 2/5] drivers: sysreset: Add sysreset op that can take arguments
Date: Tue, 17 Feb 2026 09:54:35 +0530	[thread overview]
Message-ID: <aZPtg7dllBavk/a9@hu-varada-blr.qualcomm.com> (raw)
In-Reply-To: <CAFLszTjB5OsdDRbSg7nduFtxzUT0jesvA7+dtU+op=YwfV+jqg@mail.gmail.com>

On Mon, Feb 16, 2026 at 10:19:48AM -0700, Simon Glass wrote:
> Hi Varadarajan,
>
> On Sun, 15 Feb 2026 at 22:31, Varadarajan Narayanan
> <varadarajan.narayanan@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.

As I understand, sysreset_t has a bunch of reset modes that is
applicable to majority of the SoCs. However, this string approach is
to accomodate situations where we don't know what the possibilities are.

> String arglist is good for the cmdline but not for programmative code.

I'm not very familiar with EFI and EFI apps. Can't an EFI app use the
efi_reset_system_boottime() API with reset type as
EFI_RESET_PLATFORM_SPECIFIC? Presently, efi_reset_system_boottime()
invokes do_reset() with argc and argv as 0 and NULL respectively.

Instead, 'void *reset_data' can be cast to a struct that has int argc
and char *argv[] in efi_reset_system_boottime() and pass those values to
do_reset instead of 0 and NULL. Wouldn't this be usable for
programmative code?

Thanks
-Varada

  reply	other threads:[~2026-02-17  4:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  6:39 [PATCH v6 0/5] Implement reset to EDL for qcs9100 Varadarajan Narayanan
2026-01-21  6:39 ` [PATCH v6 1/5] arm: psci: Add API to check for support of specific PSCI function Varadarajan Narayanan
2026-01-21  6:39 ` [PATCH v6 2/5] drivers: sysreset: Add sysreset op that can take arguments Varadarajan Narayanan
2026-01-21 14:57   ` Tom Rini
2026-01-26  5:15   ` Simon Glass
2026-01-27  4:18     ` Varadarajan Narayanan
2026-02-04  0:23       ` Simon Glass
2026-02-13  9:42         ` Varadarajan Narayanan
2026-02-13 20:20           ` Simon Glass
2026-02-16  5:31             ` Varadarajan Narayanan
2026-02-16 15:29               ` Tom Rini
2026-02-17  4:26                 ` Varadarajan Narayanan
2026-02-17 14:39                   ` Tom Rini
2026-02-16 17:19               ` Simon Glass
2026-02-17  4:24                 ` Varadarajan Narayanan [this message]
2026-02-17 13:31                   ` Simon Glass
2026-01-21  6:39 ` [PATCH v6 3/5] sysreset: Implement PSCI based reset to EDL mode for QCOM SoCs Varadarajan Narayanan
2026-05-26 13:32   ` Quentin Schulz
2026-06-08 14:53     ` Quentin Schulz
2026-06-23 16:50       ` Tom Rini
2026-07-02 17:43         ` Quentin Schulz
2026-07-02 17:46           ` Tom Rini
2026-07-03  5:21             ` Varadarajan Narayanan
2026-07-03  7:28               ` Varadarajan Narayanan
2026-01-21  6:39 ` [PATCH v6 4/5] cmd: boot: Add '-edl' option to reset command documentation Varadarajan Narayanan
2026-01-21  6:39 ` [PATCH v6 5/5] qcom_defconfig: enable psci based sysreset Varadarajan Narayanan
2026-04-29  8:49 ` [PATCH v6 0/5] Implement reset to EDL for qcs9100 Casey Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZPtg7dllBavk/a9@hu-varada-blr.qualcomm.com \
    --to=varadarajan.narayanan@oss.qualcomm.com \
    --cc=aswin.murugan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome@forissier.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=me@samcday.com \
    --cc=michal.simek@amd.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@kernel.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox