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.
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
21 #define TYPE_BCM2836_CONTROL "bcm2836_control"
23 #define TYPE_BCM2836_CONTROL "bcm2836-control"
24 >>>>>>> upstreaming-raspi
25 #define BCM2836_CONTROL(obj) \
26 OBJECT_CHECK(BCM2836ControlState, (obj), TYPE_BCM2836_CONTROL)
28 typedef struct BCM2836ControlState {
34 /* interrupt status registers (not directly visible to user) */
35 bool gpu_irq, gpu_fiq;
37 uint32_t localirqs[BCM2836_NCORES];
39 uint8_t localirqs[BCM2836_NCORES];
40 >>>>>>> upstreaming-raspi
43 uint32_t mailboxes[BCM2836_NCORES * BCM2836_MBPERCORE];
45 /* interrupt routing/control registers */
46 uint8_t route_gpu_irq, route_gpu_fiq;
47 uint32_t timercontrol[BCM2836_NCORES];
48 uint32_t mailboxcontrol[BCM2836_NCORES];
50 /* interrupt source registers, post-routing (visible) */
51 uint32_t irqsrc[BCM2836_NCORES];
52 uint32_t fiqsrc[BCM2836_NCORES];
54 /* outputs to CPU cores */
55 qemu_irq irq[BCM2836_NCORES];
56 qemu_irq fiq[BCM2836_NCORES];
57 } BCM2836ControlState;