2012-12-06 11:15:58 +00:00
|
|
|
#ifndef HW_ETRAXFS_DMA_H
|
|
|
|
#define HW_ETRAXFS_DMA_H 1
|
|
|
|
|
2011-12-21 14:11:35 +00:00
|
|
|
struct dma_context_metadata {
|
|
|
|
/* data descriptor md */
|
|
|
|
uint16_t metadata;
|
|
|
|
};
|
|
|
|
|
2008-05-11 15:03:06 +00:00
|
|
|
struct etraxfs_dma_client
|
|
|
|
{
|
|
|
|
/* DMA controller. */
|
|
|
|
int channel;
|
|
|
|
void *ctrl;
|
|
|
|
|
|
|
|
/* client. */
|
2011-12-21 14:11:35 +00:00
|
|
|
struct {
|
|
|
|
int (*push)(void *opaque, unsigned char *buf,
|
|
|
|
int len, bool eop);
|
2008-05-11 15:03:06 +00:00
|
|
|
void (*pull)(void *opaque);
|
2011-12-21 14:11:35 +00:00
|
|
|
void (*metadata_push)(void *opaque,
|
|
|
|
const struct dma_context_metadata *md);
|
2008-05-11 15:03:06 +00:00
|
|
|
void *opaque;
|
|
|
|
} client;
|
|
|
|
};
|
|
|
|
|
2012-10-23 10:30:10 +00:00
|
|
|
void *etraxfs_dmac_init(hwaddr base, int nr_channels);
|
2008-05-11 15:03:06 +00: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 11:15:58 +00:00
|
|
|
|
|
|
|
#endif
|