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