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