[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 41/50] lasips2: move mapping of LASIPS2 registers to HPPA machine
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 41/50] lasips2: move mapping of LASIPS2 registers to HPPA machine |
Date: |
Sun, 22 May 2022 19:18:27 +0100 |
Now that the register memory regions are exposed as SysBus memory regions, move
the mapping of the LASIPS2 registers from lasips2_initfn() to the HPPA machine
(which is its only user).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/hppa/machine.c | 11 +++++++++--
hw/input/lasips2.c | 7 +------
include/hw/input/lasips2.h | 3 +--
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 1fceaf2072..f6dd79e211 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -286,8 +286,15 @@ static void machine_hppa_init(MachineState *machine)
}
/* PS/2 Keyboard/Mouse */
- lasips2_initfn(addr_space, LASI_PS2KBD_HPA,
- qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA));
+ dev = DEVICE(lasips2_initfn(LASI_PS2KBD_HPA,
+ qdev_get_gpio_in(lasi_dev,
+ LASI_IRQ_PS2KBD_HPA)));
+ memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA,
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(dev),
+ 0));
+ memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA + 0x100,
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(dev),
+ 1));
/* register power switch emulation */
qemu_register_powerdown_notifier(&hppa_system_powerdown_notifier);
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index 8d3a2d88e8..84e7a1feee 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -245,8 +245,7 @@ static void lasips2_port_set_irq(void *opaque, int level)
lasips2_update_irq(port->parent);
}
-LASIPS2State *lasips2_initfn(MemoryRegion *address_space,
- hwaddr base, qemu_irq irq)
+LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq)
{
LASIPS2State *s;
DeviceState *dev;
@@ -265,10 +264,6 @@ LASIPS2State *lasips2_initfn(MemoryRegion *address_space,
s->kbd.dev = ps2_kbd_init(lasips2_port_set_irq, &s->kbd);
s->mouse.dev = ps2_mouse_init(lasips2_port_set_irq, &s->mouse);
- memory_region_add_subregion(address_space, base, &s->kbd.reg);
-
- memory_region_add_subregion(address_space, base + 0x100, &s->mouse.reg);
-
return s;
}
diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h
index 5a35c22f73..b9723073e1 100644
--- a/include/hw/input/lasips2.h
+++ b/include/hw/input/lasips2.h
@@ -33,7 +33,6 @@ struct LASIPS2State {
#define TYPE_LASIPS2 "lasips2"
OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2)
-LASIPS2State *lasips2_initfn(MemoryRegion *address_space, hwaddr base,
- qemu_irq irq);
+LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq);
#endif /* HW_INPUT_LASIPS2_H */
--
2.20.1
- [PATCH 32/50] ps2: use ps2_raise_irq() instead of calling update_irq() directly, (continued)
- [PATCH 32/50] ps2: use ps2_raise_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/05/22
- [PATCH 27/50] pckbd: alter i8042_mm_init() to return a I8042_MMIO device, Mark Cave-Ayland, 2022/05/22
- [PATCH 28/50] pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine, Mark Cave-Ayland, 2022/05/22
- [PATCH 33/50] ps2: introduce ps2_lower_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/05/22
- [PATCH 34/50] ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ps2_lower_irq(), Mark Cave-Ayland, 2022/05/22
- [PATCH 37/50] lasips2: QOMify LASIPS2State, Mark Cave-Ayland, 2022/05/22
- [PATCH 39/50] lasips2: rename lasips2_init() to lasips2_initfn() and update it to return the LASIPS2 device, Mark Cave-Ayland, 2022/05/22
- [PATCH 30/50] pckbd: move ps2_kbd_init() and ps2_mouse_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/05/22
- [PATCH 36/50] pl050: switch over from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 38/50] lasips2: move lasips2 QOM types from lasips2.c to lasips2.h, Mark Cave-Ayland, 2022/05/22
- [PATCH 41/50] lasips2: move mapping of LASIPS2 registers to HPPA machine,
Mark Cave-Ayland <=
- [PATCH 40/50] lasips2: implement lasips2_init() function, Mark Cave-Ayland, 2022/05/22
- [PATCH 42/50] lasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init(), Mark Cave-Ayland, 2022/05/22
- [PATCH 43/50] lasips2: add base property, Mark Cave-Ayland, 2022/05/22
- [PATCH 48/50] pckbd: add i8042_reset() function to I8042 device, Mark Cave-Ayland, 2022/05/22
- [PATCH 47/50] pckbd: switch I8042_MMIO device from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 49/50] pckbd: switch I8042 device from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 44/50] lasips2: implement lasips2_realize(), Mark Cave-Ayland, 2022/05/22
- [PATCH 46/50] lasips2: switch over from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 45/50] lasips2: use qdev gpio for output IRQ, Mark Cave-Ayland, 2022/05/22
- [PATCH 50/50] ps2: remove update_irq() function and update_arg parameter, Mark Cave-Ayland, 2022/05/22