diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-19 22:54:49 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:08 -0500 |
commit | fa462f2d75e2437b5757069d3d7d27b1e50285cb (patch) | |
tree | dc872ff52a3225a3ef134105e74a528e5983fe8d | |
parent | 853ad6c2e752215237e7fb26d681ed0008dd081a (diff) |
[POWERPC] pci32: Add platform option to enable /proc PCI domains
This adds flags the platforms can use to enable domain numbers
in /proc/bus/pci.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 16 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 8 | ||||
-rw-r--r-- | include/asm-powerpc/pci-bridge.h | 5 | ||||
-rw-r--r-- | include/asm-powerpc/pci.h | 14 |
4 files changed, 25 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 9979c43cc8c7..68102ce7e438 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -639,3 +639,19 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
639 | hose->mem_resources[memno-1] = tmp; | 639 | hose->mem_resources[memno-1] = tmp; |
640 | } | 640 | } |
641 | } | 641 | } |
642 | |||
643 | /* Decide whether to display the domain number in /proc */ | ||
644 | int pci_proc_domain(struct pci_bus *bus) | ||
645 | { | ||
646 | struct pci_controller *hose = pci_bus_to_host(bus); | ||
647 | #ifdef CONFIG_PPC64 | ||
648 | return hose->buid != 0; | ||
649 | #else | ||
650 | if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS)) | ||
651 | return 0; | ||
652 | if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0) | ||
653 | return hose->global_number != 0; | ||
654 | return 1; | ||
655 | #endif | ||
656 | } | ||
657 | |||
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 3e7cf7af3bf3..e0f3731c3a1c 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -586,14 +586,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
586 | return 0; | 586 | return 0; |
587 | } | 587 | } |
588 | 588 | ||
589 | /* Decide whether to display the domain number in /proc */ | ||
590 | int pci_proc_domain(struct pci_bus *bus) | ||
591 | { | ||
592 | struct pci_controller *hose = pci_bus_to_host(bus); | ||
593 | return hose->buid != 0; | ||
594 | } | ||
595 | |||
596 | |||
597 | #ifdef CONFIG_HOTPLUG | 589 | #ifdef CONFIG_HOTPLUG |
598 | 590 | ||
599 | int pcibios_unmap_io_space(struct pci_bus *bus) | 591 | int pcibios_unmap_io_space(struct pci_bus *bus) |
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 2972f0d3afaa..fed8f52071f1 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -30,6 +30,11 @@ enum { | |||
30 | * ISA forwarding enabled | 30 | * ISA forwarding enabled |
31 | */ | 31 | */ |
32 | PPC_PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, | 32 | PPC_PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, |
33 | |||
34 | /* Enable domain numbers in /proc */ | ||
35 | PPC_PCI_ENABLE_PROC_DOMAINS = 0x00000010, | ||
36 | /* ... except for domain 0 */ | ||
37 | PPC_PCI_COMPAT_DOMAIN_0 = 0x00000020, | ||
33 | }; | 38 | }; |
34 | 39 | ||
35 | 40 | ||
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index 47cc117a1422..2883f566709d 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h | |||
@@ -98,9 +98,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
98 | #define get_pci_dma_ops() NULL | 98 | #define get_pci_dma_ops() NULL |
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | /* Decide whether to display the domain number in /proc */ | ||
102 | extern int pci_proc_domain(struct pci_bus *bus); | ||
103 | |||
104 | #else /* 32-bit */ | 101 | #else /* 32-bit */ |
105 | 102 | ||
106 | #ifdef CONFIG_PCI | 103 | #ifdef CONFIG_PCI |
@@ -112,17 +109,14 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
112 | *strategy_parameter = ~0UL; | 109 | *strategy_parameter = ~0UL; |
113 | } | 110 | } |
114 | #endif | 111 | #endif |
115 | |||
116 | /* Set the name of the bus as it appears in /proc/bus/pci */ | ||
117 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
118 | { | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | #endif /* CONFIG_PPC64 */ | 112 | #endif /* CONFIG_PPC64 */ |
123 | 113 | ||
124 | extern int pci_domain_nr(struct pci_bus *bus); | 114 | extern int pci_domain_nr(struct pci_bus *bus); |
125 | 115 | ||
116 | /* Decide whether to display the domain number in /proc */ | ||
117 | extern int pci_proc_domain(struct pci_bus *bus); | ||
118 | |||
119 | |||
126 | struct vm_area_struct; | 120 | struct vm_area_struct; |
127 | /* Map a range of PCI memory or I/O space for a device into user space */ | 121 | /* Map a range of PCI memory or I/O space for a device into user space */ |
128 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | 122 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, |