xref: /qemu/include/hw/intc/aspeed_intc.h (revision b008465d655ff3ff314fe1ef81031293b582ebaf)
1 /*
2  * ASPEED INTC Controller
3  *
4  * Copyright (C) 2024 ASPEED Technology Inc.
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 #ifndef ASPEED_INTC_H
9 #define ASPEED_INTC_H
10 
11 #include "hw/sysbus.h"
12 #include "qom/object.h"
13 #include "hw/or-irq.h"
14 
15 #define TYPE_ASPEED_INTC "aspeed.intc"
16 #define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"
17 OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
18 
19 #define ASPEED_INTC_NR_INTS 9
20 
21 struct AspeedINTCState {
22     /*< private >*/
23     SysBusDevice parent_obj;
24 
25     /*< public >*/
26     MemoryRegion iomem;
27     MemoryRegion iomem_container;
28 
29     uint32_t *regs;
30     OrIRQState orgates[ASPEED_INTC_NR_INTS];
31     qemu_irq output_pins[ASPEED_INTC_NR_INTS];
32 
33     uint32_t enable[ASPEED_INTC_NR_INTS];
34     uint32_t mask[ASPEED_INTC_NR_INTS];
35     uint32_t pending[ASPEED_INTC_NR_INTS];
36 };
37 
38 struct AspeedINTCClass {
39     SysBusDeviceClass parent_class;
40 
41     uint32_t num_lines;
42     uint32_t num_ints;
43     uint64_t mem_size;
44     uint64_t nr_regs;
45 };
46 
47 #endif /* ASPEED_INTC_H */
48