All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method
@ 2018-10-01 15:04 Cédric Le Goater
  2018-10-01 15:07 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cédric Le Goater @ 2018-10-01 15:04 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, qemu-devel, Alexander Graf, Cédric Le Goater

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/pci-host/ppce500.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index eb75e080fc10..b8f8c112e662 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -436,8 +436,9 @@ static AddressSpace *e500_pcihost_set_iommu(PCIBus *bus, void *opaque,
     return &s->bm_as;
 }
 
-static int e500_pcihost_initfn(SysBusDevice *dev)
+static void e500_pcihost_realize(DeviceState *dev, Error **errp)
 {
+    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     PCIHostState *h;
     PPCE500PCIState *s;
     PCIBus *b;
@@ -447,7 +448,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
     s = PPC_E500_PCI_HOST_BRIDGE(dev);
 
     for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
-        sysbus_init_irq(dev, &s->irq[i]);
+        sysbus_init_irq(sbd, &s->irq[i]);
     }
 
     for (i = 0; i < PCI_NUM_PINS; i++) {
@@ -460,7 +461,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
     /* PIO lives at the bottom of our bus space */
     memory_region_add_subregion_overlap(&s->busmem, 0, &s->pio, -2);
 
-    b = pci_register_root_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq,
+    b = pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq,
                               mpc85xx_pci_map_irq, s, &s->busmem, &s->pio,
                               PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS);
     h->bus = b;
@@ -483,10 +484,8 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
     memory_region_add_subregion(&s->container, PCIE500_CFGADDR, &h->conf_mem);
     memory_region_add_subregion(&s->container, PCIE500_CFGDATA, &h->data_mem);
     memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem);
-    sysbus_init_mmio(dev, &s->container);
+    sysbus_init_mmio(sbd, &s->container);
     pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq);
-
-    return 0;
 }
 
 static void e500_host_bridge_class_init(ObjectClass *klass, void *data)
