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;
|
|
|
|
|
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
|
|
|
|
|
|
|
/*
|
|
|
|
* When an iommu is in use, dma_data is used as a ptr to the base of the
|
|
|
|
* iommu_table. Otherwise, it is a simple numerical offset.
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
dma_addr_t dma_offset;
|
|
|
|
void *iommu_table_base;
|
|
|
|
} dma_data;
|
|
|
|
|
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
|
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
|
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 */
|