2019-06-01 08:08:42 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2006-11-11 06:18:39 +00:00
|
|
|
/*
|
|
|
|
* Arch specific extensions to struct device
|
|
|
|
*/
|
2006-11-11 06:25:02 +00:00
|
|
|
#ifndef _ASM_POWERPC_DEVICE_H
|
|
|
|
#define _ASM_POWERPC_DEVICE_H
|
2006-11-11 06:18:39 +00:00
|
|
|
|
2006-11-11 06:25:02 +00:00
|
|
|
struct device_node;
|
2015-03-17 05:15:02 +00:00
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
struct pci_dn;
|
2015-06-24 05:25:22 +00:00
|
|
|
struct iommu_table;
|
2015-03-17 05:15:02 +00:00
|
|
|
#endif
|
2006-11-11 06:25:02 +00:00
|
|
|
|
2010-10-26 17:35:11 +00:00
|
|
|
/*
|
|
|
|
* Arch extensions to struct device.
|
|
|
|
*
|
|
|
|
* When adding fields, consider macio_add_one_device in
|
|
|
|
* drivers/macintosh/macio_asic.c
|
|
|
|
*/
|
2006-11-11 06:25:02 +00:00
|
|
|
struct dev_archdata {
|
2019-02-13 07:01:05 +00:00
|
|
|
/*
|
|
|
|
* Set to %true if the dma_iommu_ops are requested to use a direct
|
|
|
|
* window instead of dynamically mapping memory.
|
|
|
|
*/
|
|
|
|
bool iommu_bypass : 1;
|
2009-09-21 08:26:35 +00:00
|
|
|
/*
|
2015-06-24 05:25:22 +00: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 08:26:35 +00:00
|
|
|
*/
|
2015-06-24 05:25:22 +00:00
|
|
|
dma_addr_t dma_offset;
|
|
|
|
|
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
struct iommu_table *iommu_table_base;
|
|
|
|
#endif
|
2009-09-21 08:26:35 +00:00
|
|
|
|
2013-07-15 04:50:55 +00:00
|
|
|
#ifdef CONFIG_IOMMU_API
|
|
|
|
void *iommu_domain;
|
|
|
|
#endif
|
2015-03-17 05:15:02 +00: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-27 20:04:04 +00:00
|
|
|
#ifdef CONFIG_EEH
|
|
|
|
struct eeh_dev *edev;
|
|
|
|
#endif
|
2012-06-24 18:26:17 +00:00
|
|
|
#ifdef CONFIG_FAIL_IOMMU
|
|
|
|
int fail_iommu;
|
|
|
|
#endif
|
2015-05-27 06:06:58 +00:00
|
|
|
#ifdef CONFIG_CXL_BASE
|
|
|
|
struct cxl_context *cxl_ctx;
|
|
|
|
#endif
|
2006-11-11 06:25:02 +00:00
|
|
|
};
|
|
|
|
|
2009-07-08 11:21:31 +00:00
|
|
|
struct pdev_archdata {
|
2010-04-13 23:12:59 +00:00
|
|
|
u64 dma_mask;
|
2009-07-08 11:21:31 +00:00
|
|
|
};
|
|
|
|
|
2006-11-11 06:25:02 +00:00
|
|
|
#endif /* _ASM_POWERPC_DEVICE_H */
|