All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cmd: boot: Update reset usage message
@ 2021-08-11 10:04 Michal Simek
  2021-08-12 15:52 ` Igor Opaniuk
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michal Simek @ 2021-08-11 10:04 UTC (permalink / raw)
  To: u-boot, git; +Cc: Igor Opaniuk, Simon Glass

The commit 573a3811edc8 ("sysreset: psci: support system reset in a generic
way with PSCI") has added support for warm reset via PSCI but this hasn't
been reflected in usage message and user has to look at the code how to run
it. That's why update usage text to make this clear.

Here is full help with updated usage:
ZynqMP> help reset
reset - Perform RESET of the CPU

Usage:
reset - cold boot without level specifier
reset -w - warm reset if implemented

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 cmd/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/boot.c b/cmd/boot.c
index fab294e622be..be67a5980de3 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -58,7 +58,8 @@ U_BOOT_CMD(
 U_BOOT_CMD(
 	reset, 2, 0,	do_reset,
 	"Perform RESET of the CPU",
-	""
+	"- cold boot without level specifier\n"
+	"reset -w - warm reset if implemented"
 );
 
 #ifdef CONFIG_CMD_POWEROFF
-- 
2.32.0


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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-11 10:04 [PATCH] cmd: boot: Update reset usage message Michal Simek
@ 2021-08-12 15:52 ` Igor Opaniuk
  2021-08-13  6:11 ` Wolfgang Denk
  2021-08-23  6:52 ` Michal Simek
  2 siblings, 0 replies; 7+ messages in thread
From: Igor Opaniuk @ 2021-08-12 15:52 UTC (permalink / raw)
  To: Michal Simek; +Cc: U-Boot Mailing List, git, Simon Glass

Hi Michal,

