Skip to contentSkip to conversation

cmd: reset: add parameters to specify reboot_mode

PATCH New Simon Goldschmidt 3 participants 14 messages May 3, 2019 – Oct 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

 cmd/boot.c                         |  4 ++--
 drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
 #endif
 
 U_BOOT_CMD(
-	reset, 1, 0,	do_reset,
+	reset, 2, 0,	do_reset,
 	"Perform RESET of the CPU",
-	""
+	"[<cold|warm>] - type of reboot"
 );
 
 #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +16 -1
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
 
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+	enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+	if (argc > 1 && argv[1]) {
+		switch (*argv[1]) {
+		case 'w':
+			reboot_mode = SYSRESET_WARM;
+			printf("warm ");
+			break;
+		case 'c':
+			reboot_mode = SYSRESET_COLD;
+			printf("cold ");
+			break;
+		}
+	}
+
 	printf("resetting ...\n");
 
-	sysreset_walk_halt(SYSRESET_COLD);
+	sysreset_walk_halt(reboot_mode);
 
 	return 0;
 }
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 38 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

 cmd/boot.c                         |  4 ++--
 drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
 #endif
 
 U_BOOT_CMD(
-	reset, 1, 0,	do_reset,
+	reset, 2, 0,	do_reset,
 	"Perform RESET of the CPU",
-	""
+	"[<cold|warm>] - type of reboot"
 );
 
 #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +2 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
 
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+	enum sysreset_t reboot_mode = SYSRESET_COLD;
+

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 10 lines
drivers/sysreset/sysreset-uclass.c +10 -0
+	if (argc > 1 && argv[1]) {
+		switch (*argv[1]) {
+		case 'w':
+			reboot_mode = SYSRESET_WARM;
+			printf("warm ");
+			break;
+		case 'c':
+			reboot_mode = SYSRESET_COLD;
+			printf("cold ");
+			break;

This looks like a platform or driver specific stuff ?

Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 35 lines · Marek Vasut
Quoted 34 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

  cmd/boot.c                         |  4 ++--
  drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
  2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
  #endif
 
  U_BOOT_CMD(
-	reset, 1, 0,	do_reset,
+	reset, 2, 0,	do_reset,
  	"Perform RESET of the CPU",
-	""
+	"[<cold|warm>] - type of reboot"
  );
 
  #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +0 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
 
Quoted 16 lines
Quoted 4 lines
drivers/sysreset/sysreset-uclass.c +2 -0
  int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  {
+	enum sysreset_t reboot_mode = SYSRESET_COLD;
+

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 10 lines
drivers/sysreset/sysreset-uclass.c +10 -0
+	if (argc > 1 && argv[1]) {
+		switch (*argv[1]) {
+		case 'w':
+			reboot_mode = SYSRESET_WARM;
+			printf("warm ");
+			break;
+		case 'c':
+			reboot_mode = SYSRESET_COLD;
+			printf("cold ");
+			break;

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

There is a problem in that other platforms without UCLASS_SYSRESET don't handle these arguments, but I thought UCLASS_SYSRESET would be the future, and the rest would be "legacy"?

Regards,
SImon

#3 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 54 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

  cmd/boot.c                         |  4 ++-- drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-

  2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +0 -0
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
   #endif

    U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
      "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
  );
    #ifdef CONFIG_CMD_POWEROFF

drivers/sysreset/sysreset-uclass.c +0 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)

    int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;

Quoted 8 lines
Quoted 6 lines

+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

This looks like a platform or driver specific stuff ?

Quoted 5 lines

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

Quoted 3 lines

There is a problem in that other platforms without UCLASS_SYSRESET don't handle these arguments, but I thought UCLASS_SYSRESET would be the future, and the rest would be "legacy"?

Yep.

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 57 lines · Marek Vasut
Quoted 56 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

   cmd/boot.c                         |  4 ++--
   drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
   2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
   #endif
     U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
       "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
   );
     #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +6 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
     int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
   {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
Quoted 8 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 6 lines
drivers/sysreset/sysreset-uclass.c +6 -0
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Quoted 7 lines
Quoted 3 lines

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Quoted 7 lines
Quoted 4 lines

There is a problem in that other platforms without UCLASS_SYSRESET don't handle these arguments, but I thought UCLASS_SYSRESET would be the future, and the rest would be "legacy"?

Yep.

#5 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 64 lines · Simon Goldschmidt
Quoted 61 lines · Marek Vasut
Quoted 59 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

   cmd/boot.c                         |  4 ++-- drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-

   2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +0 -0
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
    #endif

     U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
       "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
   );
     #ifdef CONFIG_CMD_POWEROFF

drivers/sysreset/sysreset-uclass.c +0 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)

     int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
   {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;

Quoted 8 lines
Quoted 6 lines

+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Quoted 7 lines
Quoted 3 lines

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Ah, then socfpga just maps to that "API" very well, nice. I wasn't aware of it.

Signature · 2 lines
Best regards,
Marek Vasut
#6 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Hi Simon,

Quoted 49 lines · Marek Vasut
Quoted 47 lines · Simon Goldschmidt
Quoted 44 lines · Marek Vasut
Quoted 43 lines · Simon Goldschmidt
Quoted 40 lines · Marek Vasut
Quoted 39 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

   cmd/boot.c                         |  4 ++--
   drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
   2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
   #endif
     U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
       "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
   );
     #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +4 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
     int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
   {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 8 lines
drivers/sysreset/sysreset-uclass.c +8 -0
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

Regards,
Simon

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Quoted 7 lines
Quoted 3 lines

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Ah, then socfpga just maps to that "API" very well, nice. I wasn't aware of it.

--
Best regards,
Marek Vasut

#7 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 54 lines

Hi Simon,

Quoted 51 lines · Marek Vasut
Quoted 49 lines · Simon Goldschmidt
Quoted 46 lines · Marek Vasut
Quoted 45 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

    cmd/boot.c                         |  4 ++--
    drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
    2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
    #endif
      U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
        "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
    );
      #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +6 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
      int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
    {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 6 lines
drivers/sysreset/sysreset-uclass.c +6 -0
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

Regards,
Simon

Quoted 27 lines

Regards,
Simon

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Quoted 7 lines
Quoted 3 lines

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Ah, then socfpga just maps to that "API" very well, nice. I wasn't aware of it.

--
Best regards,
Marek Vasut

#8 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 64 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 54 lines

Hi Simon,

Quoted 51 lines · Marek Vasut
Quoted 49 lines · Simon Goldschmidt
Quoted 46 lines · Marek Vasut
Quoted 45 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

     cmd/boot.c                         |  4 ++--
     drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
     2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
     #endif
       U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
         "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
     );
       #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +6 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
       int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
     {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 6 lines
drivers/sysreset/sysreset-uclass.c +6 -0
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

Quoted 3 lines

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Thanks,
Simon

Quoted 32 lines

Regards,
Simon

Quoted 27 lines

Regards,
Simon

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Quoted 7 lines
Quoted 3 lines

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Ah, then socfpga just maps to that "API" very well, nice. I wasn't aware of it.

--
Best regards,
Marek Vasut

#9 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Simon,

Quoted 70 lines · Simon Goldschmidt

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 64 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 62 lines

Hi Simon,

Quoted 49 lines · Marek Vasut
Quoted 47 lines · Simon Goldschmidt
Quoted 44 lines · Marek Vasut
Quoted 43 lines · Simon Goldschmidt
Quoted 40 lines · Marek Vasut
Quoted 39 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

     cmd/boot.c                         |  4 ++--
     drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
     2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
     #endif
       U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
         "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
     );
       #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +4 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
       int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
     {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 8 lines
drivers/sysreset/sysreset-uclass.c +8 -0
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

Quoted 6 lines
Quoted 3 lines

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Sorry, but I can't implement a test without you telling me what kind of test you mean.

I'll be sending v2 (that removes the extra printf's from above) without such a test and hope it can still be accepted.

Regards,
Simon

Quoted 37 lines

Thanks,
Simon

Quoted 32 lines

Regards,
Simon

Quoted 27 lines

Regards,
Simon

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

This looks like a platform or driver specific stuff ?

Ouch, I just saw the extra printf might have to be removed in a v2...

Anyway, except for that, I don't think it's platform or driver specific. It's just a way to make the cmd 'reset' take arguments that map to enum sysreset_t.

Quoted 7 lines
Quoted 3 lines

Cold vs. Warm reset is socfpga specific. The reset driver should probably somehow register supported reset modes (warm/cold) with the reset core code.

But it's a thing the UCLASS_SYSRESET already exposes. I haven't added the enum values for that, I merely exposed them to the cmd "API". I can't see anything socfpga specific about it.

Ah, then socfpga just maps to that "API" very well, nice. I wasn't aware of it.

--
Best regards,
Marek Vasut

#10 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Hi Simon,

Quoted 79 lines · Simon Goldschmidt

Simon,

Quoted 74 lines · Simon Goldschmidt

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 67 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 54 lines

Hi Simon,

Quoted 51 lines · Marek Vasut
Quoted 49 lines · Simon Goldschmidt
Quoted 46 lines · Marek Vasut
Quoted 45 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

     cmd/boot.c                         |  4 ++--
     drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
     2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
     #endif
       U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
         "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
     );
       #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +6 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
       int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
     {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 6 lines
drivers/sysreset/sysreset-uclass.c +6 -0
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

Quoted 8 lines
Quoted 2 lines

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Sorry, but I can't implement a test without you telling me what kind of test you mean.

I'll be sending v2 (that removes the extra printf's from above) without such a test and hope it can still be accepted.

