blob: 266542769e4bd182a01324b5ea66b612793ca465 [file] [log] [blame]
Thomas Gleixner55716d22019-06-01 10:08:42 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11002/*
3 * Arch specific extensions to struct device
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11004 */
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +11005#ifndef _ASM_POWERPC_DEVICE_H
6#define _ASM_POWERPC_DEVICE_H
Benjamin Herrenschmidtc6dbaef2006-11-11 17:18:39 +11007
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +11008struct device_node;
Gavin Shancca87d32015-03-17 16:15:02 +11009#ifdef CONFIG_PPC64
10struct pci_dn;
Benjamin Herrenschmidt2db49282015-06-24 15:25:22 +100011struct iommu_table;
Gavin Shancca87d32015-03-17 16:15:02 +110012#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110013
Nishanth Aravamudanf6aedd82010-10-26 17:35:11 +000014/*
15 * Arch extensions to struct device.
16 *
17 * When adding fields, consider macio_add_one_device in
18 * drivers/macintosh/macio_asic.c
19 */
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110020struct dev_archdata {
Becky Bruce738ef422009-09-21 08:26:35 +000021 /*
Christoph Hellwig8617a5c2019-02-13 08:01:05 +010022 * Set to %true if the dma_iommu_ops are requested to use a direct
23 * window instead of dynamically mapping memory.
24 */
25 bool iommu_bypass : 1;
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
Gavin Shancca87d32015-03-17 16:15:02 +110040#ifdef CONFIG_PPC64
41 struct pci_dn *pci_data;
42#endif
Gavin Shaneb740b52012-02-27 20:04:04 +000043#ifdef CONFIG_EEH
44 struct eeh_dev *edev;
45#endif
Anton Blanchardd6b9a812012-06-24 18:26:17 +000046#ifdef CONFIG_FAIL_IOMMU
47 int fail_iommu;
48#endif
Michael Neulingf46580a2015-05-27 16:06:58 +100049#ifdef CONFIG_CXL_BASE
50 struct cxl_context *cxl_ctx;
51#endif
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110052};
53
Magnus Dammd7aacad2009-07-08 13:21:31 +020054struct pdev_archdata {
Grant Likelycb6dc512010-04-13 16:12:59 -070055 u64 dma_mask;
Magnus Dammd7aacad2009-07-08 13:21:31 +020056};
57
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110058#endif /* _ASM_POWERPC_DEVICE_H */