]> git.ipfire.org Git - thirdparty/qemu.git/blob - include/hw/intc/ibex_plic.h
8da6b03805318b86e468868a1b95bb15daacd258
[thirdparty/qemu.git] / include / hw / intc / ibex_plic.h
1 /*
2 * QEMU RISC-V lowRISC Ibex PLIC
3 *
4 * Copyright (c) 2020 Western Digital
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2 or later, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef HW_IBEX_PLIC_H
20 #define HW_IBEX_PLIC_H
21
22 #include "hw/sysbus.h"
23 #include "qom/object.h"
24
25 #define TYPE_IBEX_PLIC "ibex-plic"
26 typedef struct IbexPlicState IbexPlicState;
27 DECLARE_INSTANCE_CHECKER(IbexPlicState, IBEX_PLIC,
28 TYPE_IBEX_PLIC)
29
30 struct IbexPlicState {
31 /*< private >*/
32 SysBusDevice parent_obj;
33
34 /*< public >*/
35 MemoryRegion mmio;
36
37 uint32_t *pending;
38 uint32_t *claimed;
39 uint32_t *source;
40 uint32_t *priority;
41 uint32_t *enable;
42 uint32_t threshold;
43 uint32_t claim;
44
45 /* config */
46 uint32_t num_cpus;
47 uint32_t num_sources;
48
49 uint32_t pending_base;
50 uint32_t pending_num;
51
52 uint32_t source_base;
53 uint32_t source_num;
54
55 uint32_t priority_base;
56 uint32_t priority_num;
57
58 uint32_t enable_base;
59 uint32_t enable_num;
60
61 uint32_t threshold_base;
62
63 uint32_t claim_base;
64 };
65
66 #endif /* HW_IBEX_PLIC_H */