2 * SiFive Platform DMA emulation
4 * Copyright (c) 2020 Wind River Systems, Inc.
7 * Bin Meng <bin.meng@windriver.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 or
12 * (at your option) version 3 of the License.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, see <http://www.gnu.org/licenses/>.
26 #include "hw/sysbus.h"
28 struct sifive_pdma_chan
{
41 #define SIFIVE_PDMA_CHANS 4
42 #define SIFIVE_PDMA_IRQS (SIFIVE_PDMA_CHANS * 2)
43 #define SIFIVE_PDMA_REG_SIZE 0x100000
44 #define SIFIVE_PDMA_CHAN_NO(reg) ((reg & (SIFIVE_PDMA_REG_SIZE - 1)) >> 12)
46 typedef struct SiFivePDMAState
{
49 qemu_irq irq
[SIFIVE_PDMA_IRQS
];
51 struct sifive_pdma_chan chan
[SIFIVE_PDMA_CHANS
];
54 #define TYPE_SIFIVE_PDMA "sifive.pdma"
56 #define SIFIVE_PDMA(obj) \
57 OBJECT_CHECK(SiFivePDMAState, (obj), TYPE_SIFIVE_PDMA)
59 #endif /* SIFIVE_PDMA_H */