On Wed, Aug 11, 2021 at 1:04 PM Michal Simek <michal.simek@xilinx.com> wrote:
>
> The commit 573a3811edc8 ("sysreset: psci: support system reset in a generic
> way with PSCI") has added support for warm reset via PSCI but this hasn't
> been reflected in usage message and user has to look at the code how to run
> it. That's why update usage text to make this clear.
>
> Here is full help with updated usage:
> ZynqMP> help reset
> reset - Perform RESET of the CPU
>
> Usage:
> reset - cold boot without level specifier
> reset -w - warm reset if implemented
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  cmd/boot.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/cmd/boot.c b/cmd/boot.c
> index fab294e622be..be67a5980de3 100644
> --- a/cmd/boot.c
> +++ b/cmd/boot.c
> @@ -58,7 +58,8 @@ U_BOOT_CMD(
>  U_BOOT_CMD(
>         reset, 2, 0,    do_reset,
>         "Perform RESET of the CPU",
> -       ""
> +       "- cold boot without level specifier\n"
> +       "reset -w - warm reset if implemented"
>  );
>
>  #ifdef CONFIG_CMD_POWEROFF
> --
> 2.32.0
>

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk
Embedded Software Engineer
T:  +380 938364067
E: igor.opaniuk@foundries.io
W: www.foundries.io

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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-11 10:04 [PATCH] cmd: boot: Update reset usage message Michal Simek
  2021-08-12 15:52 ` Igor Opaniuk
@ 2021-08-13  6:11 ` Wolfgang Denk
  2021-08-13  6:30   ` Michal Simek
  2021-08-23  6:52 ` Michal Simek
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2021-08-13  6:11 UTC (permalink / raw)
  To: Michal Simek; +Cc: u-boot, git, Igor Opaniuk, Simon Glass

Dear Michal,

In message <82e0d7efdbd9f8c62f46c7e1a8913ffa52de5a1e.1628676265.git.michal.simek@xilinx.com> you wrote:
> The commit 573a3811edc8 ("sysreset: psci: support system reset in a generic
> way with PSCI") has added support for warm reset via PSCI but this hasn't
> been reflected in usage message and user has to look at the code how to run
> it. That's why update usage text to make this clear.
>
> Here is full help with updated usage:
> ZynqMP> help reset
> reset - Perform RESET of the CPU
>
> Usage:
> reset - cold boot without level specifier
> reset -w - warm reset if implemented

In case of the hard (cold) reset - is it really only a reset of the
CPU, or of the whole board hardware?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Every revolutionary idea - in science, politics, art, or  whatever  -
evokes three stages of reaction in a hearer:
  1. It is completely impossible - don't waste my time.
  2. It is possible, but it is not worth doing.
  3. I said it was a good idea all along.

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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-13  6:11 ` Wolfgang Denk
@ 2021-08-13  6:30   ` Michal Simek
  2021-08-13  6:54     ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2021-08-13  6:30 UTC (permalink / raw)
  To: Wolfgang Denk, Michal Simek; +Cc: u-boot, git, Igor Opaniuk, Simon Glass



On 8/13/21 8:11 AM, Wolfgang Denk wrote:
> Dear Michal,
> 
> In message <82e0d7efdbd9f8c62f46c7e1a8913ffa52de5a1e.1628676265.git.michal.simek@xilinx.com> you wrote:
>> The commit 573a3811edc8 ("sysreset: psci: support system reset in a generic
>> way with PSCI") has added support for warm reset via PSCI but this hasn't
>> been reflected in usage message and user has to look at the code how to run
>> it. That's why update usage text to make this clear.
>>
>> Here is full help with updated usage:
>> ZynqMP> help reset
>> reset - Perform RESET of the CPU
>>
>> Usage:
>> reset - cold boot without level specifier
>> reset -w - warm reset if implemented
> 
> In case of the hard (cold) reset - is it really only a reset of the
> CPU, or of the whole board hardware?

If you look at sysreset headers you will find these levels
 11         SYSRESET_WARM,  /* Reset CPU, keep GPIOs active */
 12         SYSRESET_COLD,  /* Reset CPU and GPIOs */
 13         SYSRESET_POWER, /* Reset PMIC (remove and restore power) */
 14         SYSRESET_POWER_OFF,     /* Turn off power */

When you call reset sysreset uclass is calling sysreset_walk which is
request to drivers with type passed.
I see we have mixed drivers which deals with levels and especially in
gpio case it is question how you connect it.
I develop this for microblaze where gpio is connected reset logic which
is normally only for CPU and subsystem.
But in general you can connect whatever you want. It means it doesn't
need to be only cpu which is reset.
Do you want me to update that line and remove CPU from it?

Thanks,
Michal

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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-13  6:30   ` Michal Simek
@ 2021-08-13  6:54     ` Wolfgang Denk
  2021-08-13  9:21       ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2021-08-13  6:54 UTC (permalink / raw)
  To: Michal Simek; +Cc: u-boot, git, Igor Opaniuk, Simon Glass

Dear Michal,

In message <90e6c670-9e11-beb8-bcb5-9d22ba00fd11@xilinx.com> you wrote:
> 
> > In case of the hard (cold) reset - is it really only a reset of the
> > CPU, or of the whole board hardware?
>
> If you look at sysreset headers you will find these levels
>  11         SYSRESET_WARM,  /* Reset CPU, keep GPIOs active */
>  12         SYSRESET_COLD,  /* Reset CPU and GPIOs */
>  13         SYSRESET_POWER, /* Reset PMIC (remove and restore power) */
>  14         SYSRESET_POWER_OFF,     /* Turn off power */
>
> When you call reset sysreset uclass is calling sysreset_walk which is
> request to drivers with type passed.
> I see we have mixed drivers which deals with levels and especially in
> gpio case it is question how you connect it.
> I develop this for microblaze where gpio is connected reset logic which
> is normally only for CPU and subsystem.
> But in general you can connect whatever you want. It means it doesn't
> need to be only cpu which is reset.

Thanks a lot for the explanation.

> Do you want me to update that line and remove CPU from it?

I don't know :-)

What the "reset" command _should_ do is a hard cold boot including
the reset of all peripherals - for example, when booting from SPI
NOR flash it is mandatory to reset this flash to make sure the ROM
boot loader can actually read it.

I would appreciate if the help message documents what it actually
does.  Also, what the difference between "cold" and "warm" reset is.
My expectation (without knowing any hardware details) would be that
a warm reset is just a restart of the already loaded code? Or is it
just a reset of the CPU (without external reset)? This might then
hang the system if it's attempting to boot from a flash which is in
the wrong state.

So my problem with this is primarily that I don't understand what
the command really does, and the help command is of no help either.

[And if I understand correctly, this is even board dependent?]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
How many NASA managers does it take to screw in a lightbulb?  "That's
a known problem... don't worry about it."

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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-13  6:54     ` Wolfgang Denk
@ 2021-08-13  9:21       ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2021-08-13  9:21 UTC (permalink / raw)
  To: Wolfgang Denk, Michal Simek; +Cc: u-boot, git, Igor Opaniuk, Simon Glass

Hi Wolfgang,

On 8/13/21 8:54 AM, Wolfgang Denk wrote:
> Dear Michal,
> 
> In message <90e6c670-9e11-beb8-bcb5-9d22ba00fd11@xilinx.com> you wrote:
>>
>>> In case of the hard (cold) reset - is it really only a reset of the
>>> CPU, or of the whole board hardware?
>>
>> If you look at sysreset headers you will find these levels
>>  11         SYSRESET_WARM,  /* Reset CPU, keep GPIOs active */
>>  12         SYSRESET_COLD,  /* Reset CPU and GPIOs */
>>  13         SYSRESET_POWER, /* Reset PMIC (remove and restore power) */
>>  14         SYSRESET_POWER_OFF,     /* Turn off power */
>>
>> When you call reset sysreset uclass is calling sysreset_walk which is
>> request to drivers with type passed.
>> I see we have mixed drivers which deals with levels and especially in
>> gpio case it is question how you connect it.
>> I develop this for microblaze where gpio is connected reset logic which
>> is normally only for CPU and subsystem.
>> But in general you can connect whatever you want. It means it doesn't
>> need to be only cpu which is reset.
> 
> Thanks a lot for the explanation.
> 
>> Do you want me to update that line and remove CPU from it?
> 
> I don't know :-)
> 
> What the "reset" command _should_ do is a hard cold boot including
> the reset of all peripherals - for example, when booting from SPI
> NOR flash it is mandatory to reset this flash to make sure the ROM
> boot loader can actually read it.
> 
> I would appreciate if the help message documents what it actually
> does.  Also, what the difference between "cold" and "warm" reset is.
> My expectation (without knowing any hardware details) would be that
> a warm reset is just a restart of the already loaded code? Or is it
> just a reset of the CPU (without external reset)? This might then
> hang the system if it's attempting to boot from a flash which is in
> the wrong state.
> 
> So my problem with this is primarily that I don't understand what
> the command really does, and the help command is of no help either.
> 
> [And if I understand correctly, this is even board dependent?]


https://developer.arm.com/documentation/den0022/latest/
DEN0022D_b_Power_State_Coordination_Interface.pdf
Where 5.11.1 chapter is saying
"This function provides a method for performing a system cold reset. To
the caller, the behavior is
equivalent to a hardware power-cycle sequence."

And also 5.12.2.1 for SYSTEM_RESET2
5.12.2.1 System Warm reset
This reset is selected when reset_type is 0x0 (SYSTEM_WARM_RESET).
The function is intended to provide a fast reboot path that guarantees
not to reset system main memory.
This is defined as volatile memory accessible by cores when executing in
the calling operating system.
This definition does not extend to caches or to memory-mapped IO.
The memory that is to be preserved and not trashed by boot firmware
needs to be described by
firmware table technologies such as ACPI [6] and Device Tree [7] and
does not need to cover all
available system main memory.

But they also open vendor-specific resets.
It means defining resets is more or less implementation dependent.

Thanks,
Michal


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

* Re: [PATCH] cmd: boot: Update reset usage message
  2021-08-11 10:04 [PATCH] cmd: boot: Update reset usage message Michal Simek
  2021-08-12 15:52 ` Igor Opaniuk
  2021-08-13  6:11 ` Wolfgang Denk
@ 2021-08-23  6:52 ` Michal Simek
  2 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2021-08-23  6:52 UTC (permalink / raw)
  To: U-Boot, git; +Cc: Igor Opaniuk, Simon Glass

st 11. 8. 2021 v 12:04 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> The commit 573a3811edc8 ("sysreset: psci: support system reset in a generic
> way with PSCI") has added support for warm reset via PSCI but this hasn't
> been reflected in usage message and user has to look at the code how to run
> it. That's why update usage text to make this clear.
>
> Here is full help with updated usage:
> ZynqMP> help reset
> reset - Perform RESET of the CPU
>
> Usage:
> reset - cold boot without level specifier
> reset -w - warm reset if implemented
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  cmd/boot.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/cmd/boot.c b/cmd/boot.c
> index fab294e622be..be67a5980de3 100644
> --- a/cmd/boot.c
> +++ b/cmd/boot.c
> @@ -58,7 +58,8 @@ U_BOOT_CMD(
>  U_BOOT_CMD(
>         reset, 2, 0,    do_reset,
>         "Perform RESET of the CPU",
> -       ""
> +       "- cold boot without level specifier\n"
> +       "reset -w - warm reset if implemented"
>  );
>
>  #ifdef CONFIG_CMD_POWEROFF
> --
> 2.32.0
>

Applied.

WD: Feel free to send the patch on the top of this one.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

end of thread, other threads:[~2021-08-23  6:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 10:04 [PATCH] cmd: boot: Update reset usage message Michal Simek
2021-08-12 15:52 ` Igor Opaniuk
2021-08-13  6:11 ` Wolfgang Denk
2021-08-13  6:30   ` Michal Simek
2021-08-13  6:54     ` Wolfgang Denk
2021-08-13  9:21       ` Michal Simek
2021-08-23  6:52 ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.