Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FEB0C7EE23 for ; Sat, 25 Feb 2023 19:01:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1569485ADF; Sat, 25 Feb 2023 20:01:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="LGJv7RhC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3FDB854C8; Sat, 25 Feb 2023 20:01:37 +0100 (CET) Received: from cskrhhvt.outbound-mail.sendgrid.net (cskrhhvt.outbound-mail.sendgrid.net [198.21.0.135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3281B854C8 for ; Sat, 25 Feb 2023 20:01:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=g9JNZRMlqRk+0zV8BibEc/pS70xjt0vl4t+vtcgtdMk=; b=LGJv7RhCar14FX2I6Old63wQNQH5y8KOZx7A0dL27r+3vbXuGvtS/ckSvXZxfI50zDDx ymqhbZhK3BKiQXc03vgptq+ATlSSf8Btummg7Q0lqEuVjUzVpvwtSGH42HOP88+ou0OPCh g+ZR3/0UjF+7VNFZ6ysT/oFyZRbluV6ZnPoXpYFrKmlfeaxAaYvcyCLxKYDFxDc1VwC1Gi BmhT9p0fnFejaPKvQIB3WnrY+BYmycqWu5o5WqfOhuDVCDoBvto/Qq8kFRgwqEgtA5i3fo n+TI/oaXAX2qSOlCOm1qMaFzp6eh3HhUplTl1uJBWLFhD+aXzF5wy0mBsrKNd1Gw== Received: by filterdrecv-68f8d557c9-k5m87 with SMTP id filterdrecv-68f8d557c9-k5m87-1-63FA5B0D-99 2023-02-25 19:01:33.798404346 +0000 UTC m=+329404.761602675 Received: from bionic.localdomain (unknown) by geopod-ismtpd-4-1 (SG) with ESMTP id T_y-jBbNRxOyfyevNQJlyA Sat, 25 Feb 2023 19:01:33.588 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v5 2/6] rockchip: Use an external TPL binary on RK3568 Date: Sat, 25 Feb 2023 19:01:34 +0000 (UTC) Message-Id: <20230225190130.2564462-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225190130.2564462-1-jonas@kwiboo.se> References: <20230225190130.2564462-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h14dBBDkeBKaIAbvI?= =?us-ascii?Q?EUmD5E5nD60Yue1m490yAFzLoGtY2QLALd=2FzlkU?= =?us-ascii?Q?om7XedgL6Qt7GJ=2Fe5=2F+3wk9HimN0US87dMpHT3N?= =?us-ascii?Q?ShLye+z3grE4V7m2fdx71zRMpqXsoQ2ob5dBXSR?= =?us-ascii?Q?fiakLSorMcUX7POKNABeo4R82geeoSpebJ+935?= To: Kever Yang , Simon Glass , Philipp Tomsich , Joseph Chen , Alper Nebi Yasak Cc: Quentin Schulz , Jagan Teki , Heinrich Schuchardt , Eugen Hristev , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Rockchip SoCs typically use U-Boot TPL to initialize DRAM, then jumps back to BootRom to load next stage, U-Boot SPL, into DRAM. BootRom then jumps to U-Boot SPL to continue the normal boot flow. However, there is no support to initialize DRAM on RK35xx SoCs using U-Boot TPL and instead an external TPL binary must be used to generate a bootable u-boot-rockchip.bin image. Add CONFIG_ROCKCHIP_EXTERNAL_TPL to indicate that an external TPL should be used. Build U-Boot with ROCKCHIP_TPL=/path/to/ddr.bin to generate a bootable u-boot-rockchip.bin image for RK3568. Signed-off-by: Jonas Karlman Reviewed-by: Simon Glass Reviewed-by: Kever Yang Tested-by: Eugen Hristev --- v5: - No change v4: - No change v3: - Add help text to Kconfig option - Add build step for rk3568 to documentation - Collect r-b and t-b tags v2: - Rename external-tpl-path to rockchip-tpl-path - Rename EXTERNAL_TPL to ROCKCHIP_TPL - Add CONFIG_ROCKCHIP_EXTERNAL_TPL option Makefile | 1 + arch/arm/dts/rockchip-u-boot.dtsi | 10 ++++++++-- arch/arm/mach-rockchip/Kconfig | 8 ++++++++ doc/board/rockchip/rockchip.rst | 11 +++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bc1ee94fb74e..67701f20eb6d 100644 --- a/Makefile +++ b/Makefile @@ -1336,6 +1336,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ -a opensbi-path=${OPENSBI} \ -a default-dt=$(default_dt) \ -a scp-path=$(SCP) \ + -a rockchip-tpl-path=$(ROCKCHIP_TPL) \ -a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \ -a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \ -a spl-dtb=$(CONFIG_SPL_OF_REAL) \ diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 6c662a72d4f9..2878b80926c4 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -20,9 +20,12 @@ mkimage { filename = "idbloader.img"; args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; -#ifdef CONFIG_TPL multiple-data-files; +#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL + rockchip-tpl { + }; +#elif defined(CONFIG_TPL) u-boot-tpl { }; #endif @@ -134,9 +137,12 @@ mkimage { filename = "idbloader-spi.img"; args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; -#ifdef CONFIG_TPL multiple-data-files; +#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL + rockchip-tpl { + }; +#elif defined(CONFIG_TPL) u-boot-tpl { }; #endif diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index b678ec41318e..0b191b364264 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -401,6 +401,14 @@ config TPL_ROCKCHIP_COMMON_BOARD common board is a basic TPL board init which can be shared for most of SoCs to avoid copy-paste for different SoCs. +config ROCKCHIP_EXTERNAL_TPL + bool "Use external TPL binary" + default y if ROCKCHIP_RK3568 + help + Some Rockchip SoCs require an external TPL to initialize DRAM. + Enable this option and build with ROCKCHIP_TPL=/path/to/ddr.bin to + include the external TPL in the image built by binman. + config ROCKCHIP_BOOT_MODE_REG hex "Rockchip boot mode flag register address" help diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst index 28c837a38200..ac4dcce1a77d 100644 --- a/doc/board/rockchip/rockchip.rst +++ b/doc/board/rockchip/rockchip.rst @@ -86,6 +86,8 @@ List of mainline supported Rockchip boards: - Radxa ROCK Pi 4 (rock-pi-4-rk3399) - Rockchip Evb-RK3399 (evb_rk3399) - Theobroma Systems RK3399-Q7 SoM - Puma (puma_rk3399) +* rk3568 + - Rockchip Evb-RK3568 (evb-rk3568) * rv1108 - Rockchip Evb-rv1108 (evb-rv1108) - Elgin-R1 (elgin-rv1108) @@ -167,6 +169,15 @@ To build rk3399 boards: make evb-rk3399_defconfig make CROSS_COMPILE=aarch64-linux-gnu- +To build rk3568 boards: + +.. code-block:: bash + + export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf + export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.13.bin + make evb-rk3568_defconfig + make CROSS_COMPILE=aarch64-linux-gnu- + Flashing -------- -- 2.39.2