aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-10-01 14:31:23 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-10-01 14:31:23 -0400
commit07a7cbd3b815ea77b44d4d5bb4260b37d03a358d (patch)
tree7b205e495fff1e1548cac893264cfdfe18ac34dd /include/linux/pci.h
parentcc0cb67adb97793e76bf6f1f6e05694f6311cebd (diff)
parentd1e6dc91b532d3d3dbbd0fa356b775ca320dc2c2 (diff)
Merge branch 'pci/host-generic' into next
* pci/host-generic: arm64: Add architectural support for PCI PCI: Add pci_remap_iospace() to map bus I/O resources of/pci: Add support for parsing PCI host bridge resources from DT of/pci: Add pci_get_new_domain_nr() and of_get_pci_domain_nr() PCI: Add generic domain handling of/pci: Fix the conversion of IO ranges into IO resources of/pci: Move of_pci_range_to_resource() to of/address.c ARM: Define PCI_IOBASE as the base of virtual PCI IO space of/pci: Add pci_register_io_range() and pci_pio_to_address() asm-generic/io.h: Fix ioport_map() for !CONFIG_GENERIC_IOMAP Conflicts: drivers/pci/host/pci-tegra.c
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ef98f73ea618..9cd27210a889 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -456,6 +456,9 @@ struct pci_bus {
456 unsigned char primary; /* number of primary bridge */ 456 unsigned char primary; /* number of primary bridge */
457 unsigned char max_bus_speed; /* enum pci_bus_speed */ 457 unsigned char max_bus_speed; /* enum pci_bus_speed */
458 unsigned char cur_bus_speed; /* enum pci_bus_speed */ 458 unsigned char cur_bus_speed; /* enum pci_bus_speed */
459#ifdef CONFIG_PCI_DOMAINS_GENERIC
460 int domain_nr;
461#endif
459 462
460 char name[48]; 463 char name[48];
461 464
@@ -1097,6 +1100,9 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1097 resource_size_t), 1100 resource_size_t),
1098 void *alignf_data); 1101 void *alignf_data);
1099 1102
1103
1104int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr);
1105
1100static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) 1106static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
1101{ 1107{
1102 struct pci_bus_region region; 1108 struct pci_bus_region region;
@@ -1282,12 +1288,32 @@ void pci_cfg_access_unlock(struct pci_dev *dev);
1282 */ 1288 */
1283#ifdef CONFIG_PCI_DOMAINS 1289#ifdef CONFIG_PCI_DOMAINS
1284extern int pci_domains_supported; 1290extern int pci_domains_supported;
1291int pci_get_new_domain_nr(void);
1285#else 1292#else
1286enum { pci_domains_supported = 0 }; 1293enum { pci_domains_supported = 0 };
1287static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 1294static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1288static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } 1295static inline int pci_proc_domain(struct pci_bus *bus) { return 0; }
1296static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
1289#endif /* CONFIG_PCI_DOMAINS */ 1297#endif /* CONFIG_PCI_DOMAINS */
1290 1298
1299/*
1300 * Generic implementation for PCI domain support. If your
1301 * architecture does not need custom management of PCI
1302 * domains then this implementation will be used
1303 */
1304#ifdef CONFIG_PCI_DOMAINS_GENERIC
1305static inline int pci_domain_nr(struct pci_bus *bus)
1306{
1307 return bus->domain_nr;
1308}
1309void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent);
1310#else
1311static inline void pci_bus_assign_domain_nr(struct pci_bus *bus,
1312 struct device *parent)
1313{
1314}
1315#endif
1316
1291/* some architectures require additional setup to direct VGA traffic */ 1317/* some architectures require additional setup to direct VGA traffic */
1292typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1318typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1293 unsigned int command_bits, u32 flags); 1319 unsigned int command_bits, u32 flags);
@@ -1396,6 +1422,7 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1396 1422
1397static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 1423static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1398static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } 1424static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
1425static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
1399 1426
1400#define dev_is_pci(d) (false) 1427#define dev_is_pci(d) (false)
1401#define dev_is_pf(d) (false) 1428#define dev_is_pf(d) (false)