xref: /openbmc/qemu/include/hw/dma/bcm2835_dma.h (revision ed75658a)
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 OBJECT_DECLARE_SIMPLE_TYPE(BCM2835DMAState, BCM2835_DMA)
30 
31 #define BCM2835_DMA_NCHANS 16
32 
33 struct BCM2835DMAState {
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 };
46 
47 #endif
48