diff options
author | Jake Oshins <jakeo@microsoft.com> | 2016-02-16 16:56:21 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-02-16 17:48:11 -0500 |
commit | 92016ba5c1d71fbe4e9952df518b5386f2a0556b (patch) | |
tree | fb7d4f6f944c1a91a55b340865e7f134ad2d70e8 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
PCI: Add fwnode_handle to x86 pci_sysdata
Add an fwnode_handle to the x86 struct pci_sysdata, which will be used to
locate an IRQ domain associated with a root PCI bus.
[bhelgaas: changelog]
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/x86/include/asm/pci.h | 15 | ||||
-rw-r--r-- | include/linux/pci.h | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 462594320d39..6fc3c7c554b2 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -20,6 +20,9 @@ struct pci_sysdata { | |||
20 | #ifdef CONFIG_X86_64 | 20 | #ifdef CONFIG_X86_64 |
21 | void *iommu; /* IOMMU private data */ | 21 | void *iommu; /* IOMMU private data */ |
22 | #endif | 22 | #endif |
23 | #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN | ||
24 | void *fwnode; /* IRQ domain for MSI assignment */ | ||
25 | #endif | ||
23 | }; | 26 | }; |
24 | 27 | ||
25 | extern int pci_routeirq; | 28 | extern int pci_routeirq; |
@@ -32,6 +35,7 @@ extern int noioapicreroute; | |||
32 | static inline int pci_domain_nr(struct pci_bus *bus) | 35 | static inline int pci_domain_nr(struct pci_bus *bus) |
33 | { | 36 | { |
34 | struct pci_sysdata *sd = bus->sysdata; | 37 | struct pci_sysdata *sd = bus->sysdata; |
38 | |||
35 | return sd->domain; | 39 | return sd->domain; |
36 | } | 40 | } |
37 | 41 | ||
@@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
41 | } | 45 | } |
42 | #endif | 46 | #endif |
43 | 47 | ||
48 | #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN | ||
49 | static inline void *_pci_root_bus_fwnode(struct pci_bus *bus) | ||
50 | { | ||
51 | struct pci_sysdata *sd = bus->sysdata; | ||
52 | |||
53 | return sd->fwnode; | ||
54 | } | ||
55 | |||
56 | #define pci_root_bus_fwnode _pci_root_bus_fwnode | ||
57 | #endif | ||
58 | |||
44 | /* Can be used to override the logic in pci_scan_bus for skipping | 59 | /* Can be used to override the logic in pci_scan_bus for skipping |
45 | already-configured bus numbers - to be used for buggy BIOSes | 60 | already-configured bus numbers - to be used for buggy BIOSes |
46 | or architectures with incomplete PCI setup by the loader */ | 61 | or architectures with incomplete PCI setup by the loader */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 27df4a6585da..1bb44af6c9f0 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1515,6 +1515,10 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } | |||
1515 | 1515 | ||
1516 | #include <asm/pci.h> | 1516 | #include <asm/pci.h> |
1517 | 1517 | ||
1518 | #ifndef pci_root_bus_fwnode | ||
1519 | #define pci_root_bus_fwnode(bus) NULL | ||
1520 | #endif | ||
1521 | |||
1518 | /* these helpers provide future and backwards compatibility | 1522 | /* these helpers provide future and backwards compatibility |
1519 | * for accessing popular PCI BAR info */ | 1523 | * for accessing popular PCI BAR info */ |
1520 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1524 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |