aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/jz4740/setup.c
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2015-05-24 16:11:42 +0100
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 21:53:22 +0200
commit6ec127fb3c7754d3dc6614e9744386fbe652927f (patch)
treea8b9195f3351f800cba73611e2b7da148f8d490d /arch/mips/jz4740/setup.c
parentMIPS: JZ4740: remove clock.h (diff)
downloadlinux-dev-6ec127fb3c7754d3dc6614e9744386fbe652927f.tar.xz
linux-dev-6ec127fb3c7754d3dc6614e9744386fbe652927f.zip
MIPS: JZ4740: only detect RAM size if not specified in DT
Allow a devicetree to specify the memory present in the system rather than probing it from the memory controller. This both saves the probing for systems where the amount of memory is fixed, and will simplify the bringup of later Ingenic SoCs where the memory controller register layout differs. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/10163/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/jz4740/setup.c')
-rw-r--r--arch/mips/jz4740/setup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c
index 8c08d7dcda66..1bed3cb062b3 100644
--- a/arch/mips/jz4740/setup.c
+++ b/arch/mips/jz4740/setup.c
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/irqchip.h>
#include <linux/kernel.h>
+#include <linux/libfdt.h>
#include <linux/of_fdt.h>
#include <linux/of_platform.h>
@@ -55,9 +56,14 @@ static void __init jz4740_detect_mem(void)
void __init plat_mem_setup(void)
{
+ int offset;
+
jz4740_reset_init();
- jz4740_detect_mem();
__dt_setup_arch(__dtb_start);
+
+ offset = fdt_path_offset(__dtb_start, "/memory");
+ if (offset < 0)
+ jz4740_detect_mem();
}
void __init device_tree_init(void)