xref: /openbmc/qemu/include/hw/input/lasips2.h (revision 0e76929d)
1 /*
2  * QEMU LASI PS/2 emulation
3  *
4  * Copyright (c) 2019 Sven Schnelle
5  *
6  */
7 
8 /*
9  * QEMU interface:
10  * + sysbus MMIO region 0: MemoryRegion defining the LASI PS2 keyboard
11  *   registers
12  * + sysbus MMIO region 1: MemoryRegion defining the LASI PS2 mouse
13  *   registers
14  * + sysbus IRQ 0: LASI PS2 output irq
15  * + Named GPIO input "ps2-kbd-input-irq": set to 1 if the downstream PS2
16  *   keyboard device has asserted its irq
17  * + Named GPIO input "ps2-mouse-input-irq": set to 1 if the downstream PS2
18  *   mouse device has asserted its irq
19  */
20 
21 #ifndef HW_INPUT_LASIPS2_H
22 #define HW_INPUT_LASIPS2_H
23 
24 #include "exec/hwaddr.h"
25 #include "hw/sysbus.h"
26 
27 struct LASIPS2State;
28 typedef struct LASIPS2Port {
29     struct LASIPS2State *parent;
30     MemoryRegion reg;
31     void *dev;
32     uint8_t id;
33     uint8_t control;
34     uint8_t buf;
35     bool loopback_rbne;
36     bool irq;
37 } LASIPS2Port;
38 
39 struct LASIPS2State {
40     SysBusDevice parent_obj;
41 
42     hwaddr base;
43     LASIPS2Port kbd;
44     LASIPS2Port mouse;
45     qemu_irq irq;
46 };
47 
48 #define TYPE_LASIPS2 "lasips2"
49 OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2)
50 
51 LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq);
52 
53 #endif /* HW_INPUT_LASIPS2_H */
54