From mboxrd@z Thu Jan 1 00:00:00 1970 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 AEC40C61DA4 for ; Mon, 6 Feb 2023 12:51:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D842785BDA; Mon, 6 Feb 2023 13:51:38 +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="E7QiT/A6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C62AF85BDA; Mon, 6 Feb 2023 13:51:37 +0100 (CET) Received: from xtrwsqbh.outbound-mail.sendgrid.net (xtrwsqbh.outbound-mail.sendgrid.net [167.89.100.176]) (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 29FAC85B7A for ; Mon, 6 Feb 2023 13:51:28 +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=mime-version:subject:references:from:in-reply-to:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=E1XiFXb1xHvAVqqWaCdapQpPaWzuK/LDS3LXju9HkCQ=; b=E7QiT/A6e4IrPCU+EcBZPet2V1QvP2rSfqbGUtrVxwIEcqxJkDjLXrTLIRxh+XkeBCpS agy4u0T1ygKW1gMglCAtmYc0MSJjJKrWsTQngJlnBgEnhvhnVUNQHryiS7IAM65hl1WZ48 ttUvdSUq3LvvKGWW+xad7K2+iM5DGwwZqJmwoNlgw1wATgtTfEAQrIp5D+4E6f0wNDLZMN bFj2zB7d1Ri7jHu8ybA4pdELaVr+31Sx7rIeoMBdIhZzSx+/bWWR8r7FRQcxaB6Dk/glX8 IxaIYCDZM6bc/LMrooKowN8siCvLduRNNIGBtpyPurr8Rr1sQTI/eR2G7S+tqJ1g== Received: by filterdrecv-6b9548745c-qkbjd with SMTP id filterdrecv-6b9548745c-qkbjd-1-63E0F7CE-1F 2023-02-06 12:51:26.501792275 +0000 UTC m=+6961393.256607373 Received: from [192.168.1.50] (unknown) by geopod-ismtpd-6-2 (SG) with ESMTP id mCLpxQgyQBWTPKb9DPdbUA Mon, 06 Feb 2023 12:51:26.137 +0000 (UTC) Message-ID: Date: Mon, 06 Feb 2023 12:51:26 +0000 (UTC) MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 2/3] rockchip: Require an external TPL binary when TPL is missing Content-Language: en-US References: <20230205202116.2891673-1-jonas@kwiboo.se> <20230205202116.2891673-3-jonas@kwiboo.se> <7dfdb217-71fe-a89e-0268-f9efb8941de8@theobroma-systems.com> From: Jonas Karlman In-Reply-To: <7dfdb217-71fe-a89e-0268-f9efb8941de8@theobroma-systems.com> X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h43INsl=2FcJv5yeiuU?= =?us-ascii?Q?rmq4h1Po7u=2FTb3nbPMERnJyRhmftaTtFgZswydE?= =?us-ascii?Q?cOIzs=2Fxc+3epB9PHs60XvxvsH3PTyx1vlf3HQXY?= =?us-ascii?Q?Hf4FtKyAoOj0u+yLvAUb+gYaOMhq4XsXnNQkgBE?= =?us-ascii?Q?4E9jFi1uUHMsjviqHnK=2FMCzzCXPxQYvijIwya8?= To: Quentin Schulz , Simon Glass , Philipp Tomsich , Kever Yang , Joseph Chen , Alper Nebi Yasak Cc: Jagan Teki , Heinrich Schuchardt , u-boot@lists.denx.de X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Hi Quentin, On 2023-02-06 12:26, Quentin Schulz wrote: > Hi Jonas, > > On 2/5/23 21:21, Jonas Karlman wrote: >> Rockchip SoCs typically use U-Boot TPL to initialize DRAM, then jumps >> back to boot-rom to load the next stage of the boot flow, U-Boot SPL. >> >> For RK356x there is currently no support to initialize DRAM using U-Boot >> TPL and instead an external TPL binary must be used to generate a >> working u-boot-rockchip.bin image. >> >> Use the new external-tpl entry unless CONFIG_TPL=y to indicate that an >> external TPL binary must be provided to generate a working firmware. >> >> Signed-off-by: Jonas Karlman >> --- >> Makefile | 1 + >> arch/arm/dts/rockchip-u-boot.dtsi | 16 ++++++++++++---- >> tools/binman/missing-blob-help | 5 +++++ >> 3 files changed, 18 insertions(+), 4 deletions(-) >> >> diff --git a/Makefile b/Makefile >> index 7eaf45496c1c..7e9272be937f 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -1332,6 +1332,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 external-tpl-path=$(EXTERNAL_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..bc3bc9bc3e37 100644 >> --- a/arch/arm/dts/rockchip-u-boot.dtsi >> +++ b/arch/arm/dts/rockchip-u-boot.dtsi >> @@ -20,12 +20,16 @@ >> mkimage { >> filename = "idbloader.img"; >> args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; >> -#ifdef CONFIG_TPL >> multiple-data-files; >> >> +#ifdef CONFIG_TPL >> u-boot-tpl { >> - }; >> +#else >> + external-tpl { >> + filename = "ddr.bin"; >> + missing-msg = "external-tpl-rockchip"; >> #endif >> + }; > > NACK. This forces the use of a TPL (either built by U-Boot or external) > which is not always the case. There are still boards without a TPL which > work perfectly fine (at least I would hope so :) ). > > Basically there are three possible cases: > SPL > TPL+SPL > TPL(external blob)+SPL > > Here you remove the ability to have SPL only. > > Hence why I suggested we add a new Kconfig option for EXTERNAL_TPL, not > for the path but to explicit this third possibility. Thanks for the feedback, I will add a Kconfig option to make this explicit. We could also add the optional prop in the external-tpl node to only include the external TPL when it is provided. This will require also fixing the missing/optional handling for the mkimage entry. Regards, Jonas > > Cheers, > Quentin > >> u-boot-spl { >> }; >> }; >> @@ -134,12 +138,16 @@ >> mkimage { >> filename = "idbloader-spi.img"; >> args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; >> -#ifdef CONFIG_TPL >> multiple-data-files; >> >> +#ifdef CONFIG_TPL >> u-boot-tpl { >> - }; >> +#else >> + external-tpl { >> + filename = "ddr.bin"; >> + missing-msg = "external-tpl-rockchip"; >> #endif >> + }; >> u-boot-spl { >> }; >> }; >> diff --git a/tools/binman/missing-blob-help b/tools/binman/missing-blob-help >> index c61ca02a35ee..e850824032dd 100644 >> --- a/tools/binman/missing-blob-help >> +++ b/tools/binman/missing-blob-help >> @@ -14,6 +14,11 @@ atf-bl31-sunxi: >> Please read the section on ARM Trusted Firmware (ATF) in >> board/sunxi/README.sunxi64 >> >> +external-tpl-rockchip: >> +External TPL is required to initialize DRAM. Get external TPL binary and >> +build with EXTERNAL_TPL=/path/to/ddr.bin. One possible source for >> +external TPL binary is https://urldefense.com/v3/__https://github.com/rockchip-linux/rkbin__;!!OOPJP91ZZw!jRwonQRHKoxzegx3S3cRYfalkhW1ESLyBCTmVc2c6fnmPaQBOZyxG2I7phwM3pEZxR2QIHQG8Hw3JStyx4tDcMsalwYDCg$ . >> + >> scp-sunxi: >> SCP firmware is required for system suspend, but is otherwise optional. >> Please read the section on SCP firmware in board/sunxi/README.sunxi64