1 --- a/arch/arm/mach-cns3xxx/cns3420vb.c
2 +++ b/arch/arm/mach-cns3xxx/cns3420vb.c
3 @@ -203,7 +203,6 @@ static void __init cns3420_init(void)
5 cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT, IRQ_CNS3XXX_GPIOB,
7 - cns3xxx_pcie_init(0x3);
9 pm_power_off = cns3xxx_power_off;
11 @@ -220,11 +219,21 @@ static struct map_desc cns3420_io_desc[]
12 static void __init cns3420_map_io(void)
14 cns3xxx_common_init();
15 + cns3xxx_pcie_iotable_init();
16 iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc));
18 cns3420_early_serial_setup();
21 +static int __init cns3420vb_pcie_init(void)
23 + if (!machine_is_cns3420vb())
26 + return cns3xxx_pcie_init();
28 +subsys_initcall(cns3420vb_pcie_init);
30 MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
32 .map_io = cns3420_map_io,
33 --- a/arch/arm/mach-cns3xxx/core.h
34 +++ b/arch/arm/mach-cns3xxx/core.h
36 #define __CNS3XXX_CORE_H
38 extern struct sys_timer cns3xxx_timer;
39 -extern int cns3xxx_pcie_init(u8 bitmap);
40 -extern void cns3xxx_pcie_iotable_init(u8 bitmap);
41 +extern void cns3xxx_pcie_iotable_init(void);
44 #ifdef CONFIG_CACHE_L2X0
45 void __init cns3xxx_l2x0_init(void);
46 @@ -23,6 +23,7 @@ static inline void cns3xxx_l2x0_init(voi
48 void __init cns3xxx_common_init(void);
49 void __init cns3xxx_init_irq(void);
50 +int __init cns3xxx_pcie_init(void);
51 void cns3xxx_power_off(void);
52 void cns3xxx_restart(char, const char *);
54 --- a/arch/arm/mach-cns3xxx/pcie.c
55 +++ b/arch/arm/mach-cns3xxx/pcie.c
56 @@ -456,23 +456,18 @@ static int cns3xxx_pcie_abort_handler(un
60 -void __init cns3xxx_pcie_iotable_init(u8 bitmap)
62 +void __init cns3xxx_pcie_iotable_init()
64 - static int _iotable_init = 0;
67 - bitmap &= ~_iotable_init;
68 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
69 - if (!(bitmap & (1 << i)))
72 iotable_init(cns3xxx_pcie[i].cfg_bases,
73 ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
75 - _iotable_init |= bitmap;
78 -int __init cns3xxx_pcie_init(u8 bitmap)
79 +int __init cns3xxx_pcie_init(void)
83 @@ -482,14 +477,12 @@ int __init cns3xxx_pcie_init(u8 bitmap)
84 hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
85 "imprecise external abort");
87 - cns3xxx_pcie_iotable_init(bitmap);
88 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
89 - if (!(bitmap & (1 << i)))
92 cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
93 - cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
94 - pci_common_init(&cns3xxx_pcie[i].hw_pci);
95 + if (cns3xxx_pcie[i].linked) {
96 + cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
97 + pci_common_init(&cns3xxx_pcie[i].hw_pci);
101 pci_assign_unassigned_resources();