diff mbox

zynq: Request qemu reset when PSS_RESET_CTRL triggered.

Message ID 1391401989-52312-1-git-send-email-chrisj@rtems.org
State New
Headers show

Commit Message

Chris Johns Feb. 3, 2014, 4:33 a.m. UTC
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.

Signed-off-by: Chris Johns <chrisj@rtems.org>
---
 hw/misc/zynq_slcr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Peter Maydell Feb. 8, 2014, 2:04 p.m. UTC | #1
On 3 February 2014 04:33, Chris Johns <chrisj@rtems.org> wrote:
> 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.
>
> Signed-off-by: Chris Johns <chrisj@rtems.org>
> ---
>  hw/misc/zynq_slcr.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
> index e42a5b0..f68a934 100644
> --- a/hw/misc/zynq_slcr.c
> +++ b/hw/misc/zynq_slcr.c
> @@ -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"?

> +        case 0x204 ... 0x25C:
>              if (offset == 0x250) {
>                  goto bad_reg;
>              }

thanks
-- PMM
Peter Maydell Feb. 8, 2014, 2:06 p.m. UTC | #2
On 8 February 2014 14:04, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 3 February 2014 04:33, Chris Johns <chrisj@rtems.org> wrote:
>> 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.
>>
>> Signed-off-by: Chris Johns <chrisj@rtems.org>
>
> [review comments]

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

thanks
-- PMM
diff mbox

Patch

diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
index e42a5b0..f68a934 100644
--- a/hw/misc/zynq_slcr.c
+++ b/hw/misc/zynq_slcr.c
@@ -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;
             }