aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
parenta6784ad7eafa74a085c8458909eda0699a8fcf57 (diff)
parent8dd779b19ce5972072ad2372a86c8acbae4da768 (diff)
Merge branch 'x86/unify-pci' into x86/core
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/mm/c-r3k.c6
-rw-r--r--arch/mips/mm/page.c61
-rw-r--r--arch/mips/mm/sc-rm7k.c4
-rw-r--r--arch/powerpc/kernel/legacy_serial.c5
-rw-r--r--arch/um/Makefile1
-rw-r--r--arch/um/Makefile-i3867
-rw-r--r--arch/um/Makefile-x86_643
-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
20 files changed, 160 insertions, 154 deletions
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 76935e320214..27a5b466c85c 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -26,7 +26,7 @@
26static unsigned long icache_size, dcache_size; /* Size in bytes */ 26static unsigned long icache_size, dcache_size; /* Size in bytes */
27static unsigned long icache_lsize, dcache_lsize; /* Size in bytes */ 27static unsigned long icache_lsize, dcache_lsize; /* Size in bytes */
28 28
29unsigned long __init r3k_cache_size(unsigned long ca_flags) 29unsigned long __cpuinit r3k_cache_size(unsigned long ca_flags)
30{ 30{
31 unsigned long flags, status, dummy, size; 31 unsigned long flags, status, dummy, size;
32 volatile unsigned long *p; 32 volatile unsigned long *p;
@@ -61,7 +61,7 @@ unsigned long __init r3k_cache_size(unsigned long ca_flags)
61 return size * sizeof(*p); 61 return size * sizeof(*p);
62} 62}
63 63
64unsigned long __init r3k_cache_lsize(unsigned long ca_flags) 64unsigned long __cpuinit r3k_cache_lsize(unsigned long ca_flags)
65{ 65{
66 unsigned long flags, status, lsize, i; 66 unsigned long flags, status, lsize, i;
67 volatile unsigned long *p; 67 volatile unsigned long *p;
@@ -90,7 +90,7 @@ unsigned long __init r3k_cache_lsize(unsigned long ca_flags)
90 return lsize * sizeof(*p); 90 return lsize * sizeof(*p);
91} 91}
92 92
93static void __init r3k_probe_cache(void) 93static void __cpuinit r3k_probe_cache(void)
94{ 94{
95 dcache_size = r3k_cache_size(ST0_ISC); 95 dcache_size = r3k_cache_size(ST0_ISC);
96 if (dcache_size) 96 if (dcache_size)
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index 1edf0cbbeede..1417c6494858 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -235,13 +235,12 @@ static void __cpuinit set_prefetch_parameters(void)
235 } 235 }
236 /* 236 /*
237 * Too much unrolling will overflow the available space in 237 * Too much unrolling will overflow the available space in
238 * clear_space_array / copy_page_array. 8 words sounds generous, 238 * clear_space_array / copy_page_array.
239 * but a R4000 with 128 byte L2 line length can exceed even that.
240 */ 239 */
241 half_clear_loop_size = min(8 * clear_word_size, 240 half_clear_loop_size = min(16 * clear_word_size,
242 max(cache_line_size >> 1, 241 max(cache_line_size >> 1,
243 4 * clear_word_size)); 242 4 * clear_word_size));
244 half_copy_loop_size = min(8 * copy_word_size, 243 half_copy_loop_size = min(16 * copy_word_size,
245 max(cache_line_size >> 1, 244 max(cache_line_size >> 1,
246 4 * copy_word_size)); 245 4 * copy_word_size));
247} 246}
@@ -263,21 +262,23 @@ static inline void __cpuinit build_clear_pref(u32 **buf, int off)
263 if (pref_bias_clear_store) { 262 if (pref_bias_clear_store) {
264 uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off, 263 uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off,
265 A0); 264 A0);
266 } else if (cpu_has_cache_cdex_s) { 265 } else if (cache_line_size == (half_clear_loop_size << 1)) {
267 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); 266 if (cpu_has_cache_cdex_s) {
268 } else if (cpu_has_cache_cdex_p) { 267 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0);
269 if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { 268 } else if (cpu_has_cache_cdex_p) {
270 uasm_i_nop(buf); 269 if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) {
271 uasm_i_nop(buf); 270 uasm_i_nop(buf);
272 uasm_i_nop(buf); 271 uasm_i_nop(buf);
273 uasm_i_nop(buf); 272 uasm_i_nop(buf);
274 } 273 uasm_i_nop(buf);
274 }
275 275
276 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 276 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
277 uasm_i_lw(buf, ZERO, ZERO, AT); 277 uasm_i_lw(buf, ZERO, ZERO, AT);
278 278
279 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); 279 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0);
280 } 280 }
281 }
281} 282}
282 283
283void __cpuinit build_clear_page(void) 284void __cpuinit build_clear_page(void)
@@ -403,20 +404,22 @@ static inline void build_copy_store_pref(u32 **buf, int off)
403 if (pref_bias_copy_store) { 404 if (pref_bias_copy_store) {
404 uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off, 405 uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off,
405 A0); 406 A0);
406 } else if (cpu_has_cache_cdex_s) { 407 } else if (cache_line_size == (half_copy_loop_size << 1)) {
407 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); 408 if (cpu_has_cache_cdex_s) {
408 } else if (cpu_has_cache_cdex_p) { 409 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0);
409 if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { 410 } else if (cpu_has_cache_cdex_p) {
410 uasm_i_nop(buf); 411 if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) {
411 uasm_i_nop(buf); 412 uasm_i_nop(buf);
412 uasm_i_nop(buf); 413 uasm_i_nop(buf);
413 uasm_i_nop(buf); 414 uasm_i_nop(buf);
414 } 415 uasm_i_nop(buf);
416 }
415 417
416 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) 418 if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
417 uasm_i_lw(buf, ZERO, ZERO, AT); 419 uasm_i_lw(buf, ZERO, ZERO, AT);
418 420
419 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); 421 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0);
422 }
420 } 423 }
421} 424}
422 425
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index fc227f3b1199..e3abfb2d7e86 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -86,7 +86,7 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size)
86/* 86/*
87 * This function is executed in uncached address space. 87 * This function is executed in uncached address space.
88 */ 88 */
89static __init void __rm7k_sc_enable(void) 89static __cpuinit void __rm7k_sc_enable(void)
90{ 90{
91 int i; 91 int i;
92 92
@@ -107,7 +107,7 @@ static __init void __rm7k_sc_enable(void)
107 } 107 }
108} 108}
109 109
110static __init void rm7k_sc_enable(void) 110static __cpuinit void rm7k_sc_enable(void)
111{ 111{
112 if (read_c0_config() & RM7K_CONF_SE) 112 if (read_c0_config() & RM7K_CONF_SE)
113 return; 113 return;
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index cf37f5ca4b71..4d96e1db55ee 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -33,13 +33,14 @@ static struct legacy_serial_info {
33 phys_addr_t taddr; 33 phys_addr_t taddr;
34} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; 34} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
35 35
36static struct __initdata of_device_id parents[] = { 36static struct __initdata of_device_id legacy_serial_parents[] = {
37 {.type = "soc",}, 37 {.type = "soc",},
38 {.type = "tsi-bridge",}, 38 {.type = "tsi-bridge",},
39 {.type = "opb", }, 39 {.type = "opb", },
40 {.compatible = "ibm,opb",}, 40 {.compatible = "ibm,opb",},
41 {.compatible = "simple-bus",}, 41 {.compatible = "simple-bus",},
42 {.compatible = "wrs,epld-localbus",}, 42 {.compatible = "wrs,epld-localbus",},
43 {},
43}; 44};
44 45
45static unsigned int legacy_serial_count; 46static unsigned int legacy_serial_count;
@@ -327,7 +328,7 @@ void __init find_legacy_serial_ports(void)
327 struct device_node *parent = of_get_parent(np); 328 struct device_node *parent = of_get_parent(np);
328 if (!parent) 329 if (!parent)
329 continue; 330 continue;
330 if (of_match_node(parents, parent) != NULL) { 331 if (of_match_node(legacy_serial_parents, parent) != NULL) {
331 index = add_legacy_soc_port(np, np); 332 index = add_legacy_soc_port(np, np);
332 if (index >= 0 && np == stdout) 333 if (index >= 0 && np == stdout)
333 legacy_serial_console = index; 334 legacy_serial_console = index;
diff --git a/arch/um/Makefile b/arch/um/Makefile
index dbeab15e7bb7..ca40397017b9 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -77,7 +77,6 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
77KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ 77KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
78 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) 78 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES))
79KBUILD_CFLAGS += $(KERNEL_DEFINES) 79KBUILD_CFLAGS += $(KERNEL_DEFINES)
80KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
81 80
82PHONY += linux 81PHONY += linux
83 82
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 561e373bd850..302cbe504543 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -32,4 +32,11 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
32# an unresolved reference. 32# an unresolved reference.
33cflags-y += -ffreestanding 33cflags-y += -ffreestanding
34 34
35# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
36# a lot more stack due to the lack of sharing of stacklots. Also, gcc
37# 4.3.0 needs -funit-at-a-time for extern inline functions.
38KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
39 echo $(call cc-option,-fno-unit-at-a-time); \
40 else echo $(call cc-option,-funit-at-a-time); fi ;)
41
35KBUILD_CFLAGS += $(cflags-y) 42KBUILD_CFLAGS += $(cflags-y)
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index 8ed362f93582..a9cd7e77a7ab 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -21,3 +21,6 @@ HEADER_ARCH := x86
21 21
22LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 22LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
23LINK-y += -m64 23LINK-y += -m64
24
25# Do unit-at-a-time unconditionally on x86_64, following the host
26KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
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);