xref: /openbmc/qemu/include/hw/misc/bcm2835_mbox.h (revision 4a09d0bb)
1 /*
2  * Raspberry Pi emulation (c) 2012 Gregory Estrade
3  * This code is licensed under the GNU GPLv2 and later.
4  */
5 
6 #ifndef BCM2835_MBOX_H
7 #define BCM2835_MBOX_H
8 
9 #include "bcm2835_mbox_defs.h"
10 #include "hw/sysbus.h"
11 #include "exec/address-spaces.h"
12 
13 #define TYPE_BCM2835_MBOX "bcm2835-mbox"
14 #define BCM2835_MBOX(obj) \
15         OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX)
16 
17 typedef struct {
18     uint32_t reg[MBOX_SIZE];
19     uint32_t count;
20     uint32_t status;
21     uint32_t config;
22 } BCM2835Mbox;
23 
24 typedef struct {
25     /*< private >*/
26     SysBusDevice busdev;
27     /*< public >*/
28     MemoryRegion *mbox_mr;
29     AddressSpace mbox_as;
30     MemoryRegion iomem;
31     qemu_irq arm_irq;
32 
33     bool mbox_irq_disabled;
34     bool available[MBOX_CHAN_COUNT];
35     BCM2835Mbox mbox[2];
36 } BCM2835MboxState;
37 
38 #endif
39