aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-24 14:40:43 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-26 18:40:12 +0100
commit01d924dce88f6d43a0be36c0e626f058e68a9ea4 (patch)
tree6aab3941c174e1ed2503a71ea0dad13bc533bccb /hw
parent903dd0e49b5140df55d6f77f97c741f99346c23e (diff)
downloadqemu-01d924dce88f6d43a0be36c0e626f058e68a9ea4.zip
qemu-01d924dce88f6d43a0be36c0e626f058e68a9ea4.tar.gz
qemu-01d924dce88f6d43a0be36c0e626f058e68a9ea4.tar.bz2
pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine
Now that the register memory region is exposed as a SysBus memory region, move the mapping of the I8042_MMIO registers from i8042_mm_init() to the MIPS magnum machine (which is its only user). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-29-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/pckbd.c5
-rw-r--r--hw/mips/jazz.c11
2 files changed, 8 insertions, 8 deletions
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 702dab0..8708595 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -709,8 +709,7 @@ static void i8042_mmio_class_init(ObjectClass *klass, void *data)
}
MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
- MemoryRegion *region, ram_addr_t size,
- hwaddr mask)
+ ram_addr_t size, hwaddr mask)
{
DeviceState *dev;
KBDState *s;
@@ -726,8 +725,6 @@ MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
vmstate_register(NULL, 0, &vmstate_kbd, s);
- region = &I8042_MMIO(dev)->region;
-
s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 96dc6ab..1eb8bd5 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -136,11 +136,11 @@ static void mips_jazz_init(MachineState *machine,
MemoryRegion *isa_mem = g_new(MemoryRegion, 1);
MemoryRegion *isa_io = g_new(MemoryRegion, 1);
MemoryRegion *rtc = g_new(MemoryRegion, 1);
- MemoryRegion *i8042 = g_new(MemoryRegion, 1);
MemoryRegion *dma_dummy = g_new(MemoryRegion, 1);
MemoryRegion *dp8393x_prom = g_new(MemoryRegion, 1);
NICInfo *nd;
DeviceState *dev, *rc4030;
+ MMIOKBDState *i8042;
SysBusDevice *sysbus;
ISABus *isa_bus;
ISADevice *pit;
@@ -361,9 +361,12 @@ static void mips_jazz_init(MachineState *machine,
memory_region_add_subregion(address_space, 0x80004000, rtc);
/* Keyboard (i8042) */
- i8042_mm_init(qdev_get_gpio_in(rc4030, 6), qdev_get_gpio_in(rc4030, 7),
- i8042, 0x1000, 0x1);
- memory_region_add_subregion(address_space, 0x80005000, i8042);
+ i8042 = i8042_mm_init(qdev_get_gpio_in(rc4030, 6),
+ qdev_get_gpio_in(rc4030, 7),
+ 0x1000, 0x1);
+ memory_region_add_subregion(address_space, 0x80005000,
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(i8042),
+ 0));
/* Serial ports */
serial_mm_init(address_space, 0x80006000, 0,