diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-09-29 10:29:26 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-30 19:08:57 -0400 |
commit | 670ba0c8883b576d0aec28bd7a838358a4be1406 (patch) | |
tree | fd0b13325b9c832f5d56a969d154d5d4a235b6c2 /include/linux/pci.h | |
parent | 0b0b0893d49b34201a6c4416b1a707b580b91e3d (diff) |
PCI: Add generic domain handling
The handling of PCI domains (or PCI segments in ACPI speak) is usually a
straightforward affair but its implementation is currently left to the
architectural code, with pci_domain_nr(b) querying the value of the domain
associated with bus b.
This patch introduces CONFIG_PCI_DOMAINS_GENERIC as an option that can be
selected if an architecture wants a simple implementation where the value
of the domain associated with a bus is stored in struct pci_bus.
The architectures that select CONFIG_PCI_DOMAINS_GENERIC will then have to
implement pci_bus_assign_domain_nr() as a way of setting the domain number
associated with a root bus. All child buses except the root bus will
inherit the domain_nr value from their parent.
Signed-off-by: Catalin Marinas <Catalin.Marinas@arm.com>
[Renamed pci_set_domain_nr() to pci_bus_assign_domain_nr()]
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 61978a460841..a494e5d775c3 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 | ||
@@ -1288,6 +1291,24 @@ static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } | |||
1288 | static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } | 1291 | static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } |
1289 | #endif /* CONFIG_PCI_DOMAINS */ | 1292 | #endif /* CONFIG_PCI_DOMAINS */ |
1290 | 1293 | ||
1294 | /* | ||
1295 | * Generic implementation for PCI domain support. If your | ||
1296 | * architecture does not need custom management of PCI | ||
1297 | * domains then this implementation will be used | ||
1298 | */ | ||
1299 | #ifdef CONFIG_PCI_DOMAINS_GENERIC | ||
1300 | static inline int pci_domain_nr(struct pci_bus *bus) | ||
1301 | { | ||
1302 | return bus->domain_nr; | ||
1303 | } | ||
1304 | void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent); | ||
1305 | #else | ||
1306 | static inline void pci_bus_assign_domain_nr(struct pci_bus *bus, | ||
1307 | struct device *parent) | ||
1308 | { | ||
1309 | } | ||
1310 | #endif | ||
1311 | |||
1291 | /* some architectures require additional setup to direct VGA traffic */ | 1312 | /* some architectures require additional setup to direct VGA traffic */ |
1292 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | 1313 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, |
1293 | unsigned int command_bits, u32 flags); | 1314 | unsigned int command_bits, u32 flags); |