xref: /openbmc/linux/arch/sparc/include/asm/ebus_dma.h (revision b2441318)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2aae7fb87SDavid S. Miller #ifndef __ASM_SPARC_EBUS_DMA_H
3aae7fb87SDavid S. Miller #define __ASM_SPARC_EBUS_DMA_H
4aae7fb87SDavid S. Miller 
5aae7fb87SDavid S. Miller struct ebus_dma_info {
6aae7fb87SDavid S. Miller 	spinlock_t	lock;
7aae7fb87SDavid S. Miller 	void __iomem	*regs;
8aae7fb87SDavid S. Miller 
9aae7fb87SDavid S. Miller 	unsigned int	flags;
10aae7fb87SDavid S. Miller #define EBUS_DMA_FLAG_USE_EBDMA_HANDLER		0x00000001
11aae7fb87SDavid S. Miller #define EBUS_DMA_FLAG_TCI_DISABLE		0x00000002
12aae7fb87SDavid S. Miller 
13aae7fb87SDavid S. Miller 	/* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
14aae7fb87SDavid S. Miller 	 * set.
15aae7fb87SDavid S. Miller 	 */
16aae7fb87SDavid S. Miller 	void (*callback)(struct ebus_dma_info *p, int event, void *cookie);
17aae7fb87SDavid S. Miller 	void *client_cookie;
18aae7fb87SDavid S. Miller 	unsigned int	irq;
19aae7fb87SDavid S. Miller #define EBUS_DMA_EVENT_ERROR	1
20aae7fb87SDavid S. Miller #define EBUS_DMA_EVENT_DMA	2
21aae7fb87SDavid S. Miller #define EBUS_DMA_EVENT_DEVICE	4
22aae7fb87SDavid S. Miller 
23aae7fb87SDavid S. Miller 	unsigned char	name[64];
24aae7fb87SDavid S. Miller };
25aae7fb87SDavid S. Miller 
26f05a6865SSam Ravnborg int ebus_dma_register(struct ebus_dma_info *p);
27f05a6865SSam Ravnborg int ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
28f05a6865SSam Ravnborg void ebus_dma_unregister(struct ebus_dma_info *p);
29f05a6865SSam Ravnborg int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
30aae7fb87SDavid S. Miller 			    size_t len);
31f05a6865SSam Ravnborg void ebus_dma_prepare(struct ebus_dma_info *p, int write);
32f05a6865SSam Ravnborg unsigned int ebus_dma_residue(struct ebus_dma_info *p);
33f05a6865SSam Ravnborg unsigned int ebus_dma_addr(struct ebus_dma_info *p);
34f05a6865SSam Ravnborg void ebus_dma_enable(struct ebus_dma_info *p, int on);
35aae7fb87SDavid S. Miller 
36aae7fb87SDavid S. Miller #endif /* __ASM_SPARC_EBUS_DMA_H */
37