cns3xxx: add linux 3.8 support and use it by default
[openwrt/svn-archive/archive.git] / target / linux / cns3xxx / patches-3.8 / 097-l2x0_cmdline_disable.patch
1 --- a/arch/arm/mach-cns3xxx/core.c
2 +++ b/arch/arm/mach-cns3xxx/core.c
3 @@ -293,13 +293,26 @@ struct sys_timer cns3xxx_timer = {
4
5 #ifdef CONFIG_CACHE_L2X0
6
7 -void __init cns3xxx_l2x0_init(void)
8 +static int cns3xxx_l2x0_enable = 1;
9 +
10 +static int __init cns3xxx_l2x0_disable(char *s)
11 +{
12 + cns3xxx_l2x0_enable = 0;
13 + return 1;
14 +}
15 +__setup("nol2x0", cns3xxx_l2x0_disable);
16 +
17 +static int __init cns3xxx_l2x0_init(void)
18 {
19 - void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
20 + void __iomem *base;
21 u32 val;
22
23 + if (!cns3xxx_l2x0_enable)
24 + return 0;
25 +
26 + base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
27 if (WARN_ON(!base))
28 - return;
29 + return 0;
30
31 /*
32 * Tag RAM Control register
33 @@ -329,7 +342,10 @@ void __init cns3xxx_l2x0_init(void)
34
35 /* 32 KiB, 8-way, parity disable */
36 l2x0_init(base, 0x00540000, 0xfe000fff);
37 +
38 + return 0;
39 }
40 +arch_initcall(cns3xxx_l2x0_init);
41
42 #endif /* CONFIG_CACHE_L2X0 */
43
44 --- a/arch/arm/mach-cns3xxx/cns3420vb.c
45 +++ b/arch/arm/mach-cns3xxx/cns3420vb.c
46 @@ -241,8 +241,6 @@ static struct platform_device *cns3420_p
47
48 static void __init cns3420_init(void)
49 {
50 - cns3xxx_l2x0_init();
51 -
52 platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
53
54 cns3xxx_ahci_init();
55 --- a/arch/arm/mach-cns3xxx/core.h
56 +++ b/arch/arm/mach-cns3xxx/core.h
57 @@ -15,13 +15,6 @@ extern struct smp_operations cns3xxx_smp
58 extern struct sys_timer cns3xxx_timer;
59 extern void cns3xxx_pcie_iotable_init(void);
60
61 -
62 -#ifdef CONFIG_CACHE_L2X0
63 -void __init cns3xxx_l2x0_init(void);
64 -#else
65 -static inline void cns3xxx_l2x0_init(void) {}
66 -#endif /* CONFIG_CACHE_L2X0 */
67 -
68 void __init cns3xxx_common_init(void);
69 void __init cns3xxx_init_irq(void);
70 int __init cns3xxx_pcie_init(void);