MIPS: ralink: make use of the new memory detection code
authorJohn Crispin <blogic@openwrt.org>
Sat, 13 Apr 2013 13:15:51 +0000 (15:15 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 7 May 2013 23:19:12 +0000 (01:19 +0200)
Call detect_memory_region() from plat_mem_setup() unless the size was already
read from the system controller.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5184/

arch/mips/ralink/of.c

index 4165e70775be52dbf5df31d344204aa1b5ba40de..fb1569580def7c25a03a7f1348315c4e93e92e3c 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/init.h>
+#include <linux/sizes.h>
 #include <linux/of_fdt.h>
 #include <linux/kernel.h>
 #include <linux/bootmem.h>
@@ -85,6 +86,14 @@ void __init plat_mem_setup(void)
         * parsed resulting in our memory appearing
         */
        __dt_setup_arch(&__dtb_start);
+
+       if (soc_info.mem_size)
+               add_memory_region(soc_info.mem_base, soc_info.mem_size,
+                                 BOOT_MEM_RAM);
+       else
+               detect_memory_region(soc_info.mem_base,
+                                    soc_info.mem_size_min * SZ_1M,
+                                    soc_info.mem_size_max * SZ_1M);
 }
 
 static int __init plat_of_setup(void)