From patchwork Fri Sep 6 11:56:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1158963 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=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=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="W6lb53DM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Pwy74PQJz9s7T for ; Fri, 6 Sep 2019 21:56:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 00C3BC21C2F; Fri, 6 Sep 2019 11:56: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=T_DKIM_INVALID 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 7D4E2C21C2F; Fri, 6 Sep 2019 11:56:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 086C9C21C2F; Fri, 6 Sep 2019 11:56:17 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 817EFC21C27 for ; Fri, 6 Sep 2019 11:56:17 +0000 (UTC) Received: from ziggy.de (unknown [37.223.145.23]) (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 A996B2084F; Fri, 6 Sep 2019 11:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567770975; bh=bNcBbkkjlI8TDrkoqi+bQtygqW1+KDEnHDNklwBPQUM=; h=From:To:Cc:Subject:Date:From; b=W6lb53DMXeR8NutIxS+duNgardzWG2DTOvF43+37wL4e+1FXeWjMV/DEJBt97d6pj BsRHYi4x5s2UNRLeTlKg0YXUOomKrDRIYDJ38Qm9fveRhmJN68sQBRdsEpkIL30T9l eDP4nODgm6Ekhtf31ryOJU6XXOq309LH5LIhhr0c= From: matthias.bgg@kernel.org To: Fred Bloggs , u-boot@lists.denx.de Date: Fri, 6 Sep 2019 13:56:10 +0200 Message-Id: <20190906115610.9175-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Cc: Alexander Graf , andrei@balena.io, Matthias Brugger Subject: [U-Boot] [PATCH] rpi4: enable dram bank initialization 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Matthias Brugger When booting through the efi stub, the memory map get's created by reading the dram bank information. Depending on the version of the RPi4 this information changes. Read the device tree to initialize the dram bank data structure. This way the kernel is able to access the whole range of available memory. Signed-off-by: Matthias Brugger --- This patch is based on basic RPi4 support implemented by series: https://www.mail-archive.com/u-boot@lists.denx.de/msg335667.html To actually work correctly we need the series that fixes the libftd: https://patchwork.ozlabs.org/cover/1158304/ board/raspberrypi/rpi/rpi.c | 8 ++++++++ configs/rpi_4_defconfig | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index fa57d50c95..eea8a69551 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -312,6 +312,14 @@ int dram_init(void) return 0; } +#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); +} +#endif + static void set_fdtfile(void) { const char *fdtfile; diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig index da8c960a2a..c639ac93de 100644 --- a/configs/rpi_4_defconfig +++ b/configs/rpi_4_defconfig @@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x00080000 CONFIG_TARGET_RPI_4=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 +CONFIG_NR_DRAM_BANKS=2 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set CONFIG_OF_BOARD=y CONFIG_OF_BOARD_SETUP=y