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>
This commit is contained in:
parent
903dd0e49b
commit
01d924dce8
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue