All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups
@ 2018-05-06 14:20 Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops Mark Cave-Ayland
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Mark Cave-Ayland @ 2018-05-06 14:20 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

Here is another set of uninorth/macio fixups from various working branches
in my QEMU git repository.

Patch 1 adds min_access_size/max_access_size to unin_ops as suggested by
David when reviewing my last set of uninorth patches.

Patch 2 adds trace-events to the macio timer device in order to help debug
some timer issues I've been working on.

In a similar manner to patch 1, patch 3 adds the same min_access_size/max_access_size
fields to the macio timer device (this agrees with a similar change in Ben's PMU
branch).

Finally patch 4 removes the uninorth token register hack, replacing it instead
with a single read-only version register as determined from looking at various
Darwin/Linux/BSD sources.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (4):
  uninorth: add impl min_access_size and max_access_size to unin_ops
  macio: add trace-events to timer device
  macio: add impl min_access_size and max_access_size to timer_ops
  uninorth: remove token register from uninorth device

 hw/misc/macio/macio.c          |  7 +++++++
 hw/misc/macio/trace-events     |  4 ++++
 hw/pci-host/uninorth.c         | 15 +++++++++------
 include/hw/pci-host/uninorth.h |  4 +++-
 4 files changed, 23 insertions(+), 7 deletions(-)

-- 
2.11.0

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

