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 19 typedef struct BCM2835GpioState { 20 SysBusDevice parent_obj; 21 22 MemoryRegion iomem; 23 24 /* SDBus selector */ 25 SDBus sdbus; 26 SDBus *sdbus_sdhci; 27 SDBus *sdbus_sdhost; 28 29 uint8_t fsel[54]; 30 uint32_t lev0, lev1; 31 uint8_t sd_fsel; 32 qemu_irq out[54]; 33 } BCM2835GpioState; 34 35 #define TYPE_BCM2835_GPIO "bcm2835_gpio" 36 #define BCM2835_GPIO(obj) \ 37 OBJECT_CHECK(BCM2835GpioState, (obj), TYPE_BCM2835_GPIO) 38 39 #endif 40