[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/53] lasi: move register memory mapping from lasi.c to machine.c
From: |
Mark Cave-Ayland |
Subject: |
[PULL 25/53] lasi: move register memory mapping from lasi.c to machine.c |
Date: |
Sun, 8 May 2022 20:56:22 +0100 |
The device register should be mapped directly by the board code.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-26-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/lasi.c | 7 +++----
hw/hppa/machine.c | 7 +++++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c
index c028b7786e..08ebe7c6d9 100644
--- a/hw/hppa/lasi.c
+++ b/hw/hppa/lasi.c
@@ -304,10 +304,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
dev = qdev_new(TYPE_LASI_CHIP);
s = LASI_CHIP(dev);
s->iar = CPU_HPA + 3;
-
- /* Lasi access from main memory. */
- memory_region_add_subregion(address_space, LASI_HPA, &s->this_mem);
-
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
/* LAN */
@@ -348,9 +344,12 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
static void lasi_init(Object *obj)
{
LasiState *s = LASI_CHIP(obj);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops,
s, "lasi", 0x100000);
+
+ sysbus_init_mmio(sbd, &s->this_mem);
}
static void lasi_class_init(ObjectClass *klass, void *data)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 2fa55de549..6618bce435 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -139,7 +139,7 @@ static void machine_hppa_init(MachineState *machine)
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
- DeviceState *dev, *dino_dev;
+ DeviceState *dev, *dino_dev, *lasi_dev;
PCIBus *pci_bus;
ISABus *isa_bus;
char *firmware_filename;
@@ -175,7 +175,10 @@ static void machine_hppa_init(MachineState *machine)
/* Init Lasi chip */
- lasi_initfn(addr_space);
+ lasi_dev = lasi_initfn(addr_space);
+ memory_region_add_subregion(addr_space, LASI_HPA,
+ sysbus_mmio_get_region(
+ SYS_BUS_DEVICE(lasi_dev), 0));
/* Init Dino (PCI host bus chip). */
dino_dev = DEVICE(dino_init(addr_space));
--
2.20.1
- [PULL 15/53] dino.h: add defines for DINO IRQ numbers, (continued)
- [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, 2022/05/08
- [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 <=
- [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
- [PULL 30/53] lasi: use qdev GPIOs to wire up IRQs in lasi_initfn(), Mark Cave-Ayland, 2022/05/08
- [PULL 32/53] lasi: update lasi_initfn() to return LASIState, Mark Cave-Ayland, 2022/05/08
- [PULL 37/53] lasi: remove address space parameter from lasi_initfn(), Mark Cave-Ayland, 2022/05/08
- [PULL 33/53] lasi: move LAN initialisation to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 36/53] lasi: move PS2 initialisation to machine.c, Mark Cave-Ayland, 2022/05/08