Benjamin Herrenschmidt | c6dbaef | 2006-11-11 17:18:39 +1100 | [diff] [blame] | 1 | /* |
| 2 | * Arch specific extensions to struct device |
| 3 | * |
| 4 | * This file is released under the GPLv2 |
| 5 | */ |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 6 | #ifndef _ASM_POWERPC_DEVICE_H |
| 7 | #define _ASM_POWERPC_DEVICE_H |
Benjamin Herrenschmidt | c6dbaef | 2006-11-11 17:18:39 +1100 | [diff] [blame] | 8 | |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 9 | struct device_node; |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 10 | #ifdef CONFIG_PPC64 |
| 11 | struct pci_dn; |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame] | 12 | struct iommu_table; |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 13 | #endif |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 14 | |
Nishanth Aravamudan | f6aedd8 | 2010-10-26 17:35:11 +0000 | [diff] [blame] | 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 | */ |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 21 | struct dev_archdata { |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 22 | /* |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame] | 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. |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 26 | */ |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame] | 27 | dma_addr_t dma_offset; |
| 28 | |
| 29 | #ifdef CONFIG_PPC64 |
| 30 | struct iommu_table *iommu_table_base; |
| 31 | #endif |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 32 | |
Varun Sethi | bb91750 | 2013-07-15 10:20:55 +0530 | [diff] [blame] | 33 | #ifdef CONFIG_IOMMU_API |
| 34 | void *iommu_domain; |
| 35 | #endif |
FUJITA Tomonori | 762afb7 | 2009-08-04 19:08:22 +0000 | [diff] [blame] | 36 | #ifdef CONFIG_SWIOTLB |
| 37 | dma_addr_t max_direct_dma_addr; |
| 38 | #endif |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 39 | #ifdef CONFIG_PPC64 |
| 40 | struct pci_dn *pci_data; |
| 41 | #endif |
Gavin Shan | eb740b5 | 2012-02-27 20:04:04 +0000 | [diff] [blame] | 42 | #ifdef CONFIG_EEH |
| 43 | struct eeh_dev *edev; |
| 44 | #endif |
Anton Blanchard | d6b9a81 | 2012-06-24 18:26:17 +0000 | [diff] [blame] | 45 | #ifdef CONFIG_FAIL_IOMMU |
| 46 | int fail_iommu; |
| 47 | #endif |
Michael Neuling | f46580a | 2015-05-27 16:06:58 +1000 | [diff] [blame] | 48 | #ifdef CONFIG_CXL_BASE |
| 49 | struct cxl_context *cxl_ctx; |
| 50 | #endif |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 51 | }; |
| 52 | |
Magnus Damm | d7aacad | 2009-07-08 13:21:31 +0200 | [diff] [blame] | 53 | struct pdev_archdata { |
Grant Likely | cb6dc51 | 2010-04-13 16:12:59 -0700 | [diff] [blame] | 54 | u64 dma_mask; |
Magnus Damm | d7aacad | 2009-07-08 13:21:31 +0200 | [diff] [blame] | 55 | }; |
| 56 | |
Milton Miller | d24f9c6 | 2011-06-24 09:05:24 +0000 | [diff] [blame] | 57 | #define ARCH_HAS_DMA_GET_REQUIRED_MASK |
| 58 | |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 59 | #endif /* _ASM_POWERPC_DEVICE_H */ |