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 D4853C433EF for ; Sun, 22 May 2022 00:55:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2766883E60; Sun, 22 May 2022 02:55:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mirx.dev Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mirx.dev header.i=@mirx.dev header.b="xg0bnaUK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="dlZ6ffQI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CFE783E63; Sun, 22 May 2022 02:55:17 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8AD0D83E31 for ; Sun, 22 May 2022 02:55:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mirx.dev Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andrew@mirx.dev Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2C66E5C0108; Sat, 21 May 2022 20:55:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 21 May 2022 20:55:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirx.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1653180911; x= 1653267311; bh=Kge8W5Zv6hZSSLhvdS5m7FTSU4KAO5AFla343bS8amE=; b=x g0bnaUKEhBl82l6qkTcJjVrk+0H13tZly1lwPDBdcOJqcrqzJ7yA9hq8vWn5dw/N wfu9s1MTLX4ReqAZJk+3mt9ajADUyGAg1+zE3yeiHHfpSk4UI3ZFDbSHriJYRaQn a83+lAaQsh1K6uWYhzup0S6o/wzfX9bx9BjffPPqfmkjyjHgz7Brj/ZNNJw4r1xI +eTF6dhhpxcOB5IguNvDV2yiUb40OU7pF2iDW+C5hrN6g4j9qP8PKzsijPs+5xaS Y2AkSuGV4ymUWjdQ6nG8MxBCdvhNOCERdbLUmtPiJtz29YvrTBizq0QQtzduaZ9i 7+96GD9HKiASeOxZfl03w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1653180911; x= 1653267311; bh=Kge8W5Zv6hZSSLhvdS5m7FTSU4KAO5AFla343bS8amE=; b=d lZ6ffQIgsuxWftvpXdNrqAppjbtbZVJ3q+3D/7TnkUw/xTgZREqvYZsP7uXbb0I3 jhaMVm6bnMGrNdViRMl92YXNJ/sFnHjeFY2bl/1BlKzn8rTpN5yp2zRMfhjTqZcY 9Wlu9npdf9NpMNA7F5XXOznUWmWatT90ZzTQ2cG7rhTOyym6fyJ862GdZokKM0Oi w2TZko/W5xJT6uTuzjBRaQyfIzVJ41qxiuBZyAM2KoRHemmZq5nzQ3ZsShwXgX0f nbciz6aA+m0oXAvjv/bc0LahlDpGF7cJ1GbZh3Wt9mfLzd1/XdhX8SAgKoCCp8ML W3in9hAObQp7Z/e1Ojhlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrieejgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegggfgtfffkuffhvfevofhfjgesthhqredtredtjeenucfhrhhomhepfdetnhgu rhgvficutegssghothhtfdcuoegrnhgurhgvfiesmhhirhigrdguvghvqeenucggtffrrg htthgvrhhnpefhfeehgfetleekveevleduleeltedvhfevudevtdfhkeelleefjeekueev uefhvdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhithgsrdhinhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesmhhi rhigrdguvghv X-ME-Proxy: Feedback-ID: i9671468b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 May 2022 20:55:06 -0400 (EDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 22 May 2022 10:55:03 +1000 Message-Id: Subject: Re: [RFC PATCH v2 2/8] rockchip: Add binman definitions for final images From: "Andrew Abbott" To: "Alper Nebi Yasak" Cc: "Jagan Teki" , "Johan Jonker" , "Simon Glass" , "Samuel Dionne-Riel" , "Peter Robinson" , "Kever Yang" , "Philipp Tomsich" , "U-Boot Mailing List" X-Mailer: aerc 0.9.0 References: <20220516110712.178958-1-andrew@mirx.dev> <20220516110712.178958-3-andrew@mirx.dev> <1524e013-99a7-5aa6-3d2f-c13dbb208605@gmail.com> In-Reply-To: <1524e013-99a7-5aa6-3d2f-c13dbb208605@gmail.com> 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.5 at phobos.denx.de X-Virus-Status: Clean On Thu May 19, 2022 at 9:36 PM AEST, Alper Nebi Yasak wrote: > > For RK3399 targets: > > > > - u-boot.rom > > - SPI image specific to the bob Chromebook target (see > > c4cea2bbf995764f325a907061c22ecd6768cf7b). > > I'm not sure we need anything special for the rk3399 chromebooks. I > think it's meant to be your 'u-boot-rockchip-spi.bin', but is just > incomplete (and partially broken, e.g. it should use u-boot.itb). > > I'll try to test things on my chromebook_kevin later on, but probably > not before you can send a v3... > > > This commit adds binman definitions to produce these images: > > > > - idbloader.img > > - rksd-formatted [TPL + ] SPL, as before. > > Do we need the 'idbloader.img' as a build output, assuming we have a > working 'u-boot-rockchip.bin'? I'm asking because Simon was trying to > drop it in a similar patch [1]. I was keeping it for backwards compatibility, mainly because it's mentioned in 'rockchip.rst' and it implies that 'idbloader.img' goes on a separate partition to 'u-boot.itb' for targets supporting Fastboot. If we can drop it, then I'll gladly do so! > [1] rockchip: Support building the all output files in binman > https://lore.kernel.org/u-boot/20220223230040.159317-24-sjg@chromium.org/ > > > - u-boot-rockchip.bin > > - [TPL + ] SPL all rksd-formatted + u-boot.itb padded for SD/MMC > > usage, as before. > > - u-boot-rockchip-spi.bin > > - [TPL + ] SPL all rkspi-formatted + u-boot.itb padded for SPI > > usage. > > > > This commit also generalizes the CONFIG_ROCKCHIP_SPI_IMAGE config > > setting - it now means to generate a generic SPI flash image, in > > addition to the generic SD/MMC image. > > With what I said above, I think you should rename this to 'u-boot.rom' > and remove the definitions in {rk3288,rk3399}-u-boot.dtsi. Makes sense to me - I just wonder if the name 'u-boot.rom' is too generic, since it will be an image specifically for Rockchip targets. Then again, perhaps the original 'u-boot-rockchip.bin' name was redundant, since you know what target you're building for by using a specific defconfig in the first place. > > Question: Does this break/not play nicely with rockchip-optee > > generation? It creates u-boot.itb for rk3288 targets. That would need t= o > > run before what I've implemented here? > > The 'u-boot.itb' entries you add here are guarded with CONFIG_ARM64, so > don't apply to RK3288. I think that's fine until we can convert these > 'u-boot.itb's to be completely binman-built as well. Oh, good point. > OTOH, things appear work fine if I: > > - Replace CONFIG_ARM64 with CONFIG_SPL_FIT below > - Include rockchip-optee before rockchip-u-boot in rk3288-u-boot.dtsi > - Move the empty binman node to rk3288-u-boot.dtsi above both includes > > at least, until the patch that forces Makefile to build 'u-boot.itb'. In that case, I'll just leave it as is for now. > > +#ifdef CONFIG_TPL > > + u-boot-tpl {}; > > +#endif > > + u-boot-spl {}; > > The closing braces should be on their own line, more instances below as > well. > > - u-boot-img { > > +#ifdef CONFIG_ARM64 > > Probably "#if defined(CONFIG_SPL_FIT) && defined(CONFIG_ARM64)" is > better, like in Simon's patch. Likewise in the SPI image below. > > + u-boot-fit { > > + filename =3D "u-boot.itb"; > > + type =3D "blob"; > > offset =3D ; > > }; > > +#else > > + u-boot-img {}; > > I think this still needs the "offset =3D ;" which > shouldn't be removed. > > +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE > > +&binman { > > + spi-image { > > + filename =3D "u-boot-rockchip-spi.bin"; > > + pad-byte =3D <0xff>; > > + > > + mkimage { > > + args =3D "-n", CONFIG_SYS_SOC, "-T", "rkspi"; > > + > > +#ifdef CONFIG_TPL > > + u-boot-tpl {}; > > +#endif > > + u-boot-spl {}; > > + }; > > + > > +#ifdef CONFIG_ARM64 > > + blob { > > This should have the same name & type as the one in the other image. > > > + filename =3D "u-boot.itb"; > > + offset =3D ; > > + }; > > +#else > > + u-boot-img {}; > > I think this also needs "offset =3D ;". > > > #endif > > + }; > > +}; > Also consider adding a 'fdtmap' entry to both SPI and SD/MMC images, > it's useful for some interactive binman features. > > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kc= onfig > > index 18aff5480b..7149b9a530 100644 > > --- a/arch/arm/mach-rockchip/Kconfig > > +++ b/arch/arm/mach-rockchip/Kconfig > > @@ -415,12 +415,11 @@ config SPL_MMC > > > > config ROCKCHIP_SPI_IMAGE > > bool "Build a SPI image for rockchip" > > - depends on HAS_ROM > > help > > Some Rockchip SoCs support booting from SPI flash. Enable this > > - option to produce a 4MB SPI-flash image (called u-boot.rom) > > - containing U-Boot. The image is built by binman. U-Boot sits near > > - the start of the image. > > + option to produce an SPI-flash image (called u-boot-rockchip-spi.bi= n) > > + containing TPL (if enabled) and SPL, and U-Boot proper at the offse= t > > + CONFIG_SYS_SPI_U_BOOT_OFFS. The image is built by binman. > > While renaming 'u-boot-rockchip-spi.bin' to 'u-boot.rom' you should drop > these Kconfig changes as well, and select HAS_ROM wherever you select > ROCKCHIP_SPI_IMAGE (i.e. in the last patch). Thanks for your comments, I'll make the changes for the next version.