lasi: move register memory mapping from lasi.c to machine.c

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>
This commit is contained in:
Mark Cave-Ayland 2022-05-04 10:25:35 +01:00
parent 46f2594cfc
commit 2683758c7c
2 changed files with 8 additions and 6 deletions

View File

@ -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)

View File

@ -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));