summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/patches-3.3/0025-svip-cp1.patch
blob: 50f2221dfe01ba136585a0e06c74f524c8170abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From fcecdbe52ca3f17c798a080454d67df92d1e71f8 Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Fri, 3 Aug 2012 10:30:28 +0200
Subject: [PATCH 25/25] svip cp1

---
 arch/mips/lantiq/devices.c |   10 ++++++++++
 arch/mips/lantiq/prom.c    |    1 +
 arch/mips/lantiq/setup.c   |   15 +++++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c
index 2d7c46a..7128115 100644
--- a/arch/mips/lantiq/devices.c
+++ b/arch/mips/lantiq/devices.c
@@ -102,19 +102,29 @@ void __init ltq_register_pci(struct ltq_pci_data *data)
 }
 #endif
 
+#ifdef CONFIG_SOC_SVIP
+extern unsigned int *prom_cp1_base;
+#else
 static unsigned int *cp1_base = 0;
+#endif
 unsigned int*
 ltq_get_cp1_base(void)
 {
+#ifdef CONFIG_SOC_SVIP
+	return prom_cp1_base;
+#else
 	return cp1_base;
+#endif
 }
 EXPORT_SYMBOL(ltq_get_cp1_base);
 
 void __init
 ltq_register_tapi(void)
 {
+#ifndef CONFIG_SOC_SVIP
 #define CP1_SIZE	(1 << 20)
 	dma_addr_t dma;
 	cp1_base =
 		(void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
+#endif
 }
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index 0fdef27..cab608b 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -129,6 +129,7 @@ err_res:
 }
 EXPORT_SYMBOL(ltq_remap_resource);
 
+
 void __init prom_init(void)
 {
 	ltq_soc_detect(&soc_info);
diff --git a/arch/mips/lantiq/setup.c b/arch/mips/lantiq/setup.c
index 114989d..9aa0310 100644
--- a/arch/mips/lantiq/setup.c
+++ b/arch/mips/lantiq/setup.c
@@ -21,8 +21,15 @@
 /* set to 1 if the bootloader is BRN-BOOT instead of u-boot */
 unsigned long ltq_brn_boot = 0;
 
+#ifdef CONFIG_SOC_SVIP
+unsigned int *prom_cp1_base;
+#endif
+
 void __init plat_mem_setup(void)
 {
+#ifdef CONFIG_SOC_SVIP
+	int prom_cp1_size = 0x800000;
+#endif
 	/* assume 16M as default incase uboot fails to pass proper ramsize */
 	unsigned long memsize = 16;
 	char **envp = (char **) KSEG1ADDR(fw_arg2);
@@ -54,6 +61,14 @@ void __init plat_mem_setup(void)
 		envp++;
 	}
 	memsize *= 1024 * 1024;
+
+#ifdef CONFIG_SOC_SVIP
+	memsize -= prom_cp1_size;
+	prom_cp1_base = (unsigned int *)KSEG1ADDR(memsize);
+
+	printk("Using %ldMB Ram and reserving %dMB for cp1\n",
+		    memsize>>20, prom_cp1_size>>20);
+#endif
 	add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
 }
 
-- 
1.7.9.1