From patchwork Thu Dec 5 17:53:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1204760 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="CeBjfKHn"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47TNdn5KKgz9sPL for ; Fri, 6 Dec 2019 04:54:37 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC8EA816B5; Thu, 5 Dec 2019 18:53:46 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: mail.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="CeBjfKHn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0FB7816A5; Thu, 5 Dec 2019 18:53:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 47C01807F8 for ; Thu, 5 Dec 2019 18:53:37 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=matthias.bgg@kernel.org Received: from ziggy.cz (unknown [37.223.145.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38DDA206DB; Thu, 5 Dec 2019 17:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575568415; bh=uUBVJ1EB6/ymvzLZDw7NUXBzBXw3WDaYLoAhwetm4+A=; h=From:To:Cc:Subject:Date:From; b=CeBjfKHni2Lr5pBJZt9qzoTXundWlpMkQOe/IBYCabUXoK0Zty/vujoCJpm1bal4Z e2Zq9JY4viyjFc/0ExuDZvTYx00iFcDo0kKuAcrtosnow53d7hCuuqaoLCsH2cagHL neOPghv4+ne/Me9kYphYHXpMZ0Q08Bmutt+GtMf0= From: matthias.bgg@kernel.org To: Tom Rini , Alexander Graf , Heinrich Schuchardt Subject: [PATCH v2 1/3] rpi: fix dram bank initialization Date: Thu, 5 Dec 2019 18:53:13 +0100 Message-Id: <20191205175315.9225-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, Matthias Brugger , fvogt@suse.de, matthias.bgg@kernel.org Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at mail.denx.de X-Virus-Status: Clean From: Matthias Brugger To update the dram bank information from device-tree we use fdtdec_decode_ram_size() which expectes the the size-cells and address-cells to be defined in the memory node. For normal system RAM these values are defined in the root node. When the values differ from the default values defined in the spec, we can end up with wrong RAM bank information. Switch to the "standard" way to update the RAM bank information to avoid this. Fixes: 9de5b89e4c ("rpi4: enable dram bank initialization") Signed-off-by: Matthias Brugger --- Changes in v2: None board/raspberrypi/rpi/rpi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 5f120ea9c2..e19610f40f 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -275,8 +275,13 @@ int dram_init(void) #ifdef CONFIG_BCM2711 int dram_init_banksize(void) { - return fdtdec_decode_ram_size(gd->fdt_blob, NULL, 0, NULL, - (phys_size_t *)&gd->ram_size, gd->bd); + int ret; + + ret = fdtdec_setup_memory_banksize(); + if (ret) + return ret; + + return fdtdec_setup_mem_size_base(); } #endif #endif