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 | |
FUJITA Tomonori | 45223c5 | 2009-08-04 19:08:25 +0000 | [diff] [blame] | 9 | struct dma_map_ops; |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 10 | struct device_node; |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 11 | #ifdef CONFIG_PPC64 |
| 12 | struct pci_dn; |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame^] | 13 | struct iommu_table; |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 14 | #endif |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 15 | |
Nishanth Aravamudan | f6aedd8 | 2010-10-26 17:35:11 +0000 | [diff] [blame] | 16 | /* |
| 17 | * Arch extensions to struct device. |
| 18 | * |
| 19 | * When adding fields, consider macio_add_one_device in |
| 20 | * drivers/macintosh/macio_asic.c |
| 21 | */ |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 22 | struct dev_archdata { |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 23 | /* DMA operations on that device */ |
FUJITA Tomonori | 45223c5 | 2009-08-04 19:08:25 +0000 | [diff] [blame] | 24 | struct dma_map_ops *dma_ops; |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 25 | |
| 26 | /* |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame^] | 27 | * These two used to be a union. However, with the hybrid ops we need |
| 28 | * both so here we store both a DMA offset for direct mappings and |
| 29 | * an iommu_table for remapped DMA. |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 30 | */ |
Benjamin Herrenschmidt | 2db4928 | 2015-06-24 15:25:22 +1000 | [diff] [blame^] | 31 | dma_addr_t dma_offset; |
| 32 | |
| 33 | #ifdef CONFIG_PPC64 |
| 34 | struct iommu_table *iommu_table_base; |
| 35 | #endif |
Becky Bruce | 738ef42 | 2009-09-21 08:26:35 +0000 | [diff] [blame] | 36 | |
Varun Sethi | bb91750 | 2013-07-15 10:20:55 +0530 | [diff] [blame] | 37 | #ifdef CONFIG_IOMMU_API |
| 38 | void *iommu_domain; |
| 39 | #endif |
FUJITA Tomonori | 762afb7 | 2009-08-04 19:08:22 +0000 | [diff] [blame] | 40 | #ifdef CONFIG_SWIOTLB |
| 41 | dma_addr_t max_direct_dma_addr; |
| 42 | #endif |
Gavin Shan | cca87d3 | 2015-03-17 16:15:02 +1100 | [diff] [blame] | 43 | #ifdef CONFIG_PPC64 |
| 44 | struct pci_dn *pci_data; |
| 45 | #endif |
Gavin Shan | eb740b5 | 2012-02-27 20:04:04 +0000 | [diff] [blame] | 46 | #ifdef CONFIG_EEH |
| 47 | struct eeh_dev *edev; |
| 48 | #endif |
Anton Blanchard | d6b9a81 | 2012-06-24 18:26:17 +0000 | [diff] [blame] | 49 | #ifdef CONFIG_FAIL_IOMMU |
| 50 | int fail_iommu; |
| 51 | #endif |
Michael Neuling | f46580a | 2015-05-27 16:06:58 +1000 | [diff] [blame] | 52 | #ifdef CONFIG_CXL_BASE |
| 53 | struct cxl_context *cxl_ctx; |
| 54 | #endif |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 55 | }; |
| 56 | |
Magnus Damm | d7aacad | 2009-07-08 13:21:31 +0200 | [diff] [blame] | 57 | struct pdev_archdata { |
Grant Likely | cb6dc51 | 2010-04-13 16:12:59 -0700 | [diff] [blame] | 58 | u64 dma_mask; |
Magnus Damm | d7aacad | 2009-07-08 13:21:31 +0200 | [diff] [blame] | 59 | }; |
| 60 | |
Milton Miller | d24f9c6 | 2011-06-24 09:05:24 +0000 | [diff] [blame] | 61 | #define ARCH_HAS_DMA_GET_REQUIRED_MASK |
| 62 | |
Benjamin Herrenschmidt | 12d04ee | 2006-11-11 17:25:02 +1100 | [diff] [blame] | 63 | #endif /* _ASM_POWERPC_DEVICE_H */ |