@@ -526,9 +525,8 @@ static Property pcihost_properties[] = {
 static void e500_pcihost_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = e500_pcihost_initfn;
+    dc->realize = e500_pcihost_realize;
     set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
     dc->props = pcihost_properties;
     dc->vmsd = &vmstate_ppce500_pci;
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method
  2018-10-01 15:04 [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method Cédric Le Goater
@ 2018-10-01 15:07 ` Philippe Mathieu-Daudé
  2018-10-01 15:35 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
  2018-10-02  1:20 ` [Qemu-devel] " David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-01 15:07 UTC (permalink / raw)
  To: Cédric Le Goater, David Gibson; +Cc: qemu-ppc, qemu-devel, Alexander Graf

On 01/10/2018 17:04, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

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

> ---
>  hw/pci-host/ppce500.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index eb75e080fc10..b8f8c112e662 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -436,8 +436,9 @@ static AddressSpace *e500_pcihost_set_iommu(PCIBus *bus, void *opaque,
>      return &s->bm_as;
>  }
>  
> -static int e500_pcihost_initfn(SysBusDevice *dev)
> +static void e500_pcihost_realize(DeviceState *dev, Error **errp)
>  {
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>      PCIHostState *h;
>      PPCE500PCIState *s;
>      PCIBus *b;
> @@ -447,7 +448,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      s = PPC_E500_PCI_HOST_BRIDGE(dev);
>  
>      for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
> -        sysbus_init_irq(dev, &s->irq[i]);
> +        sysbus_init_irq(sbd, &s->irq[i]);
>      }
>  
>      for (i = 0; i < PCI_NUM_PINS; i++) {
> @@ -460,7 +461,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      /* PIO lives at the bottom of our bus space */
>      memory_region_add_subregion_overlap(&s->busmem, 0, &s->pio, -2);
>  
> -    b = pci_register_root_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq,
> +    b = pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq,
>                                mpc85xx_pci_map_irq, s, &s->busmem, &s->pio,
>                                PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS);
>      h->bus = b;
> @@ -483,10 +484,8 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      memory_region_add_subregion(&s->container, PCIE500_CFGADDR, &h->conf_mem);
>      memory_region_add_subregion(&s->container, PCIE500_CFGDATA, &h->data_mem);
>      memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem);
> -    sysbus_init_mmio(dev, &s->container);
> +    sysbus_init_mmio(sbd, &s->container);
>      pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq);
> -
> -    return 0;
>  }
>  
>  static void e500_host_bridge_class_init(ObjectClass *klass, void *data)
> @@ -526,9 +525,8 @@ static Property pcihost_properties[] = {
>  static void e500_pcihost_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = e500_pcihost_initfn;
> +    dc->realize = e500_pcihost_realize;
>      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
>      dc->props = pcihost_properties;
>      dc->vmsd = &vmstate_ppce500_pci;
> 

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: e500: convert SysBus init method to a realize method
  2018-10-01 15:04 [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method Cédric Le Goater
  2018-10-01 15:07 ` Philippe Mathieu-Daudé
@ 2018-10-01 15:35 ` Greg Kurz
  2018-10-02  1:20 ` [Qemu-devel] " David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kurz @ 2018-10-01 15:35 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: David Gibson, qemu-ppc, qemu-devel

On Mon,  1 Oct 2018 17:04:13 +0200
Cédric Le Goater <clg@kaod.org> wrote:

> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  hw/pci-host/ppce500.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index eb75e080fc10..b8f8c112e662 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -436,8 +436,9 @@ static AddressSpace *e500_pcihost_set_iommu(PCIBus *bus, void *opaque,
>      return &s->bm_as;
>  }
>  
> -static int e500_pcihost_initfn(SysBusDevice *dev)
> +static void e500_pcihost_realize(DeviceState *dev, Error **errp)
>  {
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>      PCIHostState *h;
>      PPCE500PCIState *s;
>      PCIBus *b;
> @@ -447,7 +448,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      s = PPC_E500_PCI_HOST_BRIDGE(dev);
>  
>      for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
> -        sysbus_init_irq(dev, &s->irq[i]);
> +        sysbus_init_irq(sbd, &s->irq[i]);
>      }
>  
>      for (i = 0; i < PCI_NUM_PINS; i++) {
> @@ -460,7 +461,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      /* PIO lives at the bottom of our bus space */
>      memory_region_add_subregion_overlap(&s->busmem, 0, &s->pio, -2);
>  
> -    b = pci_register_root_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq,
> +    b = pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq,
>                                mpc85xx_pci_map_irq, s, &s->busmem, &s->pio,
>                                PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS);
>      h->bus = b;
> @@ -483,10 +484,8 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      memory_region_add_subregion(&s->container, PCIE500_CFGADDR, &h->conf_mem);
>      memory_region_add_subregion(&s->container, PCIE500_CFGDATA, &h->data_mem);
>      memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem);
> -    sysbus_init_mmio(dev, &s->container);
> +    sysbus_init_mmio(sbd, &s->container);
>      pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq);
> -
> -    return 0;
>  }
>  
>  static void e500_host_bridge_class_init(ObjectClass *klass, void *data)
> @@ -526,9 +525,8 @@ static Property pcihost_properties[] = {
>  static void e500_pcihost_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = e500_pcihost_initfn;
> +    dc->realize = e500_pcihost_realize;
>      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
>      dc->props = pcihost_properties;
>      dc->vmsd = &vmstate_ppce500_pci;

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

* Re: [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method
  2018-10-01 15:04 [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method Cédric Le Goater
  2018-10-01 15:07 ` Philippe Mathieu-Daudé
  2018-10-01 15:35 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
@ 2018-10-02  1:20 ` David Gibson
  2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2018-10-02  1:20 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, Alexander Graf

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

On Mon, Oct 01, 2018 at 05:04:13PM +0200, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied to ppc-for-3.1, thanks.

> ---
>  hw/pci-host/ppce500.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index eb75e080fc10..b8f8c112e662 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -436,8 +436,9 @@ static AddressSpace *e500_pcihost_set_iommu(PCIBus *bus, void *opaque,
>      return &s->bm_as;
>  }
>  
> -static int e500_pcihost_initfn(SysBusDevice *dev)
> +static void e500_pcihost_realize(DeviceState *dev, Error **errp)
>  {
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>      PCIHostState *h;
>      PPCE500PCIState *s;
>      PCIBus *b;
> @@ -447,7 +448,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      s = PPC_E500_PCI_HOST_BRIDGE(dev);
>  
>      for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
> -        sysbus_init_irq(dev, &s->irq[i]);
> +        sysbus_init_irq(sbd, &s->irq[i]);
>      }
>  
>      for (i = 0; i < PCI_NUM_PINS; i++) {
> @@ -460,7 +461,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      /* PIO lives at the bottom of our bus space */
>      memory_region_add_subregion_overlap(&s->busmem, 0, &s->pio, -2);
>  
> -    b = pci_register_root_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq,
> +    b = pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq,
>                                mpc85xx_pci_map_irq, s, &s->busmem, &s->pio,
>                                PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS);
>      h->bus = b;
> @@ -483,10 +484,8 @@ static int e500_pcihost_initfn(SysBusDevice *dev)
>      memory_region_add_subregion(&s->container, PCIE500_CFGADDR, &h->conf_mem);
>      memory_region_add_subregion(&s->container, PCIE500_CFGDATA, &h->data_mem);
>      memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem);
> -    sysbus_init_mmio(dev, &s->container);
> +    sysbus_init_mmio(sbd, &s->container);
>      pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq);
> -
> -    return 0;
>  }
>  
>  static void e500_host_bridge_class_init(ObjectClass *klass, void *data)
> @@ -526,9 +525,8 @@ static Property pcihost_properties[] = {
>  static void e500_pcihost_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = e500_pcihost_initfn;
> +    dc->realize = e500_pcihost_realize;
>      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
>      dc->props = pcihost_properties;
>      dc->vmsd = &vmstate_ppce500_pci;

-- 
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] 4+ messages in thread

end of thread, other threads:[~2018-10-02  3:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 15:04 [Qemu-devel] [PATCH] PPC: e500: convert SysBus init method to a realize method Cédric Le Goater
2018-10-01 15:07 ` Philippe Mathieu-Daudé
2018-10-01 15:35 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2018-10-02  1:20 ` [Qemu-devel] " 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.