1 --- a/arch/arm/mach-cns3xxx/cns3420vb.c
2 +++ b/arch/arm/mach-cns3xxx/cns3420vb.c
3 @@ -214,11 +214,21 @@ static struct map_desc cns3420_io_desc[]
4 static void __init cns3420_map_io(void)
7 + cns3xxx_pcie_iotable_init();
8 iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc));
10 cns3420_early_serial_setup();
13 +static int __init cns3420vb_pcie_init(void)
15 + if (!machine_is_cns3420vb())
18 + return cns3xxx_pcie_init();
20 +subsys_initcall(cns3420vb_pcie_init);
22 MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
24 .map_io = cns3420_map_io,
25 --- a/arch/arm/mach-cns3xxx/core.h
26 +++ b/arch/arm/mach-cns3xxx/core.h
28 #define __CNS3XXX_CORE_H
30 extern struct sys_timer cns3xxx_timer;
31 +extern void cns3xxx_pcie_iotable_init(void);
34 #ifdef CONFIG_CACHE_L2X0
35 void __init cns3xxx_l2x0_init(void);
36 @@ -21,6 +23,7 @@ static inline void cns3xxx_l2x0_init(voi
38 void __init cns3xxx_map_io(void);
39 void __init cns3xxx_init_irq(void);
40 +int __init cns3xxx_pcie_init(void);
41 void cns3xxx_power_off(void);
42 void cns3xxx_restart(char, const char *);
44 --- a/arch/arm/mach-cns3xxx/pcie.c
45 +++ b/arch/arm/mach-cns3xxx/pcie.c
46 @@ -456,7 +456,18 @@ static int cns3xxx_pcie_abort_handler(un
50 -static int __init cns3xxx_pcie_init(void)
52 +void __init cns3xxx_pcie_iotable_init()
56 + for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
57 + iotable_init(cns3xxx_pcie[i].cfg_bases,
58 + ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
62 +int __init cns3xxx_pcie_init(void)
66 @@ -467,15 +478,14 @@ static int __init cns3xxx_pcie_init(void
67 "imprecise external abort");
69 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
70 - iotable_init(cns3xxx_pcie[i].cfg_bases,
71 - ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
72 cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
73 - cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
74 - pci_common_init(&cns3xxx_pcie[i].hw_pci);
75 + if (cns3xxx_pcie[i].linked) {
76 + cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
77 + pci_common_init(&cns3xxx_pcie[i].hw_pci);
81 pci_assign_unassigned_resources();
85 -device_initcall(cns3xxx_pcie_init);