2 * Xilinx Platform CSU Stream DMA emulation
4 * This implementation is based on
5 * https://github.com/Xilinx/qemu/blob/master/hw/dma/csu_stream_dma.c
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 or
10 * (at your option) version 3 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef XLNX_CSU_DMA_H
22 #define XLNX_CSU_DMA_H
24 #define TYPE_XLNX_CSU_DMA "xlnx.csu_dma"
26 #define XLNX_CSU_DMA_R_MAX (0x2c / 4)
28 typedef struct XlnxCSUDMA
{
35 StreamSink
*tx_dev
; /* Used as generic StreamSink */
36 ptimer_state
*src_timer
;
40 bool r_size_last_word
;
42 StreamCanPushNotifyFn notify
;
45 uint32_t regs
[XLNX_CSU_DMA_R_MAX
];
46 RegisterInfo regs_info
[XLNX_CSU_DMA_R_MAX
];
49 #define XLNX_CSU_DMA(obj) \
50 OBJECT_CHECK(XlnxCSUDMA, (obj), TYPE_XLNX_CSU_DMA)