2012-12-06 15:15:58 +04:00
|
|
|
#ifndef HW_ETRAXFS_DMA_H
|
2016-06-29 16:29:06 +03:00
|
|
|
#define HW_ETRAXFS_DMA_H
|
2012-12-06 15:15:58 +04:00
|
|
|
|
2019-08-12 08:23:31 +03:00
|
|
|
#include "exec/hwaddr.h"
|
|
|
|
#include "hw/irq.h"
|
|
|
|
|
2011-12-21 18:11:35 +04:00
|
|
|
struct dma_context_metadata {
|
|
|
|
/* data descriptor md */
|
|
|
|
uint16_t metadata;
|
|
|
|
};
|
|
|
|
|
2008-05-11 19:03:06 +04:00
|
|
|
struct etraxfs_dma_client
|
|
|
|
{
|
|
|
|
/* DMA controller. */
|
|
|
|
int channel;
|
|
|
|
void *ctrl;
|
|
|
|
|
|
|
|
/* client. */
|
2011-12-21 18:11:35 +04:00
|
|
|
struct {
|
|
|
|
int (*push)(void *opaque, unsigned char *buf,
|
|
|
|
int len, bool eop);
|
2008-05-11 19:03:06 +04:00
|
|
|
void (*pull)(void *opaque);
|
2011-12-21 18:11:35 +04:00
|
|
|
void (*metadata_push)(void *opaque,
|
|
|
|
const struct dma_context_metadata *md);
|
2008-05-11 19:03:06 +04:00
|
|
|
void *opaque;
|
|
|
|
} client;
|
|
|
|
};
|
|
|
|
|
2012-10-23 14:30:10 +04:00
|
|
|
void *etraxfs_dmac_init(hwaddr base, int nr_channels);
|
2008-05-11 19:03:06 +04:00
|
|
|
void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line,
|
|
|
|
int input);
|
|
|
|
void etraxfs_dmac_connect_client(void *opaque, int c,
|
|
|
|
struct etraxfs_dma_client *cl);
|
|
|
|
int etraxfs_dmac_input(struct etraxfs_dma_client *client,
|
|
|
|
void *buf, int len, int eop);
|
2012-12-06 15:15:58 +04:00
|
|
|
|
|
|
|
#endif
|