xref: /openbmc/qemu/include/hw/intc/allwinner-a10-pic.h (revision db1015e92e04835c9eb50c29625fe566d1202dbd)
1121d0712SMarkus Armbruster #ifndef ALLWINNER_A10_PIC_H
2121d0712SMarkus Armbruster #define ALLWINNER_A10_PIC_H
3c3931ee8Sliguang 
4ec150c7eSMarkus Armbruster #include "hw/sysbus.h"
5*db1015e9SEduardo Habkost #include "qom/object.h"
6ec150c7eSMarkus Armbruster 
7c3931ee8Sliguang #define TYPE_AW_A10_PIC  "allwinner-a10-pic"
8*db1015e9SEduardo Habkost typedef struct AwA10PICState AwA10PICState;
9c3931ee8Sliguang #define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC)
10c3931ee8Sliguang 
11c3931ee8Sliguang #define AW_A10_PIC_VECTOR       0
12c3931ee8Sliguang #define AW_A10_PIC_BASE_ADDR    4
13c3931ee8Sliguang #define AW_A10_PIC_PROTECT      8
14c3931ee8Sliguang #define AW_A10_PIC_NMI          0xc
15c3931ee8Sliguang #define AW_A10_PIC_IRQ_PENDING  0x10
16c3931ee8Sliguang #define AW_A10_PIC_FIQ_PENDING  0x20
17c3931ee8Sliguang #define AW_A10_PIC_SELECT       0x30
18c3931ee8Sliguang #define AW_A10_PIC_ENABLE       0x40
19c3931ee8Sliguang #define AW_A10_PIC_MASK         0x50
20c3931ee8Sliguang 
21c3931ee8Sliguang #define AW_A10_PIC_INT_NR       95
22c3931ee8Sliguang #define AW_A10_PIC_REG_NUM      DIV_ROUND_UP(AW_A10_PIC_INT_NR, 32)
23c3931ee8Sliguang 
24*db1015e9SEduardo Habkost struct AwA10PICState {
25c3931ee8Sliguang     /*< private >*/
26c3931ee8Sliguang     SysBusDevice parent_obj;
27c3931ee8Sliguang     /*< public >*/
28c3931ee8Sliguang     MemoryRegion iomem;
29c3931ee8Sliguang     qemu_irq parent_fiq;
30c3931ee8Sliguang     qemu_irq parent_irq;
31c3931ee8Sliguang 
32c3931ee8Sliguang     uint32_t vector;
33c3931ee8Sliguang     uint32_t base_addr;
34c3931ee8Sliguang     uint32_t protect;
35c3931ee8Sliguang     uint32_t nmi;
36c3931ee8Sliguang     uint32_t irq_pending[AW_A10_PIC_REG_NUM];
37c3931ee8Sliguang     uint32_t fiq_pending[AW_A10_PIC_REG_NUM];
38c3931ee8Sliguang     uint32_t select[AW_A10_PIC_REG_NUM];
39c3931ee8Sliguang     uint32_t enable[AW_A10_PIC_REG_NUM];
40c3931ee8Sliguang     uint32_t mask[AW_A10_PIC_REG_NUM];
41c3931ee8Sliguang     /*priority setting here*/
42*db1015e9SEduardo Habkost };
43c3931ee8Sliguang 
44c3931ee8Sliguang #endif
45