aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-01-12 12:07:26 +0000
committerJohn Crispin <blogic@openwrt.org>2014-01-12 12:07:26 +0000
commit1ba82b12c72e2154dfbbf1398ba5fc7b9fe59389 (patch)
tree1890e75a296570d6c835826fbd56ecd6a3ef0f24 /target/linux
parent8abf84130ae8c80170d4421775e8a54227d169e4 (diff)
downloadupstream-1ba82b12c72e2154dfbbf1398ba5fc7b9fe59389.tar.gz
upstream-1ba82b12c72e2154dfbbf1398ba5fc7b9fe59389.tar.bz2
upstream-1ba82b12c72e2154dfbbf1398ba5fc7b9fe59389.zip
ralink: honour memory@0 node
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39234 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/patches-3.10/999-memory-detect.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-3.10/999-memory-detect.patch b/target/linux/ramips/patches-3.10/999-memory-detect.patch
new file mode 100644
index 0000000000..2e857fbc44
--- /dev/null
+++ b/target/linux/ramips/patches-3.10/999-memory-detect.patch
@@ -0,0 +1,34 @@
+Index: linux-3.10.26/arch/mips/ralink/of.c
+===================================================================
+--- linux-3.10.26.orig/arch/mips/ralink/of.c 2014-01-12 11:49:40.292069849 +0100
++++ linux-3.10.26/arch/mips/ralink/of.c 2014-01-12 12:38:01.236138974 +0100
+@@ -80,6 +80,16 @@
+ }
+
+ extern struct boot_param_header __image_dtb;
++static int memory_dtb;
++
++static int __init early_init_dt_find_memory(unsigned long node, const char *uname,
++ int depth, void *data)
++{
++ if (depth == 1 && !strcmp(uname, "memory@0"))
++ memory_dtb = 1;
++
++ return 0;
++}
+
+ void __init plat_mem_setup(void)
+ {
+@@ -90,8 +100,10 @@
+ * parsed resulting in our memory appearing
+ */
+ __dt_setup_arch(&__image_dtb);
+-
+- if (soc_info.mem_size)
++ of_scan_flat_dt(early_init_dt_find_memory, NULL);
++ if (memory_dtb)
++ of_scan_flat_dt(early_init_dt_scan_memory, NULL);
++ else if (soc_info.mem_size)
+ add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
+ BOOT_MEM_RAM);
+ else