[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/53] lasi: move memory region initialisation to new lasi_init()
From: |
Mark Cave-Ayland |
Subject: |
[PULL 24/53] lasi: move memory region initialisation to new lasi_init() function |
Date: |
Sun, 8 May 2022 20:56:21 +0100 |
Create a new lasi_init() instance initialisation function and move the LASI
memory region initialisation into it. Rename the existing lasi_init() function
to lasi_initfn() for now.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-25-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/hppa/hppa_sys.h | 2 +-
hw/hppa/lasi.c | 13 ++++++++++---
hw/hppa/machine.c | 2 +-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h
index 7c31dd8396..0929dedded 100644
--- a/hw/hppa/hppa_sys.h
+++ b/hw/hppa/hppa_sys.h
@@ -10,7 +10,7 @@
#include "hppa_hardware.h"
-DeviceState *lasi_init(MemoryRegion *);
+DeviceState *lasi_initfn(MemoryRegion *);
#define enable_lasi_lan() 0
/* hppa_pci.c. */
diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c
index 3b77fba1c6..c028b7786e 100644
--- a/hw/hppa/lasi.c
+++ b/hw/hppa/lasi.c
@@ -296,7 +296,7 @@ static int lasi_get_irq(unsigned long hpa)
}
}
-DeviceState *lasi_init(MemoryRegion *address_space)
+DeviceState *lasi_initfn(MemoryRegion *address_space)
{
DeviceState *dev;
LasiState *s;
@@ -306,8 +306,6 @@ DeviceState *lasi_init(MemoryRegion *address_space)
s->iar = CPU_HPA + 3;
/* Lasi access from main memory. */
- memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops,
- s, "lasi", 0x100000);
memory_region_add_subregion(address_space, LASI_HPA, &s->this_mem);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
@@ -347,6 +345,14 @@ DeviceState *lasi_init(MemoryRegion *address_space)
return dev;
}
+static void lasi_init(Object *obj)
+{
+ LasiState *s = LASI_CHIP(obj);
+
+ memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops,
+ s, "lasi", 0x100000);
+}
+
static void lasi_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -357,6 +363,7 @@ static void lasi_class_init(ObjectClass *klass, void *data)
static const TypeInfo lasi_pcihost_info = {
.name = TYPE_LASI_CHIP,
.parent = TYPE_SYS_BUS_DEVICE,
+ .instance_init = lasi_init,
.instance_size = sizeof(LasiState),
.class_init = lasi_class_init,
};
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index c847febe5d..2fa55de549 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -175,7 +175,7 @@ static void machine_hppa_init(MachineState *machine)
/* Init Lasi chip */
- lasi_init(addr_space);
+ lasi_initfn(addr_space);
/* Init Dino (PCI host bus chip). */
dino_dev = DEVICE(dino_init(addr_space));
--
2.20.1
- [PULL 10/53] dino: return PCIBus from dino_init() using qdev_get_child_bus(), (continued)
- [PULL 10/53] dino: return PCIBus from dino_init() using qdev_get_child_bus(), Mark Cave-Ayland, 2022/05/08
- [PULL 11/53] dino: split declarations from dino.c into dino.h, Mark Cave-Ayland, 2022/05/08
- [PULL 12/53] hppa: use new CONFIG_HPPA_B160L option instead of CONFIG_DINO to build hppa machine, Mark Cave-Ayland, 2022/05/08
- [PULL 13/53] dino: change dino_init() to return the DINO device instead of PCIBus, Mark Cave-Ayland, 2022/05/08
- [PULL 14/53] machine.c: map DINO device during board configuration, Mark Cave-Ayland, 2022/05/08
- [PULL 15/53] dino.h: add defines for DINO IRQ numbers, Mark Cave-Ayland, 2022/05/08
- [PULL 16/53] dino: define IRQ inputs as qdev GPIOs, Mark Cave-Ayland, 2022/05/08
- [PULL 17/53] dino: wire up serial IRQ using a qdev GPIO in machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 18/53] dino: remove unused dino_set_timer_irq() IRQ handler, Mark Cave-Ayland, 2022/05/08
- [PULL 23/53] lasi: checkpatch fixes, Mark Cave-Ayland, 2022/05/08
- [PULL 24/53] lasi: move memory region initialisation to new lasi_init() function,
Mark Cave-Ayland <=
- [PULL 20/53] dino: use numerical constant for iar0 and iar1 reset values, Mark Cave-Ayland, 2022/05/08
- [PULL 19/53] hppa: move dino_init() from dino.c to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 21/53] dino: move DINO HPA constants from hppa_hardware.h to dino.h, Mark Cave-Ayland, 2022/05/08
- [PULL 22/53] dino: move from hw/hppa to hw/pci-host, Mark Cave-Ayland, 2022/05/08
- [PULL 25/53] lasi: move register memory mapping from lasi.c to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 26/53] lasi: move initialisation of iar and rtc to new lasi_reset() function, Mark Cave-Ayland, 2022/05/08
- [PULL 27/53] lasi: move LASIState and associated QOM structures to lasi.h, Mark Cave-Ayland, 2022/05/08
- [PULL 29/53] lasi: define IRQ inputs as qdev GPIOs, Mark Cave-Ayland, 2022/05/08
- [PULL 28/53] lasi: replace lasi_get_irq() with defined constants, Mark Cave-Ayland, 2022/05/08
- [PULL 31/53] lasi: fix serial port initialisation, Mark Cave-Ayland, 2022/05/08