xref: /qemu/include/hw/gpio/bcm2835_gpio.h (revision abff1abf)
1 /*
2  * Raspberry Pi (BCM2835) GPIO Controller
3  *
4  * Copyright (c) 2017 Antfield SAS
5  *
6  * Authors:
7  *  Clement Deschamps <clement.deschamps@antfield.fr>
8  *  Luc Michel <luc.michel@antfield.fr>
9  *
10  * This work is licensed under the terms of the GNU GPL, version 2 or later.
11  * See the COPYING file in the top-level directory.
12  */
13 
14 #ifndef BCM2835_GPIO_H
15 #define BCM2835_GPIO_H
16 
17 #include "hw/sd/sd.h"
18 #include "hw/sysbus.h"
19 
20 typedef struct BCM2835GpioState {
21     SysBusDevice parent_obj;
22 
23     MemoryRegion iomem;
24 
25     /* SDBus selector */
26     SDBus sdbus;
27     SDBus *sdbus_sdhci;
28     SDBus *sdbus_sdhost;
29 
30     uint8_t fsel[54];
31     uint32_t lev0, lev1;
32     uint8_t sd_fsel;
33     qemu_irq out[54];
34 } BCM2835GpioState;
35 
36 #define TYPE_BCM2835_GPIO "bcm2835_gpio"
37 #define BCM2835_GPIO(obj) \
38     OBJECT_CHECK(BCM2835GpioState, (obj), TYPE_BCM2835_GPIO)
39 
40 #endif
41