xref: /openbmc/qemu/include/hw/misc/bcm2835_mbox.h (revision 709395f8)
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 
12 #define TYPE_BCM2835_MBOX "bcm2835-mbox"
13 #define BCM2835_MBOX(obj) \
14         OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX)
15 
16 typedef struct {
17     uint32_t reg[MBOX_SIZE];
18     uint32_t count;
19     uint32_t status;
20     uint32_t config;
21 } BCM2835Mbox;
22 
23 typedef struct {
24     /*< private >*/
25     SysBusDevice busdev;
26     /*< public >*/
27     MemoryRegion *mbox_mr;
28     AddressSpace mbox_as;
29     MemoryRegion iomem;
30     qemu_irq arm_irq;
31 
32     bool mbox_irq_disabled;
33     bool available[MBOX_CHAN_COUNT];
34     BCM2835Mbox mbox[2];
35 } BCM2835MboxState;
36 
37 #endif
38