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