X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/3caf3c48cf0c3ef99654636a50e0e3c993d7b052..f9626b56d535667990d566ffeb3a3397a58deed2:/target/linux/ramips/files/arch/mips/ralink/common/setup.c 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 e8126b11c..5f7cf14a7 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/setup.c @@ -31,11 +31,12 @@ 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 = RALINK_SOC_MEM_SIZE_MIN; size < RALINK_SOC_MEM_SIZE_MAX; size <<= 1 ) { - if (!memcmp(detect_mem_size, - detect_mem_size + size, 1024)) + if (!memcmp(base, base + size, 1024)) break; }