1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-03 01:46:16 +02:00
openwrt-xburst/target/linux/lantiq/patches-3.3/0025-svip-cp1.patch
blogic cea2b4210d [lantiq] cleanup patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32953 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-08-03 08:53:02 +00:00

96 lines
2.3 KiB
Diff

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