* [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops
  2018-05-06 14:20 [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups Mark Cave-Ayland
@ 2018-05-06 14:20 ` Mark Cave-Ayland
  2018-06-04  0:39   ` David Gibson
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device Mark Cave-Ayland
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Mark Cave-Ayland @ 2018-05-06 14:20 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

>From testing all my local images the uninorth registers are only ever
read or written with 32-bit accesses.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/pci-host/uninorth.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index ba76b84dbc..a658f9230a 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -548,6 +548,10 @@ static const MemoryRegionOps unin_ops = {
     .read = unin_read,
     .write = unin_write,
     .endianness = DEVICE_BIG_ENDIAN,
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
 };
 
 static void unin_init(Object *obj)
-- 
2.11.0

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

* [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device
  2018-05-06 14:20 [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops Mark Cave-Ayland
@ 2018-05-06 14:20 ` Mark Cave-Ayland
  2018-05-07 13:37   ` Philippe Mathieu-Daudé
  2018-06-04  0:38   ` David Gibson
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 3/4] macio: add impl min_access_size and max_access_size to timer_ops Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device Mark Cave-Ayland
  3 siblings, 2 replies; 10+ messages in thread
From: Mark Cave-Ayland @ 2018-05-06 14:20 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/misc/macio/macio.c      | 3 +++
 hw/misc/macio/trace-events | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 79621eb879..f9a40eea81 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -32,6 +32,7 @@
 #include "hw/char/escc.h"
 #include "hw/misc/macio/macio.h"
 #include "hw/intc/heathrow_pic.h"
+#include "trace.h"
 
 /* Note: this code is strongly inspirated from the corresponding code
  * in PearPC */
@@ -246,6 +247,7 @@ static void macio_oldworld_init(Object *obj)
 static void timer_write(void *opaque, hwaddr addr, uint64_t value,
                        unsigned size)
 {
+    trace_macio_timer_write(addr, size, value);
 }
 
 static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
@@ -266,6 +268,7 @@ static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
         break;
     }
 
+    trace_macio_timer_read(addr, size, value);
     return value;
 }
 
diff --git a/hw/misc/macio/trace-events b/hw/misc/macio/trace-events
index 24c0a36824..d499d78c99 100644
--- a/hw/misc/macio/trace-events
+++ b/hw/misc/macio/trace-events
@@ -9,3 +9,7 @@ cuda_packet_receive(int len) "length %d"
 cuda_packet_receive_data(int i, const uint8_t data) "[%d] 0x%02x"
 cuda_packet_send(int len) "length %d"
 cuda_packet_send_data(int i, const uint8_t data) "[%d] 0x%02x"
+
+# hw/misc/macio/macio.c
+macio_timer_write(uint64_t addr, unsigned len, uint64_t val) "write addr 0x%"PRIx64 " len %d val 0x%"PRIx64
+macio_timer_read(uint64_t addr, unsigned len, uint32_t val) "read addr 0x%"PRIx64 " len %d val 0x%"PRIx32
-- 
2.11.0

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

* [Qemu-devel] [PATCH 3/4] macio: add impl min_access_size and max_access_size to timer_ops
  2018-05-06 14:20 [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device Mark Cave-Ayland
@ 2018-05-06 14:20 ` Mark Cave-Ayland
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device Mark Cave-Ayland
  3 siblings, 0 replies; 10+ messages in thread
From: Mark Cave-Ayland @ 2018-05-06 14:20 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

>From testing all my local images the timer registers are only ever
read or written with 32-bit accesses.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/misc/macio/macio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index f9a40eea81..4b020c57f5 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -276,6 +276,10 @@ static const MemoryRegionOps timer_ops = {
     .read = timer_read,
     .write = timer_write,
     .endianness = DEVICE_LITTLE_ENDIAN,
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
 };
 
 static void macio_newworld_realize(PCIDevice *d, Error **errp)
-- 
2.11.0

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

* [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device
  2018-05-06 14:20 [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups Mark Cave-Ayland
                   ` (2 preceding siblings ...)
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 3/4] macio: add impl min_access_size and max_access_size to timer_ops Mark Cave-Ayland
@ 2018-05-06 14:20 ` Mark Cave-Ayland
  2018-05-07 13:38   ` Philippe Mathieu-Daudé
  2018-06-04  0:41   ` David Gibson
  3 siblings, 2 replies; 10+ messages in thread
From: Mark Cave-Ayland @ 2018-05-06 14:20 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, david

>From observation of various OS sources it can be seen that the token register
introduced in 4e46dcdbd3 "PPC: Newworld: Add uninorth token register" is not
required, since the only register currently implemented is the uninorth hardware
version which is read-only.

Remove the token register implementation and instead return the uninorth
version corresponding to the hardware.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/pci-host/uninorth.c         | 11 +++++------
 include/hw/pci-host/uninorth.h |  4 +++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index a658f9230a..abebfaf755 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -524,19 +524,18 @@ static void unin_write(void *opaque, hwaddr addr, uint64_t value,
                        unsigned size)
 {
     trace_unin_write(addr, value);
-    if (addr == 0x0) {
-        *(int *)opaque = value;
-    }
 }
 
 static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size)
 {
     uint32_t value;
 
-    value = 0;
     switch (addr) {
     case 0:
-        value = *(int *)opaque;
+        value = UNINORTH_VERSION_10A;
+        break;
+    default:
+        value = 0;
     }
 
     trace_unin_read(addr, value);
@@ -559,7 +558,7 @@ static void unin_init(Object *obj)
     UNINState *s = UNI_NORTH(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
-    memory_region_init_io(&s->mem, obj, &unin_ops, &s->token, "unin", 0x1000);
+    memory_region_init_io(&s->mem, obj, &unin_ops, s, "unin", 0x1000);
 
     sysbus_init_mmio(sbd, &s->mem);
 }
diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h
index f6654bad9b..2a1cf9f284 100644
--- a/include/hw/pci-host/uninorth.h
+++ b/include/hw/pci-host/uninorth.h
@@ -29,6 +29,9 @@
 
 #include "hw/ppc/openpic.h"
 
+/* UniNorth version */
+#define UNINORTH_VERSION_10A    0x7
+
 #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
 #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
 #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
@@ -57,7 +60,6 @@ typedef struct UNINState {
     SysBusDevice parent_obj;
 
     MemoryRegion mem;
-    int token[1];
 } UNINState;
 
 #define TYPE_UNI_NORTH "uni-north"
-- 
2.11.0

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

* Re: [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device Mark Cave-Ayland
@ 2018-05-07 13:37   ` Philippe Mathieu-Daudé
  2018-06-04  0:38   ` David Gibson
  1 sibling, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-05-07 13:37 UTC (permalink / raw)
  To: Mark Cave-Ayland, qemu-devel, qemu-ppc, david

On 05/06/2018 11:20 AM, Mark Cave-Ayland wrote:
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/misc/macio/macio.c      | 3 +++
>  hw/misc/macio/trace-events | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 79621eb879..f9a40eea81 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -32,6 +32,7 @@
>  #include "hw/char/escc.h"
>  #include "hw/misc/macio/macio.h"
>  #include "hw/intc/heathrow_pic.h"
> +#include "trace.h"
>  
>  /* Note: this code is strongly inspirated from the corresponding code
>   * in PearPC */
> @@ -246,6 +247,7 @@ static void macio_oldworld_init(Object *obj)
>  static void timer_write(void *opaque, hwaddr addr, uint64_t value,
>                         unsigned size)
>  {
> +    trace_macio_timer_write(addr, size, value);
>  }
>  
>  static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
> @@ -266,6 +268,7 @@ static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
>          break;
>      }
>  
> +    trace_macio_timer_read(addr, size, value);
>      return value;
>  }
>  
> diff --git a/hw/misc/macio/trace-events b/hw/misc/macio/trace-events
> index 24c0a36824..d499d78c99 100644
> --- a/hw/misc/macio/trace-events
> +++ b/hw/misc/macio/trace-events
> @@ -9,3 +9,7 @@ cuda_packet_receive(int len) "length %d"
>  cuda_packet_receive_data(int i, const uint8_t data) "[%d] 0x%02x"
>  cuda_packet_send(int len) "length %d"
>  cuda_packet_send_data(int i, const uint8_t data) "[%d] 0x%02x"
> +
> +# hw/misc/macio/macio.c
> +macio_timer_write(uint64_t addr, unsigned len, uint64_t val) "write addr 0x%"PRIx64 " len %d val 0x%"PRIx64
> +macio_timer_read(uint64_t addr, unsigned len, uint32_t val) "read addr 0x%"PRIx64 " len %d val 0x%"PRIx32
> 

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

* Re: [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device Mark Cave-Ayland
@ 2018-05-07 13:38   ` Philippe Mathieu-Daudé
  2018-06-04  0:41   ` David Gibson
  1 sibling, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-05-07 13:38 UTC (permalink / raw)
  To: Mark Cave-Ayland, qemu-devel, qemu-ppc, david

On 05/06/2018 11:20 AM, Mark Cave-Ayland wrote:
> From observation of various OS sources it can be seen that the token register
> introduced in 4e46dcdbd3 "PPC: Newworld: Add uninorth token register" is not
> required, since the only register currently implemented is the uninorth hardware
> version which is read-only.
> 
> Remove the token register implementation and instead return the uninorth
> version corresponding to the hardware.

Thanks for this cleanup :)

> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/pci-host/uninorth.c         | 11 +++++------
>  include/hw/pci-host/uninorth.h |  4 +++-
>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index a658f9230a..abebfaf755 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -524,19 +524,18 @@ static void unin_write(void *opaque, hwaddr addr, uint64_t value,
>                         unsigned size)
>  {
>      trace_unin_write(addr, value);
> -    if (addr == 0x0) {
> -        *(int *)opaque = value;
> -    }
>  }
>  
>  static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size)
>  {
>      uint32_t value;
>  
> -    value = 0;
>      switch (addr) {
>      case 0:
> -        value = *(int *)opaque;
> +        value = UNINORTH_VERSION_10A;
> +        break;
> +    default:
> +        value = 0;
>      }
>  
>      trace_unin_read(addr, value);
> @@ -559,7 +558,7 @@ static void unin_init(Object *obj)
>      UNINState *s = UNI_NORTH(obj);
>      SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>  
> -    memory_region_init_io(&s->mem, obj, &unin_ops, &s->token, "unin", 0x1000);
> +    memory_region_init_io(&s->mem, obj, &unin_ops, s, "unin", 0x1000);
>  
>      sysbus_init_mmio(sbd, &s->mem);
>  }
> diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h
> index f6654bad9b..2a1cf9f284 100644
> --- a/include/hw/pci-host/uninorth.h
> +++ b/include/hw/pci-host/uninorth.h
> @@ -29,6 +29,9 @@
>  
>  #include "hw/ppc/openpic.h"
>  
> +/* UniNorth version */
> +#define UNINORTH_VERSION_10A    0x7
> +
>  #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
>  #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
>  #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
> @@ -57,7 +60,6 @@ typedef struct UNINState {
>      SysBusDevice parent_obj;
>  
>      MemoryRegion mem;
> -    int token[1];
>  } UNINState;
>  
>  #define TYPE_UNI_NORTH "uni-north"
> 

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

* Re: [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device Mark Cave-Ayland
  2018-05-07 13:37   ` Philippe Mathieu-Daudé
@ 2018-06-04  0:38   ` David Gibson
  1 sibling, 0 replies; 10+ messages in thread
From: David Gibson @ 2018-06-04  0:38 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]

On Sun, May 06, 2018 at 03:20:03PM +0100, Mark Cave-Ayland wrote:
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Applied, thanks.

> ---
>  hw/misc/macio/macio.c      | 3 +++
>  hw/misc/macio/trace-events | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 79621eb879..f9a40eea81 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -32,6 +32,7 @@
>  #include "hw/char/escc.h"
>  #include "hw/misc/macio/macio.h"
>  #include "hw/intc/heathrow_pic.h"
> +#include "trace.h"
>  
>  /* Note: this code is strongly inspirated from the corresponding code
>   * in PearPC */
> @@ -246,6 +247,7 @@ static void macio_oldworld_init(Object *obj)
>  static void timer_write(void *opaque, hwaddr addr, uint64_t value,
>                         unsigned size)
>  {
> +    trace_macio_timer_write(addr, size, value);
>  }
>  
>  static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
> @@ -266,6 +268,7 @@ static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
>          break;
>      }
>  
> +    trace_macio_timer_read(addr, size, value);
>      return value;
>  }
>  
> diff --git a/hw/misc/macio/trace-events b/hw/misc/macio/trace-events
> index 24c0a36824..d499d78c99 100644
> --- a/hw/misc/macio/trace-events
> +++ b/hw/misc/macio/trace-events
> @@ -9,3 +9,7 @@ cuda_packet_receive(int len) "length %d"
>  cuda_packet_receive_data(int i, const uint8_t data) "[%d] 0x%02x"
>  cuda_packet_send(int len) "length %d"
>  cuda_packet_send_data(int i, const uint8_t data) "[%d] 0x%02x"
> +
> +# hw/misc/macio/macio.c
> +macio_timer_write(uint64_t addr, unsigned len, uint64_t val) "write addr 0x%"PRIx64 " len %d val 0x%"PRIx64
> +macio_timer_read(uint64_t addr, unsigned len, uint32_t val) "read addr 0x%"PRIx64 " len %d val 0x%"PRIx32

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops Mark Cave-Ayland
@ 2018-06-04  0:39   ` David Gibson
  0 siblings, 0 replies; 10+ messages in thread
From: David Gibson @ 2018-06-04  0:39 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

On Sun, May 06, 2018 at 03:20:02PM +0100, Mark Cave-Ayland wrote:
> >From testing all my local images the uninorth registers are only ever
> read or written with 32-bit accesses.

If that's the case, shouldn't you be setting the range of valid
accesses, rather than the range of implemented accesses?

> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/pci-host/uninorth.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index ba76b84dbc..a658f9230a 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -548,6 +548,10 @@ static const MemoryRegionOps unin_ops = {
>      .read = unin_read,
>      .write = unin_write,
>      .endianness = DEVICE_BIG_ENDIAN,
> +    .impl = {
> +        .min_access_size = 4,
> +        .max_access_size = 4,
> +    },
>  };
>  
>  static void unin_init(Object *obj)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device
  2018-05-06 14:20 ` [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device Mark Cave-Ayland
  2018-05-07 13:38   ` Philippe Mathieu-Daudé
@ 2018-06-04  0:41   ` David Gibson
  1 sibling, 0 replies; 10+ messages in thread
From: David Gibson @ 2018-06-04  0:41 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 2809 bytes --]

On Sun, May 06, 2018 at 03:20:05PM +0100, Mark Cave-Ayland wrote:
> >From observation of various OS sources it can be seen that the token register
> introduced in 4e46dcdbd3 "PPC: Newworld: Add uninorth token register" is not
> required, since the only register currently implemented is the uninorth hardware
> version which is read-only.
> 
> Remove the token register implementation and instead return the uninorth
> version corresponding to the hardware.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Applied, thanks.

> ---
>  hw/pci-host/uninorth.c         | 11 +++++------
>  include/hw/pci-host/uninorth.h |  4 +++-
>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index a658f9230a..abebfaf755 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -524,19 +524,18 @@ static void unin_write(void *opaque, hwaddr addr, uint64_t value,
>                         unsigned size)
>  {
>      trace_unin_write(addr, value);
> -    if (addr == 0x0) {
> -        *(int *)opaque = value;
> -    }
>  }
>  
>  static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size)
>  {
>      uint32_t value;
>  
> -    value = 0;
>      switch (addr) {
>      case 0:
> -        value = *(int *)opaque;
> +        value = UNINORTH_VERSION_10A;
> +        break;
> +    default:
> +        value = 0;
>      }
>  
>      trace_unin_read(addr, value);
> @@ -559,7 +558,7 @@ static void unin_init(Object *obj)
>      UNINState *s = UNI_NORTH(obj);
>      SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>  
> -    memory_region_init_io(&s->mem, obj, &unin_ops, &s->token, "unin", 0x1000);
> +    memory_region_init_io(&s->mem, obj, &unin_ops, s, "unin", 0x1000);
>  
>      sysbus_init_mmio(sbd, &s->mem);
>  }
> diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h
> index f6654bad9b..2a1cf9f284 100644
> --- a/include/hw/pci-host/uninorth.h
> +++ b/include/hw/pci-host/uninorth.h
> @@ -29,6 +29,9 @@
>  
>  #include "hw/ppc/openpic.h"
>  
> +/* UniNorth version */
> +#define UNINORTH_VERSION_10A    0x7
> +
>  #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
>  #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
>  #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
> @@ -57,7 +60,6 @@ typedef struct UNINState {
>      SysBusDevice parent_obj;
>  
>      MemoryRegion mem;
> -    int token[1];
>  } UNINState;
>  
>  #define TYPE_UNI_NORTH "uni-north"

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-06-04  1:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 14:20 [Qemu-devel] [PATCH 0/4] uninorth/macio: minor fixups Mark Cave-Ayland
2018-05-06 14:20 ` [Qemu-devel] [PATCH 1/4] uninorth: add impl min_access_size and max_access_size to unin_ops Mark Cave-Ayland
2018-06-04  0:39   ` David Gibson
2018-05-06 14:20 ` [Qemu-devel] [PATCH 2/4] macio: add trace-events to timer device Mark Cave-Ayland
2018-05-07 13:37   ` Philippe Mathieu-Daudé
2018-06-04  0:38   ` David Gibson
2018-05-06 14:20 ` [Qemu-devel] [PATCH 3/4] macio: add impl min_access_size and max_access_size to timer_ops Mark Cave-Ayland
2018-05-06 14:20 ` [Qemu-devel] [PATCH 4/4] uninorth: remove token register from uninorth device Mark Cave-Ayland
2018-05-07 13:38   ` Philippe Mathieu-Daudé
2018-06-04  0:41   ` David Gibson

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.