Skip to contentSkip to conversation

zynq: Request qemu reset when PSS_RESET_CTRL triggered.

PATCH In review Chris Johns 2 participants 3 messages Feb 3, 2014 – Feb 8, 2014 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zynq: Request qemu reset when PSS_RESET_CTRL triggered.

If 1 is written to the SLCR's PSS_RESET_CTRL register request a qemu reset.

The RTEMS BSPs use this bit and if -no-reboot is used qemu exits cleanly.

---
 hw/misc/zynq_slcr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/misc/zynq_slcr.c +5 -1
index e42a5b0..f68a934 100644
@@ -394,7 +394,11 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
         case 0x1B0 ... 0x1D8:
             s->misc[(offset - 0x1B0) / 4] = val;
             break;
-        case 0x200 ... 0x25C:
+        case 0x200:
+            if (val == 1) {
+                qemu_system_reset_request();
+            }
+        case 0x204 ... 0x25C:
             if (offset == 0x250) {
                 goto bad_reg;
             }
Signature · 1 line
1.8.3.4 (Apple Git-47)
#1 lore raw
Quoted 15 lines · Chris Johns

If 1 is written to the SLCR's PSS_RESET_CTRL register request a qemu reset.

The RTEMS BSPs use this bit and if -no-reboot is used qemu exits cleanly.

---
 hw/misc/zynq_slcr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/misc/zynq_slcr.c +0 -0
index e42a5b0..f68a934 100644

hw/misc/zynq_slcr.c static void zynq_slcr_write(void *opaque, hwaddr offset, · line 400

Quoted 8 lines
hw/misc/zynq_slcr.c +4 -1
@@ -394,7 +394,11 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
         case 0x1B0 ... 0x1D8:
             s->misc[(offset - 0x1B0) / 4] = val;
             break;
-        case 0x200 ... 0x25C:
+        case 0x200:
+            if (val == 1) {
+                qemu_system_reset_request();
+            }

Either missing "break" statement or missing "/* fall through */" comment.

Is this really a "reset on specific value written" rather than "bit 0 in the register is set to cause system reset"?

hw/misc/zynq_slcr.c static void zynq_slcr_write(void *opaque, hwaddr offset, · line 404

Quoted 4 lines
hw/misc/zynq_slcr.c +1 -0
+        case 0x204 ... 0x25C:
             if (offset == 0x250) {
                 goto bad_reg;
             }

thanks
-- PMM

#2 lore raw
Quoted 9 lines · Peter Maydell
Quoted 6 lines · Chris Johns

If 1 is written to the SLCR's PSS_RESET_CTRL register request a qemu reset.

The RTEMS BSPs use this bit and if -no-reboot is used qemu exits cleanly.

[review comments]

Never mind, I see there's a newer version from somebody else already.

thanks
-- PMM