Well we have test_unknown_cmd.py for example, and test_pinmux.py, which you could use as examples, just to check that the command works and provides the right output.

Regards,
Simon

#11 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Quoted 90 lines · Simon Glass

Hi Simon,

Quoted 85 lines · Simon Goldschmidt

Simon,

Quoted 70 lines · Simon Goldschmidt

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 64 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 62 lines

Hi Simon,

Quoted 49 lines · Marek Vasut
Quoted 47 lines · Simon Goldschmidt
Quoted 44 lines · Marek Vasut
Quoted 43 lines · Simon Goldschmidt
Quoted 40 lines · Marek Vasut
Quoted 39 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

     cmd/boot.c                         |  4 ++--
     drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
     2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
     #endif
       U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
         "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
     );
       #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +4 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
       int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
     {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 8 lines
drivers/sysreset/sysreset-uclass.c +8 -0
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

Quoted 6 lines
Quoted 3 lines

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Sorry, but I can't implement a test without you telling me what kind of test you mean.

Quoted 6 lines
Quoted 2 lines

I'll be sending v2 (that removes the extra printf's from above) without such a test and hope it can still be accepted.

Well we have test_unknown_cmd.py for example, and test_pinmux.py, which you could use as examples, just to check that the command works and provides the right output.

The tests are run in sandbox, right? And my understanding was that the reset command makes sandbox exit. That's why I asked this question: I just don'tests know if/how I can write a test when the command under test exits sandbox.

