blob: 0245bfcaac324c4ed0f42af59f8c25ab486a2b5e [file] [log] [blame]
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11001/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +11006#ifndef _ASM_POWERPC_DEVICE_H
7#define _ASM_POWERPC_DEVICE_H
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11008
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +11009struct device_node;
Gavin Shancca87d32015-03-17 16:15:02 +110010#ifdef CONFIG_PPC64
11struct pci_dn;
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100012struct iommu_table;
Gavin Shancca87d32015-03-17 16:15:02 +110013#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110014
Nishanth Aravamudanf6aedd82010-10-26 17:35:11 +000015/*
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 Herrenschmidt12d04ee2006-11-11 17:25:02 +110021struct dev_archdata {
Becky Bruce738ef422009-09-21 08:26:35 +000022 /*
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100023 * 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 Bruce738ef422009-09-21 08:26:35 +000026 */
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100027 dma_addr_t dma_offset;
28
29#ifdef CONFIG_PPC64
30 struct iommu_table *iommu_table_base;
31#endif
Becky Bruce738ef422009-09-21 08:26:35 +000032
Varun Sethibb917502013-07-15 10:20:55 +053033#ifdef CONFIG_IOMMU_API
34 void *iommu_domain;
35#endif
FUJITA Tomonori762afb72009-08-04 19:08:22 +000036#ifdef CONFIG_SWIOTLB
37 dma_addr_t max_direct_dma_addr;
38#endif
Gavin Shancca87d32015-03-17 16:15:02 +110039#ifdef CONFIG_PPC64
40 struct pci_dn *pci_data;
41#endif
Gavin Shaneb740b52012-02-27 20:04:04 +000042#ifdef CONFIG_EEH
43 struct eeh_dev *edev;
44#endif
Anton Blanchardd6b9a812012-06-24 18:26:17 +000045#ifdef CONFIG_FAIL_IOMMU
46 int fail_iommu;
47#endif
Michael Neulingf46580a2015-05-27 16:06:58 +100048#ifdef CONFIG_CXL_BASE
49 struct cxl_context *cxl_ctx;
50#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110051};
52
Magnus Dammd7aacad2009-07-08 13:21:31 +020053struct pdev_archdata {
Grant Likelycb6dc512010-04-13 16:12:59 -070054 u64 dma_mask;
Magnus Dammd7aacad2009-07-08 13:21:31 +020055};
56
Milton Millerd24f9c62011-06-24 09:05:24 +000057#define ARCH_HAS_DMA_GET_REQUIRED_MASK
58
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110059#endif /* _ASM_POWERPC_DEVICE_H */