From patchwork Tue May 29 16:37:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 922240 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40wKDG2nH7z9s1R for ; Wed, 30 May 2018 02:38:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E9DEAC21EEB; Tue, 29 May 2018 16:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AEFCBC21EA2; Tue, 29 May 2018 16:38:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8230EC21E49; Tue, 29 May 2018 16:38:02 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id DE77EC21F1D for ; Tue, 29 May 2018 16:37:58 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 40wKCV57YBz1r3K8; Tue, 29 May 2018 18:37:58 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 40wKCV4kCXz1qvSx; Tue, 29 May 2018 18:37:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id fI-pFmhn7G4E; Tue, 29 May 2018 18:37:57 +0200 (CEST) X-Auth-Info: u+kY3NPwzYZ8m1lAmHRzZp2o/+KXz7WxD0zOX5NqgMY= Received: from localhost.localdomain (cst-prg-12-21.cust.vodafone.cz [46.135.12.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 29 May 2018 18:37:56 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Tue, 29 May 2018 18:37:52 +0200 Message-Id: <20180529163752.29289-1-marex@denx.de> X-Mailer: git-send-email 2.17.0 Cc: Marek Vasut , Chin Liang See Subject: [U-Boot] [PATCH] ARM: socfpga: Pull DRAM size from DT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Pull the DRAM size from DT instead of hardcoding it into U-Boot. Signed-off-by: Marek Vasut Cc: Chin Liang See Cc: Dinh Nguyen Reviewed-by: Chin Liang See --- arch/arm/mach-socfpga/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index fca86507f1..bc6097cb1f 100644 --- a/arch/arm/mach-socfpga/misc.c +++ b/arch/arm/mach-socfpga/misc.c @@ -40,7 +40,9 @@ struct bsel bsel_str[] = { int dram_init(void) { - gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + if (fdtdec_setup_memory_size() != 0) + return -EINVAL; + return 0; }