]> git.enpas.org Git - openwrt.git/blob - target/linux/lantiq/patches-3.3/535-svip_cp1.patch
[lantiq] add lantiq svip support
[openwrt.git] / target / linux / lantiq / patches-3.3 / 535-svip_cp1.patch
1 Index: linux-3.3.8/arch/mips/lantiq/devices.c
2 ===================================================================
3 --- linux-3.3.8.orig/arch/mips/lantiq/devices.c 2012-07-31 09:45:42.315551926 +0200
4 +++ linux-3.3.8/arch/mips/lantiq/devices.c      2012-07-31 09:46:14.051553281 +0200
5 @@ -102,19 +102,29 @@
6  }
7  #endif
8  
9 +#ifdef CONFIG_SOC_SVIP
10 +extern unsigned int *prom_cp1_base;
11 +#else
12  static unsigned int *cp1_base = 0;
13 +#endif
14  unsigned int*
15  ltq_get_cp1_base(void)
16  {
17 +#ifdef CONFIG_SOC_SVIP
18 +       return prom_cp1_base;
19 +#else
20         return cp1_base;
21 +#endif
22  }
23  EXPORT_SYMBOL(ltq_get_cp1_base);
24  
25  void __init
26  ltq_register_tapi(void)
27  {
28 +#ifndef CONFIG_SOC_SVIP
29  #define CP1_SIZE       (1 << 20)
30         dma_addr_t dma;
31         cp1_base =
32                 (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
33 +#endif
34  }
35 Index: linux-3.3.8/arch/mips/lantiq/prom.c
36 ===================================================================
37 --- linux-3.3.8.orig/arch/mips/lantiq/prom.c    2012-07-31 09:45:42.315551926 +0200
38 +++ linux-3.3.8/arch/mips/lantiq/prom.c 2012-07-31 10:31:28.759669332 +0200
39 @@ -129,6 +129,7 @@
40  }
41  EXPORT_SYMBOL(ltq_remap_resource);
42  
43 +
44  void __init prom_init(void)
45  {
46         ltq_soc_detect(&soc_info);
47 Index: linux-3.3.8/arch/mips/lantiq/setup.c
48 ===================================================================
49 --- linux-3.3.8.orig/arch/mips/lantiq/setup.c   2012-07-31 09:45:42.315551926 +0200
50 +++ linux-3.3.8/arch/mips/lantiq/setup.c        2012-07-31 10:31:35.215669606 +0200
51 @@ -21,8 +21,15 @@
52  /* set to 1 if the bootloader is BRN-BOOT instead of u-boot */
53  unsigned long ltq_brn_boot = 0;
54  
55 +#ifdef CONFIG_SOC_SVIP
56 +unsigned int *prom_cp1_base;
57 +#endif
58 +
59  void __init plat_mem_setup(void)
60  {
61 +#ifdef CONFIG_SOC_SVIP
62 +       int prom_cp1_size = 0x800000;
63 +#endif
64         /* assume 16M as default incase uboot fails to pass proper ramsize */
65         unsigned long memsize = 16;
66         char **envp = (char **) KSEG1ADDR(fw_arg2);
67 @@ -54,6 +61,14 @@
68                 envp++;
69         }
70         memsize *= 1024 * 1024;
71 +
72 +#ifdef CONFIG_SOC_SVIP
73 +       memsize -= prom_cp1_size;
74 +       prom_cp1_base = (unsigned int *)KSEG1ADDR(memsize);
75 +
76 +       printk("Using %ldMB Ram and reserving %dMB for cp1\n",
77 +                   memsize>>20, prom_cp1_size>>20);
78 +#endif
79         add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
80  }
81