summaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files/arch/mips/ralink
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-09-27 10:18:14 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-09-27 10:18:14 +0000
commit4110f0d3790c7d98fab4ca1b49f84e973df88d1b (patch)
tree7ff10a65c46f54b033644b5b380a4d241dd311ab /target/linux/ramips/files/arch/mips/ralink
parentea2de79f8601d712b957acde3b021fdfb291e905 (diff)
ramips: allow to use custom code for memory size detection
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33570 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink')
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/common/setup.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/common/setup.c b/target/linux/ramips/files/arch/mips/ralink/common/setup.c
index 0d6b8d8c9..1af855e64 100644
--- a/target/linux/ramips/files/arch/mips/ralink/common/setup.c
+++ b/target/linux/ramips/files/arch/mips/ralink/common/setup.c
@@ -21,6 +21,7 @@
#include <asm/mach-ralink/machine.h>
unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
+unsigned long (*ramips_get_mem_size)(void);
const char *get_system_type(void)
{
@@ -30,13 +31,18 @@ const char *get_system_type(void)
static void __init detect_mem_size(void)
{
unsigned long size;
- void *base;
- base = (void *) KSEG1ADDR(detect_mem_size);
- for (size = ramips_mem_size_min; size < ramips_mem_size_max;
- size <<= 1 ) {
- if (!memcmp(base, base + size, 1024))
- break;
+ if (ramips_get_mem_size) {
+ size = ramips_get_mem_size();
+ } else {
+ void *base;
+
+ base = (void *) KSEG1ADDR(detect_mem_size);
+ for (size = ramips_mem_size_min; size < ramips_mem_size_max;
+ size <<= 1 ) {
+ if (!memcmp(base, base + size, 1024))
+ break;
+ }
}
add_memory_region(ramips_mem_base, size, BOOT_MEM_RAM);