xref: /openbmc/qemu/include/hw/dma/bcm2835_dma.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_DMA_H
7 #define BCM2835_DMA_H
8 
9 #include "qemu-common.h"
10 #include "hw/sysbus.h"
11 
12 typedef struct {
13     uint32_t cs;
14     uint32_t conblk_ad;
15     uint32_t ti;
16     uint32_t source_ad;
17     uint32_t dest_ad;
18     uint32_t txfr_len;
19     uint32_t stride;
20     uint32_t nextconbk;
21     uint32_t debug;
22 
23     qemu_irq irq;
24 } BCM2835DMAChan;
25 
26 #define TYPE_BCM2835_DMA "bcm2835-dma"
27 #define BCM2835_DMA(obj) \
28         OBJECT_CHECK(BCM2835DMAState, (obj), TYPE_BCM2835_DMA)
29 
30 #define BCM2835_DMA_NCHANS 16
31 
32 typedef struct {
33     /*< private >*/
34     SysBusDevice busdev;
35     /*< public >*/
36 
37     MemoryRegion iomem0, iomem15;
38     MemoryRegion *dma_mr;
39     AddressSpace dma_as;
40 
41     BCM2835DMAChan chan[BCM2835_DMA_NCHANS];
42     uint32_t int_status;
43     uint32_t enable;
44 } BCM2835DMAState;
45 
46 #endif
47