BB: openssl: update to 1.0.2f (fixes CVE-2016-0701, CVE-2015-3197)
[14.07/openwrt.git] / target / linux / cns3xxx / patches-3.10 / 065-pcie_early_init.patch
1 --- a/arch/arm/mach-cns3xxx/cns3420vb.c
2 +++ b/arch/arm/mach-cns3xxx/cns3420vb.c
3 @@ -261,11 +261,21 @@ static struct map_desc cns3420_io_desc[]
4  static void __init cns3420_map_io(void)
5  {
6         cns3xxx_map_io();
7 +       cns3xxx_pcie_iotable_init();
8         iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc));
9  
10         cns3420_early_serial_setup();
11  }
12  
13 +static int __init cns3420vb_pcie_init(void)
14 +{
15 +       if (!machine_is_cns3420vb())
16 +               return 0;
17 +
18 +       return cns3xxx_pcie_init();
19 +}
20 +subsys_initcall(cns3420vb_pcie_init);
21 +
22  MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
23         .atag_offset    = 0x100,
24         .nr_irqs        = NR_IRQS_CNS3XXX,
25 --- a/arch/arm/mach-cns3xxx/core.h
26 +++ b/arch/arm/mach-cns3xxx/core.h
27 @@ -13,6 +13,7 @@
28  
29  extern struct smp_operations cns3xxx_smp_ops;
30  extern void cns3xxx_timer_init(void);
31 +extern void cns3xxx_pcie_iotable_init(void);
32  
33  #ifdef CONFIG_CACHE_L2X0
34  void __init cns3xxx_l2x0_init(void);
35 @@ -22,6 +23,7 @@ static inline void cns3xxx_l2x0_init(voi
36  
37  void __init cns3xxx_map_io(void);
38  void __init cns3xxx_init_irq(void);
39 +int  __init cns3xxx_pcie_init(void);
40  void cns3xxx_power_off(void);
41  void cns3xxx_restart(char, const char *);
42  
43 --- a/arch/arm/mach-cns3xxx/pcie.c
44 +++ b/arch/arm/mach-cns3xxx/pcie.c
45 @@ -449,7 +449,18 @@ static int cns3xxx_pcie_abort_handler(un
46         return 0;
47  }
48  
49 -static int __init cns3xxx_pcie_init(void)
50 +
51 +void __init cns3xxx_pcie_iotable_init()
52 +{
53 +       int i;
54 +
55 +       for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
56 +               iotable_init(cns3xxx_pcie[i].cfg_bases,
57 +                            ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
58 +       }
59 +}
60 +
61 +int __init cns3xxx_pcie_init(void)
62  {
63         int i;
64  
65 @@ -460,15 +471,14 @@ static int __init cns3xxx_pcie_init(void
66                         "imprecise external abort");
67  
68         for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
69 -               iotable_init(cns3xxx_pcie[i].cfg_bases,
70 -                            ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
71                 cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
72 -               cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
73 -               pci_common_init(&cns3xxx_pcie[i].hw_pci);
74 +               if (cns3xxx_pcie[i].linked) {
75 +                       cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
76 +                       pci_common_init(&cns3xxx_pcie[i].hw_pci);
77 +               }
78         }
79  
80         pci_assign_unassigned_resources();
81  
82         return 0;
83  }
84 -device_initcall(cns3xxx_pcie_init);