xref: /openbmc/qemu/include/hw/misc/lasi.h (revision 33a24910)
1 /*
2  * HP-PARISC Lasi chipset emulation.
3  *
4  * (C) 2019 by Helge Deller <deller@gmx.de>
5  *
6  * This work is licensed under the GNU GPL license version 2 or later.
7  *
8  * Documentation available at:
9  * https://parisc.wiki.kernel.org/images-parisc/7/79/Lasi_ers.pdf
10  */
11 
12 #ifndef LASI_H
13 #define LASI_H
14 
15 #include "exec/address-spaces.h"
16 #include "hw/pci/pci_host.h"
17 #include "hw/boards.h"
18 
19 #define TYPE_LASI_CHIP "lasi-chip"
20 OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP)
21 
22 #define LASI_IRR        0x00    /* RO */
23 #define LASI_IMR        0x04
24 #define LASI_IPR        0x08
25 #define LASI_ICR        0x0c
26 #define LASI_IAR        0x10
27 
28 #define LASI_LPT        0x02000
29 #define LASI_AUDIO      0x04000
30 #define LASI_UART       0x05000
31 #define LASI_LAN        0x07000
32 #define LASI_RTC        0x09000
33 #define LASI_FDC        0x0A000
34 
35 #define LASI_PCR        0x0C000 /* LASI Power Control register */
36 #define LASI_ERRLOG     0x0C004 /* LASI Error Logging register */
37 #define LASI_VER        0x0C008 /* LASI Version Control register */
38 #define LASI_IORESET    0x0C00C /* LASI I/O Reset register */
39 #define LASI_AMR        0x0C010 /* LASI Arbitration Mask register */
40 #define LASI_IO_CONF    0x7FFFE /* LASI primary configuration register */
41 #define LASI_IO_CONF2   0x7FFFF /* LASI secondary configuration register */
42 
43 #define LASI_BIT(x)     (1ul << (x))
44 #define LASI_IRQ_BITS   (LASI_BIT(5) | LASI_BIT(7) | LASI_BIT(8) | LASI_BIT(9) \
45             | LASI_BIT(13) | LASI_BIT(14) | LASI_BIT(16) | LASI_BIT(17) \
46             | LASI_BIT(18) | LASI_BIT(19) | LASI_BIT(20) | LASI_BIT(21) \
47             | LASI_BIT(26))
48 
49 #define ICR_BUS_ERROR_BIT  LASI_BIT(8)  /* bit 8 in ICR */
50 #define ICR_TOC_BIT        LASI_BIT(1)  /* bit 1 in ICR */
51 
52 #define LASI_IRQS           27
53 
54 #define LASI_IRQ_HPA        14
55 #define LASI_IRQ_UART_HPA   5
56 #define LASI_IRQ_LPT_HPA    7
57 #define LASI_IRQ_LAN_HPA    8
58 #define LASI_IRQ_SCSI_HPA   9
59 #define LASI_IRQ_AUDIO_HPA  13
60 #define LASI_IRQ_PS2KBD_HPA 26
61 #define LASI_IRQ_PS2MOU_HPA 26
62 
63 struct LasiState {
64     PCIHostState parent_obj;
65 
66     uint32_t irr;
67     uint32_t imr;
68     uint32_t ipr;
69     uint32_t icr;
70     uint32_t iar;
71 
72     uint32_t errlog;
73     uint32_t amr;
74     uint32_t rtc_ref;
75 
76     MemoryRegion this_mem;
77 };
78 
79 #endif
80