]> asedeno.scripts.mit.edu Git - linux.git/blob - arch/powerpc/include/asm/device.h
1aa53318b4bcfe474e3bdee1f2119737b20347df
[linux.git] / arch / powerpc / include / asm / device.h
1 /*
2  * Arch specific extensions to struct device
3  *
4  * This file is released under the GPLv2
5  */
6 #ifndef _ASM_POWERPC_DEVICE_H
7 #define _ASM_POWERPC_DEVICE_H
8
9 struct device_node;
10 #ifdef CONFIG_PPC64
11 struct pci_dn;
12 struct iommu_table;
13 #endif
14
15 /*
16  * Arch extensions to struct device.
17  *
18  * When adding fields, consider macio_add_one_device in
19  * drivers/macintosh/macio_asic.c
20  */
21 struct dev_archdata {
22         /*
23          * Set to %true if the dma_iommu_ops are requested to use a direct
24          * window instead of dynamically mapping memory.
25          */
26         bool                    iommu_bypass : 1;
27         /*
28          * These two used to be a union. However, with the hybrid ops we need
29          * both so here we store both a DMA offset for direct mappings and
30          * an iommu_table for remapped DMA.
31          */
32         dma_addr_t              dma_offset;
33
34 #ifdef CONFIG_PPC64
35         struct iommu_table      *iommu_table_base;
36 #endif
37
38 #ifdef CONFIG_IOMMU_API
39         void                    *iommu_domain;
40 #endif
41 #ifdef CONFIG_SWIOTLB
42         dma_addr_t              max_direct_dma_addr;
43 #endif
44 #ifdef CONFIG_PPC64
45         struct pci_dn           *pci_data;
46 #endif
47 #ifdef CONFIG_EEH
48         struct eeh_dev          *edev;
49 #endif
50 #ifdef CONFIG_FAIL_IOMMU
51         int fail_iommu;
52 #endif
53 #ifdef CONFIG_CXL_BASE
54         struct cxl_context      *cxl_ctx;
55 #endif
56 };
57
58 struct pdev_archdata {
59         u64 dma_mask;
60 };
61
62 #define ARCH_HAS_DMA_GET_REQUIRED_MASK
63
64 #endif /* _ASM_POWERPC_DEVICE_H */