Regards,
Simon

#12 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Hi SImon,

Quoted 95 lines · Simon Goldschmidt
Quoted 93 lines · Simon Glass

Hi Simon,

Quoted 87 lines · Simon Goldschmidt

Simon,

Quoted 70 lines · Simon Goldschmidt

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 64 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 62 lines

Hi Simon,

Quoted 49 lines · Marek Vasut
Quoted 47 lines · Simon Goldschmidt
Quoted 44 lines · Marek Vasut
Quoted 43 lines · Simon Goldschmidt
Quoted 40 lines · Marek Vasut
Quoted 39 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

---

     cmd/boot.c                         |  4 ++--
     drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
     2 files changed, 18 insertions(+), 3 deletions(-)
cmd/boot.c +2 -2
index 9150fce80b..c3f33a9ca3 100644
@@ -56,9 +56,9 @@ U_BOOT_CMD(
     #endif
       U_BOOT_CMD(
-    reset, 1, 0,    do_reset,
+    reset, 2, 0,    do_reset,
         "Perform RESET of the CPU",
-    ""
+    "[<cold|warm>] - type of reboot"
     );
       #ifdef CONFIG_CMD_POWEROFF
drivers/sysreset/sysreset-uclass.c +4 -0
index ad831c703a..fbda3f44f2 100644
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
       int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
 argv[])
     {
+    enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+    if (argc > 1 && argv[1]) {
+        switch (*argv[1]) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/sysreset/sysreset-uclass.c void reset_cpu(ulong addr) · line 125

Quoted 8 lines
drivers/sysreset/sysreset-uclass.c +8 -0
+        case 'w':
+            reboot_mode = SYSRESET_WARM;
+            printf("warm ");
+            break;
+        case 'c':
+            reboot_mode = SYSRESET_COLD;
+            printf("cold ");
+            break;

Please can we have a pytest for this command?

Quoted 6 lines
Quoted 3 lines

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Sorry, but I can't implement a test without you telling me what kind of test you mean.

I'll be sending v2 (that removes the extra printf's from above) without such a test and hope it can still be accepted.

Quoted 7 lines
Quoted 3 lines

Well we have test_unknown_cmd.py for example, and test_pinmux.py, which you could use as examples, just to check that the command works and provides the right output.

The tests are run in sandbox, right? And my understanding was that the reset command makes sandbox exit. That's why I asked this question: I just don'tests know if/how I can write a test when the command under test exits sandbox.

The sandbox sysreset driver has a way to avoid exiting. But even if you do have it set to exit, that should be OK for the test.

Regards,
Simon

#13 lore raw

PATCH 1/1 cmd: reset: add parameters to specify reboot_mode

Am 02.08.2019 um 16:41 schrieb Simon Glass:

Quoted 103 lines

Hi SImon,

Quoted 99 lines · Simon Goldschmidt
Quoted 96 lines · Simon Glass

Hi Simon,

Quoted 79 lines · Simon Goldschmidt

Simon,

Quoted 74 lines · Simon Goldschmidt

Simon,

I know I've slept for a while before retriggering this, but...

Am 04.05.2019 um 20:23 schrieb Simon Goldschmidt:

Quoted 67 lines

Am 03.05.2019 um 23:10 schrieb Simon Glass:

Quoted 54 lines

Hi Simon,

Quoted 51 lines · Marek Vasut
Quoted 49 lines · Simon Goldschmidt
Quoted 46 lines · Marek Vasut
Quoted 45 lines · Simon Goldschmidt
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Simon Goldschmidt

This patch adds parameter support for the 'reset' command to specify
the reboot mode (cold vs. warm).

Checking these parameters is implemented in the DM implementation.

Signed-off-by: Simon Goldschmidt <[email protected]>
---

cmd/boot.c | 4 ++--
drivers/sysreset/sysreset-uclass.c | 17 ++++++++++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/cmd/boot.c b/cmd/boot.c
index 9150fce80b..c3f33a9ca3 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -56,9 +56,9 @@ U_BOOT_CMD(
#endif
U_BOOT_CMD(
- reset, 1, 0, do_reset,
+ reset, 2, 0, do_reset,
"Perform RESET of the CPU",
- ""
+ "[<cold|warm>] - type of reboot"
);
#ifdef CONFIG_CMD_POWEROFF
diff --git a/drivers/sysreset/sysreset-uclass.c
b/drivers/sysreset/sysreset-uclass.c
index ad831c703a..fbda3f44f2 100644
--- a/drivers/sysreset/sysreset-uclass.c
+++ b/drivers/sysreset/sysreset-uclass.c
@@ -111,9 +111,24 @@ void reset_cpu(ulong addr)
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const
argv[])
{
+ enum sysreset_t reboot_mode = SYSRESET_COLD;
+
+ if (argc > 1 && argv[1]) {
+ switch (*argv[1]) {
+ case 'w':
+ reboot_mode = SYSRESET_WARM;

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

+ printf("warm ");
+ break;
+ case 'c':
+ reboot_mode = SYSRESET_COLD;
+ printf("cold ");
+ break;

Please can we have a pytest for this command?

There's 'test_sandbox_exit.py' that seems to test that the "reset" command exits sandbox process. How would I test differing between "warm" and "cold" exit?

Quoted 8 lines
Quoted 2 lines

If this request for a test is what remains, can you please elaborate on what I should write to get this accepted?

Sorry, but I can't implement a test without you telling me what kind of test you mean.

I'll be sending v2 (that removes the extra printf's from above) without such a test and hope it can still be accepted.

Well we have test_unknown_cmd.py for example, and test_pinmux.py, which you could use as examples, just to check that the command works and provides the right output.

Quoted 6 lines
Quoted 3 lines

The tests are run in sandbox, right? And my understanding was that the reset command makes sandbox exit. That's why I asked this question: I just don'tests know if/how I can write a test when the command under test exits sandbox.

The sandbox sysreset driver has a way to avoid exiting. But even if you do have it set to exit, that should be OK for the test.

I'll drop this one, as it's not required any more.

Regards,
Simon