aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci-common.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-06-27 02:17:57 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-06-29 02:58:37 -0400
commit5516b540e98de6f7474a4e7149470ad6a0bbc54a (patch)
tree9eb57336d892eb8c0e76584285030868df82f626 /arch/powerpc/kernel/pci-common.c
parent6a506238b33efd93e60c1585d654b37e292183de (diff)
[POWERPC] Use global_number in ppc32 pci_controller
Make the pci_controller struct use global_number for the PHB domain number instead of index to match what ppc64 does and reuse its pci_domain_nr code. Introduced a pci-common.c to handle shared code between ppc32 & ppc64. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r--arch/powerpc/kernel/pci-common.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
new file mode 100644
index 000000000000..3ca8cfb99dc2
--- /dev/null
+++ b/arch/powerpc/kernel/pci-common.c
@@ -0,0 +1,53 @@
1/*
2 * Contains common pci routines for ALL ppc platform
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#undef DEBUG
11
12#include <linux/kernel.h>
13#include <linux/pci.h>
14#include <linux/string.h>
15#include <linux/init.h>
16#include <linux/bootmem.h>
17#include <linux/mm.h>
18#include <linux/list.h>
19#include <linux/syscalls.h>
20#include <linux/irq.h>
21#include <linux/vmalloc.h>
22
23#include <asm/processor.h>
24#include <asm/io.h>
25#include <asm/prom.h>
26#include <asm/pci-bridge.h>
27#include <asm/byteorder.h>
28#include <asm/machdep.h>
29#include <asm/ppc-pci.h>
30#include <asm/firmware.h>
31
32#ifdef DEBUG
33#include <asm/udbg.h>
34#define DBG(fmt...) printk(fmt)
35#else
36#define DBG(fmt...)
37#endif
38
39/*
40 * Return the domain number for this bus.
41 */
42int pci_domain_nr(struct pci_bus *bus)
43{
44 if (firmware_has_feature(FW_FEATURE_ISERIES))
45 return 0;
46 else {
47 struct pci_controller *hose = pci_bus_to_host(bus);
48
49 return hose->global_number;
50 }
51}
52
53EXPORT_SYMBOL(pci_domain_nr);