xref: /openbmc/linux/arch/powerpc/include/asm/device.h (revision 4f3db074)
1 /*
2  * Arch specific extensions to struct device
3  *
4  * This file is released under the GPLv2
5  */
6 #ifndef _ASM_POWERPC_DEVICE_H
7 #define _ASM_POWERPC_DEVICE_H
8 
9 struct dma_map_ops;
10 struct device_node;
11 #ifdef CONFIG_PPC64
12 struct pci_dn;
13 #endif
14 
15 /*
16  * Arch extensions to struct device.
17  *
18  * When adding fields, consider macio_add_one_device in
19  * drivers/macintosh/macio_asic.c
20  */
21 struct dev_archdata {
22 	/* DMA operations on that device */
23 	struct dma_map_ops	*dma_ops;
24 
25 	/*
26 	 * When an iommu is in use, dma_data is used as a ptr to the base of the
27 	 * iommu_table.  Otherwise, it is a simple numerical offset.
28 	 */
29 	union {
30 		dma_addr_t	dma_offset;
31 		void		*iommu_table_base;
32 	} dma_data;
33 
34 #ifdef CONFIG_IOMMU_API
35 	void			*iommu_domain;
36 #endif
37 #ifdef CONFIG_SWIOTLB
38 	dma_addr_t		max_direct_dma_addr;
39 #endif
40 #ifdef CONFIG_PPC64
41 	struct pci_dn		*pci_data;
42 #endif
43 #ifdef CONFIG_EEH
44 	struct eeh_dev		*edev;
45 #endif
46 #ifdef CONFIG_FAIL_IOMMU
47 	int fail_iommu;
48 #endif
49 };
50 
51 struct pdev_archdata {
52 	u64 dma_mask;
53 };
54 
55 #define ARCH_HAS_DMA_GET_REQUIRED_MASK
56 
57 #endif /* _ASM_POWERPC_DEVICE_H */
58