xref: /qemu/include/hw/cris/etraxfs_dma.h (revision 6402cbbb)
1 #ifndef HW_ETRAXFS_DMA_H
2 #define HW_ETRAXFS_DMA_H
3 
4 struct dma_context_metadata {
5 	/* data descriptor md */
6 	uint16_t metadata;
7 };
8 
9 struct etraxfs_dma_client
10 {
11 	/* DMA controller. */
12 	int channel;
13 	void *ctrl;
14 
15 	/* client.  */
16 	struct {
17 		int (*push)(void *opaque, unsigned char *buf,
18 		            int len, bool eop);
19 		void (*pull)(void *opaque);
20 		void (*metadata_push)(void *opaque,
21 		                      const struct dma_context_metadata *md);
22 		void *opaque;
23 	} client;
24 };
25 
26 void *etraxfs_dmac_init(hwaddr base, int nr_channels);
27 void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line,
28 			  int input);
29 void etraxfs_dmac_connect_client(void *opaque, int c,
30 				 struct etraxfs_dma_client *cl);
31 int etraxfs_dmac_input(struct etraxfs_dma_client *client,
32 		       void *buf, int len, int eop);
33 
34 #endif
35