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 From patchwork Thu Dec 5 17:53:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1204761 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="yXmDiXOC"; 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 47TNfN4TKZz9sPW for ; Fri, 6 Dec 2019 04:55:08 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0DD5F816C5; Thu, 5 Dec 2019 18:53:48 +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="yXmDiXOC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE9CA816AD; Thu, 5 Dec 2019 18:53:45 +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 A8F328089E for ; Thu, 5 Dec 2019 18:53:38 +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 1798A24648; Thu, 5 Dec 2019 17:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575568417; bh=FG+znQUWDlUgv2/9agkTJVsEohk1BajmXfyL/aGKo14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yXmDiXOC/6avdvLQpiv/Xm8ZG5be1oBwvpaUSstNmdiqRZeoIwI3QcDfhV2rypvz/ tSUN4Avf/lRtNTcw07ItM/02wRHBIsfOCRDOW5Wsp6F03UdcD5moCZn3LzlQtkLA4H M2c+nROXm2lOWfWCBb1OfQfei1en4sXSyaaXdIp8= From: matthias.bgg@kernel.org To: Tom Rini , Alexander Graf , Heinrich Schuchardt Subject: [PATCH v2 2/3] rpi: Enable DRAM bank initialization on arm64 Date: Thu, 5 Dec 2019 18:53:14 +0100 Message-Id: <20191205175315.9225-2-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191205175315.9225-1-matthias.bgg@kernel.org> References: <20191205175315.9225-1-matthias.bgg@kernel.org> 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 Up to now we only update the DRAM banks when we are define CONFIG_BCM2711. But our one binary approach uses a config that supports BCM2837 and BCM2711. As a result we only see one gibibyte of RAM on Raspberry Pi 4, even if it has more RAM. Fix this by calling dram_init_banksize. Fixes: 5694090670 ("ARM: defconfig: add unified config for RPi3 and RPi4") Signed-off-by: Matthias Brugger --- Changes in v2: - fix commit message - call dram_init_banksize independent of ARM64 board/raspberrypi/rpi/rpi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index e19610f40f..e367ba3092 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -272,7 +272,6 @@ int dram_init(void) } #ifdef CONFIG_OF_BOARD -#ifdef CONFIG_BCM2711 int dram_init_banksize(void) { int ret; @@ -284,7 +283,6 @@ int dram_init_banksize(void) return fdtdec_setup_mem_size_base(); } #endif -#endif static void set_fdtfile(void) { From patchwork Thu Dec 5 17:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1204759 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="wVgveOPH"; 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 47TNdS1hS8z9sPL for ; Fri, 6 Dec 2019 04:54:20 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F02F8169A; Thu, 5 Dec 2019 18:53:45 +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="wVgveOPH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8A07581697; 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 E19AD81697 for ; Thu, 5 Dec 2019 18:53:40 +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 E9EB82464E; Thu, 5 Dec 2019 17:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575568419; bh=m1eIvYVFsm8D+RN2WcsdFI/Xje+VdyTEBjtDB5gCz1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wVgveOPHfm2uuTxL2za4RtImbzczuC13JIUHCqj51AcXR6fxBpHxzIbiUbDoWgs2B LllQgy5+LIn2iC0uGeWZ+XEMsZsr5pn3AhHiXYRnzXYA0SSw/euw0ZZiWDzDpgJb8/ nSn/5UcDu7wzSaYjabtFhfqeFz+i69sTd0NLjHsI= From: matthias.bgg@kernel.org To: Tom Rini , Alexander Graf , Heinrich Schuchardt Subject: [PATCH v2 3/3] ARM: defconfig: Fix 32bit config for RPi4 Date: Thu, 5 Dec 2019 18:53:15 +0100 Message-Id: <20191205175315.9225-3-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191205175315.9225-1-matthias.bgg@kernel.org> References: <20191205175315.9225-1-matthias.bgg@kernel.org> 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 The rpi_4_32b_defconfig states that only one DRAM bank is present. This leads to a wrong configuration of the available DRAM. Fix this by setting the DRAM bank config accordingly. Fixes: 193279d784 ("RPI: Add defconfigs for rpi4 (32/64)") Signed-off-by: Matthias Brugger --- Changes in v2: - fix rpi_4_32b_defconfig configs/rpi_4_32b_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig index 7ff390cd24..ce729df2a0 100644 --- a/configs/rpi_4_32b_defconfig +++ b/configs/rpi_4_32b_defconfig @@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x00008000 CONFIG_TARGET_RPI_4_32B=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ENV_SIZE=0x4000 -CONFIG_NR_DRAM_BANKS=1 +CONFIG_NR_DRAM_BANKS=2 CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set