blob: 266542769e4bd182a01324b5ea66b612793ca465 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Arch specific extensions to struct device
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5#ifndef _ASM_POWERPC_DEVICE_H
6#define _ASM_POWERPC_DEVICE_H
7
8struct device_node;
9#ifdef CONFIG_PPC64
10struct pci_dn;
11struct iommu_table;
12#endif
13
14/*
15 * Arch extensions to struct device.
16 *
17 * When adding fields, consider macio_add_one_device in
18 * drivers/macintosh/macio_asic.c
19 */
20struct dev_archdata {
21 /*
David Brazdil0f672f62019-12-10 10:32:29 +000022 * 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 /*
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000027 * 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.
30 */
31 dma_addr_t dma_offset;
32
33#ifdef CONFIG_PPC64
34 struct iommu_table *iommu_table_base;
35#endif
36
37#ifdef CONFIG_IOMMU_API
38 void *iommu_domain;
39#endif
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000040#ifdef CONFIG_PPC64
41 struct pci_dn *pci_data;
42#endif
43#ifdef CONFIG_EEH
44 struct eeh_dev *edev;
45#endif
46#ifdef CONFIG_FAIL_IOMMU
47 int fail_iommu;
48#endif
49#ifdef CONFIG_CXL_BASE
50 struct cxl_context *cxl_ctx;
51#endif
52};
53
54struct pdev_archdata {
55 u64 dma_mask;
56};
57
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000058#endif /* _ASM_POWERPC_DEVICE_H */