aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-10 12:47:29 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-10 12:47:29 -0400
commitf87f38ec5a5157aa39f44f6018dc58ea62f8e0e2 (patch)
tree1612249d11d455cfd6a0d691f5564673ae179c5f /arch/x86
parenta6784ad7eafa74a085c8458909eda0699a8fcf57 (diff)
parent8dd779b19ce5972072ad2372a86c8acbae4da768 (diff)
Merge branch 'x86/unify-pci' into x86/core
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/pci/Makefile24
-rw-r--r--arch/x86/pci/Makefile_3226
-rw-r--r--arch/x86/pci/Makefile_6417
-rw-r--r--arch/x86/pci/acpi.c3
-rw-r--r--arch/x86/pci/amd_bus.c74
-rw-r--r--arch/x86/pci/common.c12
-rw-r--r--arch/x86/pci/init.c4
-rw-r--r--arch/x86/pci/irq.c5
-rw-r--r--arch/x86/pci/legacy.c11
-rw-r--r--arch/x86/pci/mp_bus_to_node.c23
-rw-r--r--arch/x86/pci/numa.c8
-rw-r--r--arch/x86/pci/pci.h11
-rw-r--r--arch/x86/pci/visws.c9
13 files changed, 110 insertions, 117 deletions
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index c5c8e485fc44..99d9f095e4d4 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -1,5 +1,19 @@
1ifeq ($(CONFIG_X86_32),y) 1obj-y := i386.o init.o
2include ${srctree}/arch/x86/pci/Makefile_32 2
3else 3obj-$(CONFIG_PCI_BIOS) += pcbios.o
4include ${srctree}/arch/x86/pci/Makefile_64 4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_$(BITS).o direct.o mmconfig-shared.o
5endif 5obj-$(CONFIG_PCI_DIRECT) += direct.o
6obj-$(CONFIG_PCI_OLPC) += olpc.o
7
8pci-y := fixup.o
9pci-$(CONFIG_ACPI) += acpi.o
10pci-y += legacy.o irq.o
11
12# Careful: VISWS overrule the pci-y above. The colons are
13# therefor correct. This needs a proper fix by distangling the code.
14pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
15
16pci-$(CONFIG_X86_NUMAQ) += numa.o
17
18obj-y += $(pci-y) common.o early.o
19obj-y += amd_bus.o
diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32
deleted file mode 100644
index a34fbf557926..000000000000
--- a/arch/x86/pci/Makefile_32
+++ /dev/null
@@ -1,26 +0,0 @@
1obj-y := i386.o init.o
2
3obj-$(CONFIG_PCI_BIOS) += pcbios.o
4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_32.o direct.o mmconfig-shared.o
5obj-$(CONFIG_PCI_DIRECT) += direct.o
6obj-$(CONFIG_PCI_OLPC) += olpc.o
7
8pci-y := fixup.o
9
10# Do not change the ordering here. There is a nasty init function
11# ordering dependency which breaks when you move acpi.o below
12# legacy/irq.o
13pci-$(CONFIG_ACPI) += acpi.o
14pci-y += legacy.o irq.o
15
16# Careful: VISWS overrule the pci-y above. The colons are
17# therefor correct. This needs a proper fix by distangling the code.
18pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
19
20pci-$(CONFIG_X86_NUMAQ) += numa.o
21
22# Necessary for NUMAQ as well
23pci-$(CONFIG_NUMA) += mp_bus_to_node.o
24
25obj-y += $(pci-y) common.o early.o
26obj-y += amd_bus.o
diff --git a/arch/x86/pci/Makefile_64 b/arch/x86/pci/Makefile_64
deleted file mode 100644
index fd47068c95de..000000000000
--- a/arch/x86/pci/Makefile_64
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# Makefile for X86_64 specific PCI routines
3#
4# Reuse the i386 PCI subsystem
5#
6EXTRA_CFLAGS += -Iarch/x86/pci
7
8obj-y := i386.o
9obj-$(CONFIG_PCI_DIRECT)+= direct.o
10obj-y += fixup.o init.o
11obj-$(CONFIG_ACPI) += acpi.o
12obj-y += legacy.o irq.o common.o early.o
13# mmconfig has a 64bit special
14obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_64.o direct.o mmconfig-shared.o
15
16obj-y += amd_bus.o
17
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 4fa52d3dc848..19af06927fbc 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -223,7 +223,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
223 return bus; 223 return bus;
224} 224}
225 225
226static int __init pci_acpi_init(void) 226int __init pci_acpi_init(void)
227{ 227{
228 struct pci_dev *dev = NULL; 228 struct pci_dev *dev = NULL;
229 229
@@ -257,4 +257,3 @@ static int __init pci_acpi_init(void)
257 257
258 return 0; 258 return 0;
259} 259}
260subsys_initcall(pci_acpi_init);
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index d02c598451ec..a18141ae3f02 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -1,44 +1,25 @@
1#include <linux/init.h> 1#include <linux/init.h>
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <linux/topology.h>
3#include "pci.h" 4#include "pci.h"
4 5
5#ifdef CONFIG_X86_64 6#ifdef CONFIG_X86_64
6
7#include <asm/pci-direct.h> 7#include <asm/pci-direct.h>
8#include <asm/mpspec.h> 8#include <asm/mpspec.h>
9#include <linux/cpumask.h> 9#include <linux/cpumask.h>
10#include <linux/topology.h> 10#endif
11 11
12/* 12/*
13 * This discovers the pcibus <-> node mapping on AMD K8. 13 * This discovers the pcibus <-> node mapping on AMD K8.
14 * also get peer root bus resource for io,mmio 14 * also get peer root bus resource for io,mmio
15 */ 15 */
16 16
17
18/*
19 * sub bus (transparent) will use entres from 3 to store extra from root,
20 * so need to make sure have enought slot there, increase PCI_BUS_NUM_RESOURCES?
21 */
22#define RES_NUM 16
23struct pci_root_info {
24 char name[12];
25 unsigned int res_num;
26 struct resource res[RES_NUM];
27 int bus_min;
28 int bus_max;
29 int node;
30 int link;
31};
32
33/* 4 at this time, it may become to 32 */
34#define PCI_ROOT_NR 4
35static int pci_root_num;
36static struct pci_root_info pci_root_info[PCI_ROOT_NR];
37
38#ifdef CONFIG_NUMA 17#ifdef CONFIG_NUMA
39 18
40#define BUS_NR 256 19#define BUS_NR 256
41 20
21#ifdef CONFIG_X86_64
22
42static int mp_bus_to_node[BUS_NR]; 23static int mp_bus_to_node[BUS_NR];
43 24
44void set_mp_bus_to_node(int busnum, int node) 25void set_mp_bus_to_node(int busnum, int node)
@@ -65,7 +46,52 @@ int get_mp_bus_to_node(int busnum)
65 46
66 return node; 47 return node;
67} 48}
68#endif 49
50#else /* CONFIG_X86_32 */
51
52static unsigned char mp_bus_to_node[BUS_NR];
53
54void set_mp_bus_to_node(int busnum, int node)
55{
56 if (busnum >= 0 && busnum < BUS_NR)
57 mp_bus_to_node[busnum] = (unsigned char) node;
58}
59
60int get_mp_bus_to_node(int busnum)
61{
62 int node;
63
64 if (busnum < 0 || busnum > (BUS_NR - 1))
65 return 0;
66 node = mp_bus_to_node[busnum];
67 return node;
68}
69
70#endif /* CONFIG_X86_32 */
71
72#endif /* CONFIG_NUMA */
73
74#ifdef CONFIG_X86_64
75
76/*
77 * sub bus (transparent) will use entres from 3 to store extra from root,
78 * so need to make sure have enought slot there, increase PCI_BUS_NUM_RESOURCES?
79 */
80#define RES_NUM 16
81struct pci_root_info {
82 char name[12];
83 unsigned int res_num;
84 struct resource res[RES_NUM];
85 int bus_min;
86 int bus_max;
87 int node;
88 int link;
89};
90
91/* 4 at this time, it may become to 32 */
92#define PCI_ROOT_NR 4
93static int pci_root_num;
94static struct pci_root_info pci_root_info[PCI_ROOT_NR];
69 95
70void set_pci_bus_resources_arch_default(struct pci_bus *b) 96void set_pci_bus_resources_arch_default(struct pci_bus *b)
71{ 97{
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 940185ecaeda..20b9f59f95df 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -328,18 +328,18 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
328#endif 328#endif
329 { 329 {
330 .callback = set_bf_sort, 330 .callback = set_bf_sort,
331 .ident = "HP ProLiant DL360", 331 .ident = "HP ProLiant DL385 G2",
332 .matches = { 332 .matches = {
333 DMI_MATCH(DMI_SYS_VENDOR, "HP"), 333 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
334 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"), 334 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
335 }, 335 },
336 }, 336 },
337 { 337 {
338 .callback = set_bf_sort, 338 .callback = set_bf_sort,
339 .ident = "HP ProLiant DL380", 339 .ident = "HP ProLiant DL585 G2",
340 .matches = { 340 .matches = {
341 DMI_MATCH(DMI_SYS_VENDOR, "HP"), 341 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
342 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"), 342 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
343 }, 343 },
344 }, 344 },
345 {} 345 {}
@@ -384,7 +384,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
384 384
385extern u8 pci_cache_line_size; 385extern u8 pci_cache_line_size;
386 386
387static int __init pcibios_init(void) 387int __init pcibios_init(void)
388{ 388{
389 struct cpuinfo_x86 *c = &boot_cpu_data; 389 struct cpuinfo_x86 *c = &boot_cpu_data;
390 390
@@ -411,8 +411,6 @@ static int __init pcibios_init(void)
411 return 0; 411 return 0;
412} 412}
413 413
414subsys_initcall(pcibios_init);
415
416char * __devinit pcibios_setup(char *str) 414char * __devinit pcibios_setup(char *str)
417{ 415{
418 if (!strcmp(str, "off")) { 416 if (!strcmp(str, "off")) {
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index b821f4462d99..d6c950f81858 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -4,7 +4,7 @@
4 4
5/* arch_initcall has too random ordering, so call the initializers 5/* arch_initcall has too random ordering, so call the initializers
6 in the right sequence from here. */ 6 in the right sequence from here. */
7static __init int pci_access_init(void) 7static __init int pci_arch_init(void)
8{ 8{
9#ifdef CONFIG_PCI_DIRECT 9#ifdef CONFIG_PCI_DIRECT
10 int type = 0; 10 int type = 0;
@@ -40,4 +40,4 @@ static __init int pci_access_init(void)
40 40
41 return 0; 41 return 0;
42} 42}
43arch_initcall(pci_access_init); 43arch_initcall(pci_arch_init);
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index f0859de23e20..dc568c6b83f8 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -1107,7 +1107,7 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = {
1107 { } 1107 { }
1108}; 1108};
1109 1109
1110static int __init pcibios_irq_init(void) 1110int __init pcibios_irq_init(void)
1111{ 1111{
1112 DBG(KERN_DEBUG "PCI: IRQ init\n"); 1112 DBG(KERN_DEBUG "PCI: IRQ init\n");
1113 1113
@@ -1142,9 +1142,6 @@ static int __init pcibios_irq_init(void)
1142 return 0; 1142 return 0;
1143} 1143}
1144 1144
1145subsys_initcall(pcibios_irq_init);
1146
1147
1148static void pirq_penalize_isa_irq(int irq, int active) 1145static void pirq_penalize_isa_irq(int irq, int active)
1149{ 1146{
1150 /* 1147 /*
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index a67921ce60af..3c1d795cbbe9 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -55,4 +55,13 @@ static int __init pci_legacy_init(void)
55 return 0; 55 return 0;
56} 56}
57 57
58subsys_initcall(pci_legacy_init); 58int __init pci_subsys_init(void)
59{
60#ifdef CONFIG_ACPI
61 pci_acpi_init();
62#endif
63 pci_legacy_init();
64 pcibios_irq_init();
65 pcibios_init();
66}
67subsys_initcall(pci_subsys_init);
diff --git a/arch/x86/pci/mp_bus_to_node.c b/arch/x86/pci/mp_bus_to_node.c
deleted file mode 100644
index 022943999b84..000000000000
--- a/arch/x86/pci/mp_bus_to_node.c
+++ /dev/null
@@ -1,23 +0,0 @@
1#include <linux/pci.h>
2#include <linux/init.h>
3#include <linux/topology.h>
4
5#define BUS_NR 256
6
7static unsigned char mp_bus_to_node[BUS_NR];
8
9void set_mp_bus_to_node(int busnum, int node)
10{
11 if (busnum >= 0 && busnum < BUS_NR)
12 mp_bus_to_node[busnum] = (unsigned char) node;
13}
14
15int get_mp_bus_to_node(int busnum)
16{
17 int node;
18
19 if (busnum < 0 || busnum > (BUS_NR - 1))
20 return 0;
21 node = mp_bus_to_node[busnum];
22 return node;
23}
diff --git a/arch/x86/pci/numa.c b/arch/x86/pci/numa.c
index 99f1ecd485b5..e1620dc8649a 100644
--- a/arch/x86/pci/numa.c
+++ b/arch/x86/pci/numa.c
@@ -177,4 +177,10 @@ static int __init pci_numa_init(void)
177 return 0; 177 return 0;
178} 178}
179 179
180subsys_initcall(pci_numa_init); 180static __init int pci_subsys_init(void)
181{
182 pci_numa_init();
183 pcibios_irq_init();
184 pcibios_init();
185}
186subsys_initcall(pci_subsys_init);
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index ba263e626a68..58241748470f 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -39,9 +39,6 @@ enum pci_bf_sort_state {
39 pci_dmi_bf, 39 pci_dmi_bf,
40}; 40};
41 41
42extern void __init dmi_check_pciprobe(void);
43extern void __init dmi_check_skip_isa_align(void);
44
45/* pci-i386.c */ 42/* pci-i386.c */
46 43
47extern unsigned int pcibios_max_latency; 44extern unsigned int pcibios_max_latency;
@@ -99,10 +96,18 @@ extern struct pci_raw_ops *raw_pci_ext_ops;
99 96
100extern struct pci_raw_ops pci_direct_conf1; 97extern struct pci_raw_ops pci_direct_conf1;
101 98
99/* arch_initcall level */
102extern int pci_direct_probe(void); 100extern int pci_direct_probe(void);
103extern void pci_direct_init(int type); 101extern void pci_direct_init(int type);
104extern void pci_pcbios_init(void); 102extern void pci_pcbios_init(void);
105extern int pci_olpc_init(void); 103extern int pci_olpc_init(void);
104extern void __init dmi_check_pciprobe(void);
105extern void __init dmi_check_skip_isa_align(void);
106
107/* some common used subsys_initcalls */
108extern int __init pci_acpi_init(void);
109extern int __init pcibios_irq_init(void);
110extern int __init pcibios_init(void);
106 111
107/* pci-mmconfig.c */ 112/* pci-mmconfig.c */
108 113
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index c2df4e97eed6..16e52063ecb3 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -85,7 +85,7 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq)
85 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); 85 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
86} 86}
87 87
88static int __init pcibios_init(void) 88static int __init pci_visws_init(void)
89{ 89{
90 /* The VISWS supports configuration access type 1 only */ 90 /* The VISWS supports configuration access type 1 only */
91 pci_probe = (pci_probe | PCI_PROBE_CONF1) & 91 pci_probe = (pci_probe | PCI_PROBE_CONF1) &
@@ -105,4 +105,9 @@ static int __init pcibios_init(void)
105 return 0; 105 return 0;
106} 106}
107 107
108subsys_initcall(pcibios_init); 108static __init int pci_subsys_init(void)
109{
110 pci_visws_init();
111 pcibios_init();
112}
113subsys_initcall(pci_subsys_init);