2006-11-11 14:18:39 +08:00
|
|
|
/*
|
|
|
|
* Arch specific extensions to struct device
|
|
|
|
*
|
|
|
|
* This file is released under the GPLv2
|
|
|
|
*/
|
2006-11-11 14:25:02 +08:00
|
|
|
#ifndef _ASM_POWERPC_DEVICE_H
|
|
|
|
#define _ASM_POWERPC_DEVICE_H
|
2006-11-11 14:18:39 +08:00
|
|
|
|
2009-08-05 03:08:25 +08:00
|
|
|
struct dma_map_ops;
|
2006-11-11 14:25:02 +08:00
|
|
|
struct device_node;
|
2015-03-17 13:15:02 +08:00
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
struct pci_dn;
|
2015-06-24 13:25:22 +08:00
|
|
|
struct iommu_table;
|
2015-03-17 13:15:02 +08:00
|
|
|
#endif
|
2006-11-11 14:25:02 +08:00
|
|
|
|
2010-10-27 01:35:11 +08:00
|
|
|
/*
|
|
|
|
* Arch extensions to struct device.
|
|
|
|
*
|
|
|
|
* When adding fields, consider macio_add_one_device in
|
|
|
|
* drivers/macintosh/macio_asic.c
|
|
|
|
*/
|
2006-11-11 14:25:02 +08:00
|
|
|
struct dev_archdata {
|
|
|
|
/* DMA operations on that device */
|
2009-08-05 03:08:25 +08:00
|
|
|
struct dma_map_ops *dma_ops;
|
2009-09-21 16:26:35 +08:00
|
|
|
|
|
|
|
/*
|
2015-06-24 13:25:22 +08:00
|
|
|
* These two used to be a union. However, with the hybrid ops we need
|
|
|
|
* both so here we store both a DMA offset for direct mappings and
|
|
|
|
* an iommu_table for remapped DMA.
|
2009-09-21 16:26:35 +08:00
|
|
|
*/
|
2015-06-24 13:25:22 +08:00
|
|
|
dma_addr_t dma_offset;
|
|
|
|
|
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
struct iommu_table *iommu_table_base;
|
|
|
|
#endif
|
2009-09-21 16:26:35 +08:00
|
|
|
|
2013-07-15 12:50:55 +08:00
|
|
|
#ifdef CONFIG_IOMMU_API
|
|
|
|
void *iommu_domain;
|
|
|
|
#endif
|
2009-08-05 03:08:22 +08:00
|
|
|
#ifdef CONFIG_SWIOTLB
|
|
|
|
dma_addr_t max_direct_dma_addr;
|
|
|
|
#endif
|
2015-03-17 13:15:02 +08:00
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
struct pci_dn *pci_data;
|
|
|
|
#endif
|
powerpc/eeh: Introduce EEH device
Original EEH implementation depends on struct pci_dn heavily. However,
EEH shouldn't depend on that actually because EEH needn't share much
information with other PCI components. That's to say, EEH should have
worked independently.
The patch introduces struct eeh_dev so that EEH core components needn't
be working based on struct pci_dn in future. Also, struct pci_dn, struct
eeh_dev instances are created in dynamic fasion and the binding with EEH
device, OF node, PCI device is implemented as well.
The EEH devices are created after PHBs are detected and initialized, but
PCI emunation hasn't started yet. Apart from that, PHB might be created
dynamically through DLPAR component and the EEH devices should be creatd
as well. Another case might be OF node is created dynamically by DR
(Dynamic Reconfiguration), which has been defined by PAPR. For those OF
nodes created by DR, EEH devices should be also created accordingly. The
binding between EEH device and OF node is done while the EEH device is
initially created.
The binding between EEH device and PCI device should be done after PCI
emunation is done. Besides, PCI hotplug also needs the binding so that
the EEH devices could be traced from the newly coming PCI buses or PCI
devices.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-28 04:04:04 +08:00
|
|
|
#ifdef CONFIG_EEH
|
|
|
|
struct eeh_dev *edev;
|
|
|
|
#endif
|
2012-06-25 02:26:17 +08:00
|
|
|
#ifdef CONFIG_FAIL_IOMMU
|
|
|
|
int fail_iommu;
|
|
|
|
#endif
|
2015-05-27 14:06:58 +08:00
|
|
|
#ifdef CONFIG_CXL_BASE
|
|
|
|
struct cxl_context *cxl_ctx;
|
|
|
|
#endif
|
2006-11-11 14:25:02 +08:00
|
|
|
};
|
|
|
|
|
2009-07-08 19:21:31 +08:00
|
|
|
struct pdev_archdata {
|
2010-04-14 07:12:59 +08:00
|
|
|
u64 dma_mask;
|
2009-07-08 19:21:31 +08:00
|
|
|
};
|
|
|
|
|
2011-06-24 17:05:24 +08:00
|
|
|
#define ARCH_HAS_DMA_GET_REQUIRED_MASK
|
|
|
|
|
2006-11-11 14:25:02 +08:00
|
|
|
#endif /* _ASM_POWERPC_DEVICE_H */
|