1 /* 2 * Raspberry Pi emulation (c) 2012 Gregory Estrade 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8 #ifndef BCM2835_DMA_H 9 #define BCM2835_DMA_H 10 11 #include "hw/sysbus.h" 12 #include "qom/object.h" 13 14 typedef struct { 15 uint32_t cs; 16 uint32_t conblk_ad; 17 uint32_t ti; 18 uint32_t source_ad; 19 uint32_t dest_ad; 20 uint32_t txfr_len; 21 uint32_t stride; 22 uint32_t nextconbk; 23 uint32_t debug; 24 25 qemu_irq irq; 26 } BCM2835DMAChan; 27 28 #define TYPE_BCM2835_DMA "bcm2835-dma" 29 typedef struct BCM2835DMAState BCM2835DMAState; 30 DECLARE_INSTANCE_CHECKER(BCM2835DMAState, BCM2835_DMA, 31 TYPE_BCM2835_DMA) 32 33 #define BCM2835_DMA_NCHANS 16 34 35 struct BCM2835DMAState { 36 /*< private >*/ 37 SysBusDevice busdev; 38 /*< public >*/ 39 40 MemoryRegion iomem0, iomem15; 41 MemoryRegion *dma_mr; 42 AddressSpace dma_as; 43 44 BCM2835DMAChan chan[BCM2835_DMA_NCHANS]; 45 uint32_t int_status; 46 uint32_t enable; 47 }; 48 49 #endif 50