1 From fcecdbe52ca3f17c798a080454d67df92d1e71f8 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 3 Aug 2012 10:30:28 +0200
4 Subject: [PATCH 25/25] svip cp1
7 arch/mips/lantiq/devices.c | 10 ++++++++++
8 arch/mips/lantiq/prom.c | 1 +
9 arch/mips/lantiq/setup.c | 15 +++++++++++++++
10 3 files changed, 26 insertions(+), 0 deletions(-)
12 diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c
13 index 2d7c46a..7128115 100644
14 --- a/arch/mips/lantiq/devices.c
15 +++ b/arch/mips/lantiq/devices.c
16 @@ -102,19 +102,29 @@ void __init ltq_register_pci(struct ltq_pci_data *data)
20 +#ifdef CONFIG_SOC_SVIP
21 +extern unsigned int *prom_cp1_base;
23 static unsigned int *cp1_base = 0;
26 ltq_get_cp1_base(void)
28 +#ifdef CONFIG_SOC_SVIP
29 + return prom_cp1_base;
34 EXPORT_SYMBOL(ltq_get_cp1_base);
37 ltq_register_tapi(void)
39 +#ifndef CONFIG_SOC_SVIP
40 #define CP1_SIZE (1 << 20)
43 (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
46 diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
47 index 0fdef27..cab608b 100644
48 --- a/arch/mips/lantiq/prom.c
49 +++ b/arch/mips/lantiq/prom.c
50 @@ -129,6 +129,7 @@ err_res:
52 EXPORT_SYMBOL(ltq_remap_resource);
55 void __init prom_init(void)
57 ltq_soc_detect(&soc_info);
58 diff --git a/arch/mips/lantiq/setup.c b/arch/mips/lantiq/setup.c
59 index 114989d..9aa0310 100644
60 --- a/arch/mips/lantiq/setup.c
61 +++ b/arch/mips/lantiq/setup.c
63 /* set to 1 if the bootloader is BRN-BOOT instead of u-boot */
64 unsigned long ltq_brn_boot = 0;
66 +#ifdef CONFIG_SOC_SVIP
67 +unsigned int *prom_cp1_base;
70 void __init plat_mem_setup(void)
72 +#ifdef CONFIG_SOC_SVIP
73 + int prom_cp1_size = 0x800000;
75 /* assume 16M as default incase uboot fails to pass proper ramsize */
76 unsigned long memsize = 16;
77 char **envp = (char **) KSEG1ADDR(fw_arg2);
78 @@ -54,6 +61,14 @@ void __init plat_mem_setup(void)
81 memsize *= 1024 * 1024;
83 +#ifdef CONFIG_SOC_SVIP
84 + memsize -= prom_cp1_size;
85 + prom_cp1_base = (unsigned int *)KSEG1ADDR(memsize);
87 + printk("Using %ldMB Ram and reserving %dMB for cp1\n",
88 + memsize>>20, prom_cp1_size>>20);
90 add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);