qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] arm/zynq: Add software reset
@ 2013-05-08 12:55 Sebastian Huber
  2013-05-13 23:49 ` Peter Crosthwaite
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Huber @ 2013-05-08 12:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sebastian Huber, git

---
 hw/misc/zynq_slcr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
index 8418327..e88702e 100644
--- a/hw/misc/zynq_slcr.c
+++ b/hw/misc/zynq_slcr.c
@@ -396,6 +396,9 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
                 goto bad_reg;
             }
             s->reset[(offset - 0x200) / 4] = val;
+            if (offset == 0x200 && val == 0x1) {
+                qemu_system_reset_request();
+            }
             break;
         case 0x300:
             s->apu_ctrl = val;
-- 
1.7.7

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

* Re: [Qemu-devel] [PATCH] arm/zynq: Add software reset
  2013-05-08 12:55 [Qemu-devel] [PATCH] arm/zynq: Add software reset Sebastian Huber
@ 2013-05-13 23:49 ` Peter Crosthwaite
  2013-06-07  4:19   ` Peter Crosthwaite
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Crosthwaite @ 2013-05-13 23:49 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: qemu-devel, git

Hi Sebastian,

Thanks for your contribution,

On Wed, May 8, 2013 at 10:55 PM, Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
> ---
>  hw/misc/zynq_slcr.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
> index 8418327..e88702e 100644
> --- a/hw/misc/zynq_slcr.c
> +++ b/hw/misc/zynq_slcr.c
> @@ -396,6 +396,9 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
>                  goto bad_reg;
>              }
>              s->reset[(offset - 0x200) / 4] = val;
> +            if (offset == 0x200 && val == 0x1) {

The reset will only work if you have all the write-ignore bits in val
cleared. Bit 0 is independent of those. It should read:

            if (offset == 0x200 && val & 0x1) {

To mask off all the don't care bits.

Regards,
Peter

> +                qemu_system_reset_request();
> +            }
>              break;
>          case 0x300:
>              s->apu_ctrl = val;
> --
> 1.7.7
>
>

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

* Re: [Qemu-devel] [PATCH] arm/zynq: Add software reset
  2013-05-13 23:49 ` Peter Crosthwaite
@ 2013-06-07  4:19   ` Peter Crosthwaite
  2013-06-07  8:22     ` Sebastian Huber
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Crosthwaite @ 2013-06-07  4:19 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: qemu-devel, git

Hi Sebastian,

I'd like to get this merged with the fix I suggested. Are you able to
remake or ok if I ammend and resend your patch?

Regards,
Peter

On Tue, May 14, 2013 at 9:49 AM, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> Hi Sebastian,
>
> Thanks for your contribution,
>
> On Wed, May 8, 2013 at 10:55 PM, Sebastian Huber
> <sebastian.huber@embedded-brains.de> wrote:
>> ---
>>  hw/misc/zynq_slcr.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
>> index 8418327..e88702e 100644
>> --- a/hw/misc/zynq_slcr.c
>> +++ b/hw/misc/zynq_slcr.c
>> @@ -396,6 +396,9 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
>>                  goto bad_reg;
>>              }
>>              s->reset[(offset - 0x200) / 4] = val;
>> +            if (offset == 0x200 && val == 0x1) {
>
> The reset will only work if you have all the write-ignore bits in val
> cleared. Bit 0 is independent of those. It should read:
>
>             if (offset == 0x200 && val & 0x1) {
>
> To mask off all the don't care bits.
>
> Regards,
> Peter
>
>> +                qemu_system_reset_request();
>> +            }
>>              break;
>>          case 0x300:
>>              s->apu_ctrl = val;
>> --
>> 1.7.7
>>
>>

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

* Re: [Qemu-devel] [PATCH] arm/zynq: Add software reset
  2013-06-07  4:19   ` Peter Crosthwaite
@ 2013-06-07  8:22     ` Sebastian Huber
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Huber @ 2013-06-07  8:22 UTC (permalink / raw)
  To: Peter Crosthwaite; +Cc: qemu-devel, git

On 06/07/2013 06:19 AM, Peter Crosthwaite wrote:
> Hi Sebastian,
>
> I'd like to get this merged with the fix I suggested. Are you able to
> remake or ok if I ammend and resend your patch?

I am fine with your change.  My version is to restrictive.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

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

* [Qemu-devel] [PATCH] arm/zynq: Add software reset
@ 2014-02-03  7:46 Sebastian Huber
  2014-02-05  5:38 ` Peter Crosthwaite
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Huber @ 2014-02-03  7:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sebastian Huber, peter.crosthwaite

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 hw/misc/zynq_slcr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
index e42a5b0..433d439 100644
--- a/hw/misc/zynq_slcr.c
+++ b/hw/misc/zynq_slcr.c
@@ -399,6 +399,9 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
                 goto bad_reg;
             }
             s->reset[(offset - 0x200) / 4] = val;
+            if (offset == 0x200 && (val & 0x1) != 0) {
+                qemu_system_reset_request();
+            }
             break;
         case 0x300:
             s->apu_ctrl = val;
-- 
1.7.7

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

* Re: [Qemu-devel] [PATCH] arm/zynq: Add software reset
  2014-02-03  7:46 Sebastian Huber
@ 2014-02-05  5:38 ` Peter Crosthwaite
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Crosthwaite @ 2014-02-05  5:38 UTC (permalink / raw)
  To: Sebastian Huber, Peter Maydell; +Cc: qemu-devel@nongnu.org Developers

CC PMM for target-arm queue relevance.

On Mon, Feb 3, 2014 at 5:46 PM, Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>  hw/misc/zynq_slcr.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
> index e42a5b0..433d439 100644
> --- a/hw/misc/zynq_slcr.c
> +++ b/hw/misc/zynq_slcr.c
> @@ -399,6 +399,9 @@ static void zynq_slcr_write(void *opaque, hwaddr offset,
>                  goto bad_reg;
>              }
>              s->reset[(offset - 0x200) / 4] = val;
> +            if (offset == 0x200 && (val & 0x1) != 0) {

Despite the local coding style being something of a mess we should be
macroifying the masks the be self documenting.

#define R_PSS_RST_CTRL_SOFT_RST 0x1

Ideally we convert the address offsets (eg "0x200") as well, but thast
a major change pattern for another day so let that one go.

you can also drop the != 0 check.

With fixes,

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Regards,
Peter

> +                qemu_system_reset_request();
> +            }
>              break;
>          case 0x300:
>              s->apu_ctrl = val;
> --
> 1.7.7
>
>

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

end of thread, other threads:[~2014-02-05  5:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 12:55 [Qemu-devel] [PATCH] arm/zynq: Add software reset Sebastian Huber
2013-05-13 23:49 ` Peter Crosthwaite
2013-06-07  4:19   ` Peter Crosthwaite
2013-06-07  8:22     ` Sebastian Huber
  -- strict thread matches above, loose matches on Subject: below --
2014-02-03  7:46 Sebastian Huber
2014-02-05  5:38 ` Peter Crosthwaite

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).