bcm2836_control: add bcm2836 ARM control logic
[qemu/ar7.git] / include / hw / intc / bcm2836_control.h
blob9dbfc9fd5966ab167714971b40fe5b5cb847d69b
1 /*
2 * Raspberry Pi emulation (c) 2012 Gregory Estrade
3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
6 * Written by Andrew Baumann
8 * This code is licensed under the GNU GPLv2 and later.
9 */
11 #ifndef BCM2836_CONTROL_H
12 #define BCM2836_CONTROL_H
14 #include "hw/sysbus.h"
16 /* 4 mailboxes per core, for 16 total */
17 #define BCM2836_NCORES 4
18 #define BCM2836_MBPERCORE 4
20 #define TYPE_BCM2836_CONTROL "bcm2836-control"
21 #define BCM2836_CONTROL(obj) \
22 OBJECT_CHECK(BCM2836ControlState, (obj), TYPE_BCM2836_CONTROL)
24 typedef struct BCM2836ControlState {
25 /*< private >*/
26 SysBusDevice busdev;
27 /*< public >*/
28 MemoryRegion iomem;
30 /* interrupt status registers (not directly visible to user) */
31 bool gpu_irq, gpu_fiq;
32 uint8_t localirqs[BCM2836_NCORES];
34 /* mailboxes */
35 uint32_t mailboxes[BCM2836_NCORES * BCM2836_MBPERCORE];
37 /* interrupt routing/control registers */
38 uint8_t route_gpu_irq, route_gpu_fiq;
39 uint32_t timercontrol[BCM2836_NCORES];
40 uint32_t mailboxcontrol[BCM2836_NCORES];
42 /* interrupt source registers, post-routing (visible) */
43 uint32_t irqsrc[BCM2836_NCORES];
44 uint32_t fiqsrc[BCM2836_NCORES];
46 /* outputs to CPU cores */
47 qemu_irq irq[BCM2836_NCORES];
48 qemu_irq fiq[BCM2836_NCORES];
49 } BCM2836ControlState;
51 #endif