U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cmd: reset: fixes related to Qualcomm's edl
@ 2026-05-07 15:04 Quentin Schulz
  2026-05-07 15:04 ` [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported Quentin Schulz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Quentin Schulz @ 2026-05-07 15:04 UTC (permalink / raw)
  To: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng
  Cc: Tom Rini, Quentin Schulz

Fix a missed dependency on the edl reset command option for deciding
when to show the option in the help text.

Fix typo in reset command usage documentation.

Fix missing edl reset option in reset command usage documentation.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Changes in v2:
- added patch 1, fixing edl option being shown even when not usable,
- added patch 2, fixing "Do warm WARM" typo,
- added -edl to the synopsis,
- added requirement on CONFIG_SYSRESET_CMD_RESET_ARGS=y to docs,
- added info that an error message will be printed on unsupported
  platforms but that the command will still succeed,
- Link to v1: https://patch.msgid.link/20260428-doc-sysreset-qcom-v1-1-964df4ee79f9@cherry.de

---
Quentin Schulz (3):
      cmd: boot: fix edl being shown when not supported
      doc: usage: cmd: reset: fix typo
      doc: usage: cmd: reset: specify when the -edl option is available

 cmd/boot.c              |  3 +++
 doc/usage/cmd/reset.rst | 12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
base-commit: 3cdd19089f1b1b7cd08530f33ff4708abcfd426c
change-id: 20260428-doc-sysreset-qcom-f5d21aa84142

Best regards,
--  
Quentin Schulz <quentin.schulz@cherry.de>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported
  2026-05-07 15:04 [PATCH v2 0/3] cmd: reset: fixes related to Qualcomm's edl Quentin Schulz
@ 2026-05-07 15:04 ` Quentin Schulz
  2026-05-08 16:33   ` Simon Glass
  2026-05-07 15:04 ` [PATCH v2 2/3] doc: usage: cmd: reset: fix typo Quentin Schulz
  2026-05-07 15:04 ` [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available Quentin Schulz
  2 siblings, 1 reply; 8+ messages in thread
From: Quentin Schulz @ 2026-05-07 15:04 UTC (permalink / raw)
  To: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng
  Cc: Tom Rini, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

edl is implemented in the sysreset_ops.request_arg callback of the
qcom-psci sysreset driver. That callback is only called from
sysreset_request_arg() which is compiled only when
CONFIG_SYSRESET_CMD_RESET_ARGS=y.

Therefore, only show the edl option if that symbol is enabled.

It is in a separate if block because any option but -w will only be
handled when CONFIG_SYSRESET_CMD_RESET_ARGS=y as seen with the
implementation in do_reset() in drivers/sysreset/sysreset-uclass.c.

Fixes: ef06c5d76ff4 ("cmd: boot: Add '-edl' option to reset command documentation")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 cmd/boot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmd/boot.c b/cmd/boot.c
index d80f9d8c05d..29cdf4a9a81 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -60,8 +60,11 @@ U_BOOT_CMD(
 	reset, 2, 0,	do_reset,
 	"Perform RESET of the CPU",
 	"- cold boot without level specifier\n"
+#if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_ARGS)
+// All options handled by sysreset drivers via their sysreset_ops.request_arg callback
 #ifdef CONFIG_SYSRESET_QCOM_PSCI
 	"reset -edl - Boot to Emergency DownLoad mode\n"
+#endif
 #endif
 	"reset -w - warm reset if implemented"
 );

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/3] doc: usage: cmd: reset: fix typo
  2026-05-07 15:04 [PATCH v2 0/3] cmd: reset: fixes related to Qualcomm's edl Quentin Schulz
  2026-05-07 15:04 ` [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported Quentin Schulz
@ 2026-05-07 15:04 ` Quentin Schulz
  2026-05-08 16:33   ` Simon Glass
  2026-05-07 15:04 ` [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available Quentin Schulz
  2 siblings, 1 reply; 8+ messages in thread
From: Quentin Schulz @ 2026-05-07 15:04 UTC (permalink / raw)
  To: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng
  Cc: Tom Rini, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

"Do warm WARM" doesn't mean anything, I'm assuming the intent was to say
"Do WARM reset" so reword.

Fixes: 34e452dd0252 ("doc: usage: Group all shell command docs into cmd/ sub-directory")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 doc/usage/cmd/reset.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/usage/cmd/reset.rst b/doc/usage/cmd/reset.rst
index 366b17eea16..88261293924 100644
--- a/doc/usage/cmd/reset.rst
+++ b/doc/usage/cmd/reset.rst
@@ -20,7 +20,7 @@ Perform reset of the CPU. By default does COLD reset, which resets CPU,
 DDR and peripherals, on some boards also resets external PMIC.
 
 -w
-    Do warm WARM, reset CPU but keep peripheral/DDR/PMIC active.
+    Do WARM reset: reset CPU but keep peripheral/DDR/PMIC active.
 
 -edl
     Boot to Emergency DownLoad mode on supported Qualcomm platforms.

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available
  2026-05-07 15:04 [PATCH v2 0/3] cmd: reset: fixes related to Qualcomm's edl Quentin Schulz
  2026-05-07 15:04 ` [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported Quentin Schulz
  2026-05-07 15:04 ` [PATCH v2 2/3] doc: usage: cmd: reset: fix typo Quentin Schulz
@ 2026-05-07 15:04 ` Quentin Schulz
  2026-05-11 17:01   ` Simon Glass
  2 siblings, 1 reply; 8+ messages in thread
From: Quentin Schulz @ 2026-05-07 15:04 UTC (permalink / raw)
  To: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng
  Cc: Tom Rini, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

The option is only available when CONFIG_SYSRESET_QCOM_PSCI is enabled,
so let's make that explicit in the boot cmd documentation.

Due to the implementation in drivers/sysreset/sysreset-uclass.c
do_reset() function, all options to the reset command are passed to all
sysreset drivers' sysreset_ops.request_arg callback (including -w) which
is only available when CONFIG_SYSRESET_CMD_RESET_ARGS=y. -w, however,
works also without this option.

Fixes: ef06c5d76ff4 ("cmd: boot: Add '-edl' option to reset command documentation")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 doc/usage/cmd/reset.rst | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/usage/cmd/reset.rst b/doc/usage/cmd/reset.rst
index 88261293924..79bc8b9deca 100644
--- a/doc/usage/cmd/reset.rst
+++ b/doc/usage/cmd/reset.rst
@@ -11,7 +11,9 @@ Synopsis
 
 ::
 
-    reset [-w]
+    reset
+    reset -w
+    reset -edl
 
 Description
 -----------
@@ -22,8 +24,12 @@ DDR and peripherals, on some boards also resets external PMIC.
 -w
     Do WARM reset: reset CPU but keep peripheral/DDR/PMIC active.
 
+All other options require CONFIG_SYSRESET_CMD_RESET_ARGS=y.
+
 -edl
-    Boot to Emergency DownLoad mode on supported Qualcomm platforms.
+    Boot to Emergency DownLoad mode on supported Qualcomm platforms. Unsupported
+    platforms will print an error message but the command will successfully
+    return (having done nothing). Requires CONFIG_SYSRESET_QCOM_PSCI=y.
 
 Return value
 ------------

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported
  2026-05-07 15:04 ` [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported Quentin Schulz
@ 2026-05-08 16:33   ` Simon Glass
  2026-05-08 16:48     ` Quentin Schulz
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2026-05-08 16:33 UTC (permalink / raw)
  To: foss+uboot
  Cc: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng, Tom Rini, Quentin Schulz

Hi Quentin,

On 2026-05-07T15:04:04, Quentin Schulz <foss+uboot@0leil.net> wrote:
> cmd: boot: fix edl being shown when not supported
>
> edl is implemented in the sysreset_ops.request_arg callback of the
> qcom-psci sysreset driver. That callback is only called from
> sysreset_request_arg() which is compiled only when
> CONFIG_SYSRESET_CMD_RESET_ARGS=y.
>
> Therefore, only show the edl option if that symbol is enabled.
>
> It is in a separate if block because any option but -w will only be
> handled when CONFIG_SYSRESET_CMD_RESET_ARGS=y as seen with the
> implementation in do_reset() in drivers/sysreset/sysreset-uclass.c.
>
> Fixes: ef06c5d76ff4 ("cmd: boot: Add '-edl' option to reset command documentation")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>
> cmd/boot.c | 3 +++
>  1 file changed, 3 insertions(+)

> diff --git a/cmd/boot.c b/cmd/boot.c
> @@ -60,8 +60,11 @@ U_BOOT_CMD(
>       reset, 2, 0,    do_reset,
>       "Perform RESET of the CPU",
>       "- cold boot without level specifier\n"
> +#if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_ARGS)
> +// All options handled by sysreset drivers via their sysreset_ops.request_arg callback
>  #ifdef CONFIG_SYSRESET_QCOM_PSCI
>       "reset -edl - Boot to Emergency DownLoad mode\n"
> +#endif
>  #endif

Reviewed-by: Simon Glass <sjg@chromium.org>

Should SYSRESET_QCOM_PSCI select SYSRESET_CMD_RESET_ARGS ?

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/3] doc: usage: cmd: reset: fix typo
  2026-05-07 15:04 ` [PATCH v2 2/3] doc: usage: cmd: reset: fix typo Quentin Schulz
@ 2026-05-08 16:33   ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2026-05-08 16:33 UTC (permalink / raw)
  To: foss+uboot
  Cc: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng, Tom Rini, Quentin Schulz

On 2026-05-07T15:04:04, Quentin Schulz <foss+uboot@0leil.net> wrote:
> doc: usage: cmd: reset: fix typo
>
> "Do warm WARM" doesn't mean anything, I'm assuming the intent was to say
> "Do WARM reset" so reword.
>
> Fixes: 34e452dd0252 ("doc: usage: Group all shell command docs into cmd/ sub-directory")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>
> doc/usage/cmd/reset.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported
  2026-05-08 16:33   ` Simon Glass
@ 2026-05-08 16:48     ` Quentin Schulz
  0 siblings, 0 replies; 8+ messages in thread
From: Quentin Schulz @ 2026-05-08 16:48 UTC (permalink / raw)
  To: Simon Glass, foss+uboot
  Cc: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng, Tom Rini

Hi Simon,

On 5/8/26 6:33 PM, Simon Glass wrote:
> Hi Quentin,
> 
> On 2026-05-07T15:04:04, Quentin Schulz <foss+uboot@0leil.net> wrote:
>> cmd: boot: fix edl being shown when not supported
>>
>> edl is implemented in the sysreset_ops.request_arg callback of the
>> qcom-psci sysreset driver. That callback is only called from
>> sysreset_request_arg() which is compiled only when
>> CONFIG_SYSRESET_CMD_RESET_ARGS=y.
>>
>> Therefore, only show the edl option if that symbol is enabled.
>>
>> It is in a separate if block because any option but -w will only be
>> handled when CONFIG_SYSRESET_CMD_RESET_ARGS=y as seen with the
>> implementation in do_reset() in drivers/sysreset/sysreset-uclass.c.
>>
>> Fixes: ef06c5d76ff4 ("cmd: boot: Add '-edl' option to reset command documentation")
>> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>>
>> cmd/boot.c | 3 +++
>>   1 file changed, 3 insertions(+)
> 
>> diff --git a/cmd/boot.c b/cmd/boot.c
>> @@ -60,8 +60,11 @@ U_BOOT_CMD(
>>        reset, 2, 0,    do_reset,
>>        "Perform RESET of the CPU",
>>        "- cold boot without level specifier\n"
>> +#if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_ARGS)
>> +// All options handled by sysreset drivers via their sysreset_ops.request_arg callback
>>   #ifdef CONFIG_SYSRESET_QCOM_PSCI
>>        "reset -edl - Boot to Emergency DownLoad mode\n"
>> +#endif
>>   #endif
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Should SYSRESET_QCOM_PSCI select SYSRESET_CMD_RESET_ARGS ?
> 

I don't think so, it can work without? But that's up to 
Varadarajan/Casey to tell us.

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available
  2026-05-07 15:04 ` [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available Quentin Schulz
@ 2026-05-11 17:01   ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2026-05-11 17:01 UTC (permalink / raw)
  To: foss+uboot
  Cc: Casey Connolly, Sumit Garg, Varadarajan Narayanan, u-boot,
	Heinrich Schuchardt, Bin Meng, Tom Rini, Quentin Schulz

Hi Quentin,

On 2026-05-07T15:04:04, Quentin Schulz <foss+uboot@0leil.net> wrote:
> doc: usage: cmd: reset: specify when the -edl option is available
>
> The option is only available when CONFIG_SYSRESET_QCOM_PSCI is enabled,
> so let's make that explicit in the boot cmd documentation.
>
> Due to the implementation in drivers/sysreset/sysreset-uclass.c
> do_reset() function, all options to the reset command are passed to all
> sysreset drivers' sysreset_ops.request_arg callback (including -w) which
> is only available when CONFIG_SYSRESET_CMD_RESET_ARGS=y. -w, however,
> works also without this option.
>
> Fixes: ef06c5d76ff4 ("cmd: boot: Add '-edl' option to reset command documentation")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>
> doc/usage/cmd/reset.rst | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

nits below

> diff --git a/doc/usage/cmd/reset.rst b/doc/usage/cmd/reset.rst
> @@ -22,8 +24,12 @@ DDR and peripherals, on some boards also resets external PMIC.
>  -w
>      Do WARM reset: reset CPU but keep peripheral/DDR/PMIC active.
>
> +All other options require CONFIG_SYSRESET_CMD_RESET_ARGS=y.
> +
>  -edl
> -    Boot to Emergency DownLoad mode on supported Qualcomm platforms.
> +    Boot to Emergency DownLoad mode on supported Qualcomm platforms. Unsupported
> +    platforms will print an error message but the command will successfully
> +    return (having done nothing).

When sysreset_walk_arg() returns anything other than -EINPROGRESS
(e.g. -EPROTONOSUPPORT from qcom_psci_sysreset_request_arg(), or
-ENOSYS when CONFIG_SYSRESET_QCOM_PSCI is not enabled), execution
falls through to sysreset_walk_halt(reset_type) with reset_type still
SYSRESET_COLD

So 'reset -edl' on an unsupported platform actually performs a cold
reset (or hang() if no driver implements it).

> -    reset [-w]
> +    reset
> +    reset -w
> +    reset -edl

nit: I would suggest 'reset [-w | -edl]'

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-11 17:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 15:04 [PATCH v2 0/3] cmd: reset: fixes related to Qualcomm's edl Quentin Schulz
2026-05-07 15:04 ` [PATCH v2 1/3] cmd: boot: fix edl being shown when not supported Quentin Schulz
2026-05-08 16:33   ` Simon Glass
2026-05-08 16:48     ` Quentin Schulz
2026-05-07 15:04 ` [PATCH v2 2/3] doc: usage: cmd: reset: fix typo Quentin Schulz
2026-05-08 16:33   ` Simon Glass
2026-05-07 15:04 ` [PATCH v2 3/3] doc: usage: cmd: reset: specify when the -edl option is available Quentin Schulz
2026-05-11 17:01   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox