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