ralink: update patches
[openwrt.git] / target / linux / ramips / patches-3.9 / 0127-MIPS-ralink-make-use-of-the-new-memory-detection-cod.patch
1 From 550797902b0285736caceaf3c01506077d5440ea Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sat, 13 Apr 2013 15:15:51 +0200
4 Subject: [PATCH 127/164] MIPS: ralink: make use of the new memory detection
5  code
6
7 Call detect_memory_region() from plat_mem_setup() unless the size was already
8 read from the system controller.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Patchwork: http://patchwork.linux-mips.org/patch/5184/
12 ---
13  arch/mips/ralink/of.c |    9 +++++++++
14  1 file changed, 9 insertions(+)
15
16 diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
17 index 4165e70..fb15695 100644
18 --- a/arch/mips/ralink/of.c
19 +++ b/arch/mips/ralink/of.c
20 @@ -11,6 +11,7 @@
21  #include <linux/io.h>
22  #include <linux/clk.h>
23  #include <linux/init.h>
24 +#include <linux/sizes.h>
25  #include <linux/of_fdt.h>
26  #include <linux/kernel.h>
27  #include <linux/bootmem.h>
28 @@ -85,6 +86,14 @@ void __init plat_mem_setup(void)
29          * parsed resulting in our memory appearing
30          */
31         __dt_setup_arch(&__dtb_start);
32 +
33 +       if (soc_info.mem_size)
34 +               add_memory_region(soc_info.mem_base, soc_info.mem_size,
35 +                                 BOOT_MEM_RAM);
36 +       else
37 +               detect_memory_region(soc_info.mem_base,
38 +                                    soc_info.mem_size_min * SZ_1M,
39 +                                    soc_info.mem_size_max * SZ_1M);
40  }
41  
42  static int __init plat_of_setup(void)
43 -- 
44 1.7.10.4
45