blob: 406c2b1ff82d67fd0465163ce05cfd76961456bb [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
FUJITA Tomonori45223c52009-08-04 19:08:25 +00009struct dma_map_ops;
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110010struct device_node;
Gavin Shancca87d32015-03-17 16:15:02 +110011#ifdef CONFIG_PPC64
12struct pci_dn;
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100013struct iommu_table;
Gavin Shancca87d32015-03-17 16:15:02 +110014#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110015
Nishanth Aravamudanf6aedd82010-10-26 17:35:11 +000016/*
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 Herrenschmidt12d04ee2006-11-11 17:25:02 +110022struct dev_archdata {
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110023 /* DMA operations on that device */
FUJITA Tomonori45223c52009-08-04 19:08:25 +000024 struct dma_map_ops *dma_ops;
Becky Bruce738ef422009-09-21 08:26:35 +000025
26 /*
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100027 * 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 Bruce738ef422009-09-21 08:26:35 +000030 */
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100031 dma_addr_t dma_offset;
32
33#ifdef CONFIG_PPC64
34 struct iommu_table *iommu_table_base;
35#endif
Becky Bruce738ef422009-09-21 08:26:35 +000036
Varun Sethibb917502013-07-15 10:20:55 +053037#ifdef CONFIG_IOMMU_API
38 void *iommu_domain;
39#endif
FUJITA Tomonori762afb72009-08-04 19:08:22 +000040#ifdef CONFIG_SWIOTLB
41 dma_addr_t max_direct_dma_addr;
42#endif
Gavin Shancca87d32015-03-17 16:15:02 +110043#ifdef CONFIG_PPC64
44 struct pci_dn *pci_data;
45#endif
Gavin Shaneb740b52012-02-27 20:04:04 +000046#ifdef CONFIG_EEH
47 struct eeh_dev *edev;
48#endif
Anton Blanchardd6b9a812012-06-24 18:26:17 +000049#ifdef CONFIG_FAIL_IOMMU
50 int fail_iommu;
51#endif
Michael Neulingf46580a2015-05-27 16:06:58 +100052#ifdef CONFIG_CXL_BASE
53 struct cxl_context *cxl_ctx;
54#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110055};
56
Magnus Dammd7aacad2009-07-08 13:21:31 +020057struct pdev_archdata {
Grant Likelycb6dc512010-04-13 16:12:59 -070058 u64 dma_mask;
Magnus Dammd7aacad2009-07-08 13:21:31 +020059};
60
Milton Millerd24f9c62011-06-24 09:05:24 +000061#define ARCH_HAS_DMA_GET_REQUIRED_MASK
62
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110063#endif /* _ASM_POWERPC_DEVICE_H */