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 * Set to %true if the dma_iommu_ops are requested to use a direct 24 * window instead of dynamically mapping memory. 25 */ 26 bool iommu_bypass : 1; 27 /* 28 * These two used to be a union. However, with the hybrid ops we need 29 * both so here we store both a DMA offset for direct mappings and 30 * an iommu_table for remapped DMA. 31 */ 32 dma_addr_t dma_offset; 33 34 #ifdef CONFIG_PPC64 35 struct iommu_table *iommu_table_base; 36 #endif 37 38 #ifdef CONFIG_IOMMU_API 39 void *iommu_domain; 40 #endif 41 #ifdef CONFIG_PPC64 42 struct pci_dn *pci_data; 43 #endif 44 #ifdef CONFIG_EEH 45 struct eeh_dev *edev; 46 #endif 47 #ifdef CONFIG_FAIL_IOMMU 48 int fail_iommu; 49 #endif 50 #ifdef CONFIG_CXL_BASE 51 struct cxl_context *cxl_ctx; 52 #endif 53 }; 54 55 struct pdev_archdata { 56 u64 dma_mask; 57 }; 58 59 #endif /* _ASM_POWERPC_DEVICE_H */ 60