forked from mirrors/linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJaDFIdAAoJEFmIoMA60/r8Jg4P/3IrmMNVnpqmYEZ7lRSW7UQ3
8jtupbzIkbPsIAEhbJ7xqO7zKx85j6Og+ZSOv4a8u/tS6cd1aVZu2PpWsTkacez0
7nLGVCSL3HZi5qcrtOvb2Pmke18SUKSPxVYSgS2ajQavB1oKaY03FbHDWyWidCZx
qxkeGZOiUDw5kSGkQWyks1WgB0dd76rVbPcrKKEJueGgrdSm+EdgdDv8eT6bZInZ
uMrCmSjNYTQP0KASCJJvgYOtJbdwvP6NuQTxzOlU2G+H2SqsLRjsz4UUR8FF06T5
cndpgpG3QSAZLx7wCeWTvRorTEYORzKMoyw/AUjhiGbRep9Zw0aKNvCC99E6xjyD
FECrk6kCrqZs7l+LVXK4SwpBXCVjNgRoFAHBEKF2X3/SWUkUhHXZHCVvMQB8LQiS
2p8VRoYWw2aCLkHCGynuzToUrD2P2Pjxe5n/13aYVJkyBNfQqqZ3l2YHiZdpDO3j
rgG6RW0WCrpZxfb/0WAbPnQ2qpZAwDPO6hOW7dIfTZabFVXRIkBvNq53by/0MxvP
jyOcMTsq2l8y46f3VgNPUAHj0f52HwfZA3PQRPh+MQDz5385BJklDRWtfVM7cQx9
IoeGkq1zLLvpOh63he/jnnRELxDvNVcxND8lOkenJlObj9kK63hUEcXg/zEMS4w3
oetLw9TqE32Jb7GfpVSw
=j4L3
-----END PGP SIGNATURE-----
Merge tag 'pci-v4.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
- detach driver before tearing down procfs/sysfs (Alex Williamson)
- disable PCIe services during shutdown (Sinan Kaya)
- fix ASPM oops on systems with no Root Ports (Ard Biesheuvel)
- fix ASPM LTR_L1.2_THRESHOLD programming (Bjorn Helgaas)
- fix ASPM Common_Mode_Restore_Time computation (Bjorn Helgaas)
- fix portdrv MSI/MSI-X vector allocation (Dongdong Liu, Bjorn
Helgaas)
- report non-fatal AER errors only to the affected endpoint (Gabriele
Paoloni)
- distribute bus numbers, MMIO, and I/O space among hotplug bridges to
allow more devices to be hot-added (Mika Westerberg)
- fix pciehp races during initialization and surprise link down (Mika
Westerberg)
- handle surprise-removed devices in PME handling (Qiang)
- support resizable BARs for large graphics devices (Christian König)
- expose SR-IOV offset, stride, and VF device ID via sysfs (Filippo
Sironi)
- create SR-IOV virtfn/physfn sysfs links before attaching driver
(Stuart Hayes)
- fix SR-IOV "ARI Capable Hierarchy" restore issue (Tony Nguyen)
- enforce Kconfig IOV/REALLOC dependency (Sascha El-Sharkawy)
- avoid slot reset if bridge itself is broken (Jan Glauber)
- clean up pci_reset_function() path (Jan H. Schönherr)
- make pci_map_rom() fail if the option ROM is invalid (Changbin Du)
- convert timers to timer_setup() (Kees Cook)
- move PCI_QUIRKS to PCI bus Kconfig menu (Randy Dunlap)
- constify pci_dev_type and intel_mid_pci_ops (Bhumika Goyal)
- remove unnecessary pci_dev, pci_bus, resource, pcibios_set_master()
declarations (Bjorn Helgaas)
- fix endpoint framework overflows and BUG()s (Dan Carpenter)
- fix endpoint framework issues (Kishon Vijay Abraham I)
- avoid broken Cavium CN8xxx bus reset behavior (David Daney)
- extend Cavium ACS capability quirks (Vadim Lomovtsev)
- support Synopsys DesignWare RC in ECAM mode (Ard Biesheuvel)
- turn off dra7xx clocks cleanly on shutdown (Keerthy)
- fix Faraday probe error path (Wei Yongjun)
- support HiSilicon STB SoC PCIe host controller (Jianguo Sun)
- fix Hyper-V interrupt affinity issue (Dexuan Cui)
- remove useless ACPI warning for Hyper-V pass-through devices (Vitaly
Kuznetsov)
- support multiple MSI on iProc (Sandor Bodo-Merle)
- support Layerscape LS1012a and LS1046a PCIe host controllers (Hou
Zhiqiang)
- fix Layerscape default error response (Minghuan Lian)
- support MSI on Tango host controller (Marc Gonzalez)
- support Tegra186 PCIe host controller (Manikanta Maddireddy)
- use generic accessors on Tegra when possible (Thierry Reding)
- support V3 Semiconductor PCI host controller (Linus Walleij)
* tag 'pci-v4.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (85 commits)
PCI/ASPM: Add L1 Substates definitions
PCI/ASPM: Reformat ASPM register definitions
PCI/ASPM: Use correct capability pointer to program LTR_L1.2_THRESHOLD
PCI/ASPM: Account for downstream device's Port Common_Mode_Restore_Time
PCI: xgene: Rename xgene_pcie_probe_bridge() to xgene_pcie_probe()
PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up()
PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()
PCI: Fix kernel-doc build warning
PCI: Fail pci_map_rom() if the option ROM is invalid
PCI: Move pci_map_rom() error path
PCI: Move PCI_QUIRKS to the PCI bus menu
alpha/PCI: Make pdev_save_srm_config() static
PCI: Remove unused declarations
PCI: Remove redundant pci_dev, pci_bus, resource declarations
PCI: Remove redundant pcibios_set_master() declarations
PCI/PME: Handle invalid data when reading Root Status
PCI: hv: Use effective affinity mask
PCI: pciehp: Do not clear Presence Detect Changed during initialization
PCI: pciehp: Fix race condition handling surprise link down
PCI: Distribute available resources to hotplug-capable bridges
...
165 lines
4.5 KiB
C
165 lines
4.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __OF_ADDRESS_H
|
|
#define __OF_ADDRESS_H
|
|
#include <linux/ioport.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/of.h>
|
|
#include <linux/io.h>
|
|
|
|
struct of_pci_range_parser {
|
|
struct device_node *node;
|
|
const __be32 *range;
|
|
const __be32 *end;
|
|
int np;
|
|
int pna;
|
|
};
|
|
|
|
struct of_pci_range {
|
|
u32 pci_space;
|
|
u64 pci_addr;
|
|
u64 cpu_addr;
|
|
u64 size;
|
|
u32 flags;
|
|
};
|
|
|
|
#define for_each_of_pci_range(parser, range) \
|
|
for (; of_pci_range_parser_one(parser, range);)
|
|
|
|
/* Translate a DMA address from device space to CPU space */
|
|
extern u64 of_translate_dma_address(struct device_node *dev,
|
|
const __be32 *in_addr);
|
|
|
|
#ifdef CONFIG_OF_ADDRESS
|
|
extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
|
|
extern int of_address_to_resource(struct device_node *dev, int index,
|
|
struct resource *r);
|
|
extern struct device_node *of_find_matching_node_by_address(
|
|
struct device_node *from,
|
|
const struct of_device_id *matches,
|
|
u64 base_address);
|
|
extern void __iomem *of_iomap(struct device_node *device, int index);
|
|
void __iomem *of_io_request_and_map(struct device_node *device,
|
|
int index, const char *name);
|
|
|
|
/* Extract an address from a device, returns the region size and
|
|
* the address space flags too. The PCI version uses a BAR number
|
|
* instead of an absolute index
|
|
*/
|
|
extern const __be32 *of_get_address(struct device_node *dev, int index,
|
|
u64 *size, unsigned int *flags);
|
|
|
|
extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
|
|
struct device_node *node);
|
|
extern int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser,
|
|
struct device_node *node);
|
|
extern struct of_pci_range *of_pci_range_parser_one(
|
|
struct of_pci_range_parser *parser,
|
|
struct of_pci_range *range);
|
|
extern int of_dma_get_range(struct device_node *np, u64 *dma_addr,
|
|
u64 *paddr, u64 *size);
|
|
extern bool of_dma_is_coherent(struct device_node *np);
|
|
#else /* CONFIG_OF_ADDRESS */
|
|
static inline void __iomem *of_io_request_and_map(struct device_node *device,
|
|
int index, const char *name)
|
|
{
|
|
return IOMEM_ERR_PTR(-EINVAL);
|
|
}
|
|
|
|
static inline u64 of_translate_address(struct device_node *np,
|
|
const __be32 *addr)
|
|
{
|
|
return OF_BAD_ADDR;
|
|
}
|
|
|
|
static inline struct device_node *of_find_matching_node_by_address(
|
|
struct device_node *from,
|
|
const struct of_device_id *matches,
|
|
u64 base_address)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline const __be32 *of_get_address(struct device_node *dev, int index,
|
|
u64 *size, unsigned int *flags)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser,
|
|
struct device_node *node)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser,
|
|
struct device_node *node)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline struct of_pci_range *of_pci_range_parser_one(
|
|
struct of_pci_range_parser *parser,
|
|
struct of_pci_range *range)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr,
|
|
u64 *paddr, u64 *size)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline bool of_dma_is_coherent(struct device_node *np)
|
|
{
|
|
return false;
|
|
}
|
|
#endif /* CONFIG_OF_ADDRESS */
|
|
|
|
#ifdef CONFIG_OF
|
|
extern int of_address_to_resource(struct device_node *dev, int index,
|
|
struct resource *r);
|
|
void __iomem *of_iomap(struct device_node *node, int index);
|
|
#else
|
|
static inline int of_address_to_resource(struct device_node *dev, int index,
|
|
struct resource *r)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline void __iomem *of_iomap(struct device_node *device, int index)
|
|
{
|
|
return NULL;
|
|
}
|
|
#endif
|
|
|
|
#if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)
|
|
extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
|
|
u64 *size, unsigned int *flags);
|
|
extern int of_pci_address_to_resource(struct device_node *dev, int bar,
|
|
struct resource *r);
|
|
extern int of_pci_range_to_resource(struct of_pci_range *range,
|
|
struct device_node *np,
|
|
struct resource *res);
|
|
#else /* CONFIG_OF_ADDRESS && CONFIG_PCI */
|
|
static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
|
|
struct resource *r)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline const __be32 *of_get_pci_address(struct device_node *dev,
|
|
int bar_no, u64 *size, unsigned int *flags)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline int of_pci_range_to_resource(struct of_pci_range *range,
|
|
struct device_node *np,
|
|
struct resource *res)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
#endif /* CONFIG_OF_ADDRESS && CONFIG_PCI */
|
|
|
|
#endif /* __OF_ADDRESS_H */
|
|
|