[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 28/50] pckbd: move mapping of I8042_MMIO registers to MIPS magnum
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 28/50] pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine |
Date: |
Sun, 22 May 2022 19:18:14 +0100 |
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>
---
hw/input/pckbd.c | 5 +----
hw/mips/jazz.c | 11 +++++++----
include/hw/input/i8042.h | 3 +--
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index a7f1439994..eb77ad193e 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -707,8 +707,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;
@@ -724,8 +723,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 6598d7dddd..80c9206230 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,
diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
index d05cd33e3c..9d1f8af964 100644
--- a/include/hw/input/i8042.h
+++ b/include/hw/input/i8042.h
@@ -65,8 +65,7 @@ struct MMIOKBDState {
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);
void i8042_isa_mouse_fake_event(ISAKBDState *isa);
void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
--
2.20.1
- [PATCH 15/50] pl050: split pl050_update_irq() into separate pl050_set_irq() and pl050_update_irq() functions, (continued)
- [PATCH 15/50] pl050: split pl050_update_irq() into separate pl050_set_irq() and pl050_update_irq() functions, Mark Cave-Ayland, 2022/05/22
- [PATCH 16/50] lasips2: spacing fixes, Mark Cave-Ayland, 2022/05/22
- [PATCH 17/50] lasips2: rename ps2dev_update_irq() to lasips2_port_set_irq(), Mark Cave-Ayland, 2022/05/22
- [PATCH 19/50] pckbd: move KBDState from pckbd.c to i8042.h, Mark Cave-Ayland, 2022/05/22
- [PATCH 20/50] pckbd: move ISAKBDState from pckbd.c to i8042.h, Mark Cave-Ayland, 2022/05/22
- [PATCH 22/50] pckbd: implement i8042_mmio_reset() for I8042_MMIO device, Mark Cave-Ayland, 2022/05/22
- [PATCH 18/50] pckbd: checkpatch fixes, Mark Cave-Ayland, 2022/05/22
- [PATCH 26/50] pckbd: implement i8042_mmio_init() function, Mark Cave-Ayland, 2022/05/22
- [PATCH 23/50] pckbd: add mask qdev property to I8042_MMIO device, Mark Cave-Ayland, 2022/05/22
- [PATCH 24/50] pckbd: add size qdev property to 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 <=
- [PATCH 29/50] pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/05/22
- [PATCH 31/50] ps2: make ps2_raise_irq() function static, Mark Cave-Ayland, 2022/05/22
- [PATCH 21/50] pckbd: introduce new I8042_MMIO QOM type, Mark Cave-Ayland, 2022/05/22
- [PATCH 25/50] pckbd: implement i8042_mmio_realize() function, 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 35/50] pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDState, 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 27/50] pckbd: alter i8042_mm_init() to return a I8042_MMIO device, Mark Cave-Ayland, 2022/05/22