xref: /openbmc/linux/arch/powerpc/include/asm/device.h (revision ba61bb17)
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 device_node;
10 #ifdef CONFIG_PPC64
11 struct pci_dn;
12 struct iommu_table;
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 	/*
23 	 * These two used to be a union. However, with the hybrid ops we need
24 	 * both so here we store both a DMA offset for direct mappings and
25 	 * an iommu_table for remapped DMA.
26 	 */
27 	dma_addr_t		dma_offset;
28 
29 #ifdef CONFIG_PPC64
30 	struct iommu_table	*iommu_table_base;
31 #endif
32 
33 #ifdef CONFIG_IOMMU_API
34 	void			*iommu_domain;
35 #endif
36 #ifdef CONFIG_SWIOTLB
37 	dma_addr_t		max_direct_dma_addr;
38 #endif
39 #ifdef CONFIG_PPC64
40 	struct pci_dn		*pci_data;
41 #endif
42 #ifdef CONFIG_EEH
43 	struct eeh_dev		*edev;
44 #endif
45 #ifdef CONFIG_FAIL_IOMMU
46 	int fail_iommu;
47 #endif
48 #ifdef CONFIG_CXL_BASE
49 	struct cxl_context	*cxl_ctx;
50 #endif
51 };
52 
53 struct pdev_archdata {
54 	u64 dma_mask;
55 };
56 
57 #define ARCH_HAS_DMA_GET_REQUIRED_MASK
58 
59 #endif /* _ASM_POWERPC_DEVICE_H */
60