Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752384AbbEXPbi (ORCPT ); Sun, 24 May 2015 11:31:38 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:16309 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359AbbEXPbf (ORCPT ); Sun, 24 May 2015 11:31:35 -0400 From: Paul Burton To: CC: Paul Burton , Lars-Peter Clausen , Ralf Baechle , Subject: [PATCH v5 32/37] MIPS: JZ4740: only detect RAM size if not specified in DT Date: Sun, 24 May 2015 16:11:42 +0100 Message-ID: <1432480307-23789-33-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432480307-23789-1-git-send-email-paul.burton@imgtec.com> References: <1432480307-23789-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.159.140] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2327 Lines: 85 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 Cc: Lars-Peter Clausen Cc: Ralf Baechle Cc: linux-mips@linux-mips.org --- Changes in v5: None Changes in v4: None Changes in v3: - Rebase. Changes in v2: None arch/mips/Kconfig | 1 + arch/mips/jz4740/Makefile | 2 ++ arch/mips/jz4740/setup.c | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index e3c859c..f07a213 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -301,6 +301,7 @@ config MACH_INGENIC select GENERIC_IRQ_CHIP select BUILTIN_DTB select USE_OF + select LIBFDT config LANTIQ bool "Lantiq based platforms" diff --git a/arch/mips/jz4740/Makefile b/arch/mips/jz4740/Makefile index 7636432..70a9578 100644 --- a/arch/mips/jz4740/Makefile +++ b/arch/mips/jz4740/Makefile @@ -7,6 +7,8 @@ obj-y += prom.o time.o reset.o setup.o \ gpio.o platform.o timer.o serial.o +CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt + # board specific support obj-$(CONFIG_JZ4740_QI_LB60) += board-qi_lb60.o diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c index 8c08d7d..1bed3cb 100644 --- a/arch/mips/jz4740/setup.c +++ b/arch/mips/jz4740/setup.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -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) -- 2.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/