ralink: add back the gpio_export_named() patch for 3.14
[openwrt/svn-archive/archive.git] / target / linux / ramips / patches-3.14 / 0008-MIPS-ralink-allow-manual-memory-override.patch
1 From 071e97587a291d3a5bbd614a425f46b7f90310aa Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sun, 16 Mar 2014 04:40:48 +0000
4 Subject: [PATCH 08/57] MIPS: ralink: allow manual memory override
5
6 RT5350 relies on the bootloader setting up the memc correctly.
7 On sme boards the setup is incorrect leading to 32 MB being available but only 16 being recognized. Allow these boards to manually override the memory range
8 .
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 ---
11 arch/mips/ralink/of.c | 16 +++++++++++++++-
12 1 file changed, 15 insertions(+), 1 deletion(-)
13
14 diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
15 index eccc552..1b81e8f 100644
16 --- a/arch/mips/ralink/of.c
17 +++ b/arch/mips/ralink/of.c
18 @@ -78,6 +78,17 @@ void __init device_tree_init(void)
19 free_bootmem(base, size);
20 }
21
22 +static int memory_dtb;
23 +
24 +static int __init early_init_dt_find_memory(unsigned long node, const char *uname,
25 + int depth, void *data)
26 +{
27 + if (depth == 1 && !strcmp(uname, "memory@0"))
28 + memory_dtb = 1;
29 +
30 + return 0;
31 +}
32 +
33 void __init plat_mem_setup(void)
34 {
35 set_io_port_base(KSEG1);
36 @@ -88,7 +99,10 @@ void __init plat_mem_setup(void)
37 */
38 __dt_setup_arch(&__dtb_start);
39
40 - if (soc_info.mem_size)
41 + of_scan_flat_dt(early_init_dt_find_memory, NULL);
42 + if (memory_dtb)
43 + of_scan_flat_dt(early_init_dt_scan_memory, NULL);
44 + else if (soc_info.mem_size)
45 add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
46 BOOT_MEM_RAM);
47 else
48 --
49 1.7.10.4
50