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 705D3C433F5 for ; Thu, 19 May 2022 11:39:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C06DA83F48; Thu, 19 May 2022 13:39:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="kI6ihvYm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 214F483BDB; Thu, 19 May 2022 13:39:28 +0200 (CEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 65A5F83BDB for ; Thu, 19 May 2022 13:39:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ej1-x633.google.com with SMTP id wh22so9235739ejb.7 for ; Thu, 19 May 2022 04:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=L/Mu89jqD5Xg6322ABrT8g9Iw0NXbj6nE9kYGmhvNho=; b=kI6ihvYmCMH2lAmnUB9/0qRLI1F5LvFQVRwj/utMejP48YCXJgXI8Wua3QQ+f8V71Z q19jcNcYVBXf1iG8rZOnyBsBnLuceMoQz6kjQ/VIxV3esjRdhkg7XhH83vG/wbwh6pP2 QSH+y65SmQbiDKd5Gvr08Xi5ZNtb6O/JGnwUhp6VNpTa+8Vx2mQQe0bD719smWkHCgwt qWc1Tpjn5eV1ZXPr0UOlGE6OxERLB1/7JOgoavu0s4JgsrdQ1MMdvsNsmo7X8aiRkDSZ lmkMAwP6fukzPSOHJjk/6ACZ+ZMfVEvPf3FuCZL2Ebelii+IykFVDvadL0ojLSyawj7M vMLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=L/Mu89jqD5Xg6322ABrT8g9Iw0NXbj6nE9kYGmhvNho=; b=bcxCXdX5BcY2crg6jKnIh+w7xOjg4wz2Qy7L9Go7lji/4EoJMKoufsiIP3t+wAWRON rUP07Kp9fjB/aI1AyRKT/kKGkyO4lm/h1b1c91XCoQ25i/S8B2jdaP7YWUr2Sd3bJ/zn L7VFYyrvvlPt3InobvMPhfmTOG73OJoGwOjK/wkB7NBiHlanLdD+3d0v3i2ULzJlcrNk aBz5zlrYiHS3yHCGZ44/utL2u1lR19i+V/47jDWaTlT7z8kxwx0zKYSUbEeWFkixh8UD fHE0L+Wk3AMQatiI+QfwNc7+n+pJ7GCRd8O8IPioSUyZz7oYYd8beJ+gqO1y7l1cvqKK XIaw== X-Gm-Message-State: AOAM5300czOf/WeFc98oz6Wa2r+iu6DgvoQ2s1BohjsV1WTo+200XjtU pBME6+ddXvvJ6Idtg0KgrTo= X-Google-Smtp-Source: ABdhPJxLj2qWDBjvgQlcGJmIZw5oXBlm+9Wtq2jvCcA3wmsHNJawm7qY0jCn+KLORiBT+DA8k4JHCw== X-Received: by 2002:a17:907:2cc5:b0:6f9:1fc:ebef with SMTP id hg5-20020a1709072cc500b006f901fcebefmr3778591ejc.121.1652960363889; Thu, 19 May 2022 04:39:23 -0700 (PDT) Received: from [192.168.0.74] ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id ee46-20020a056402292e00b0042617ba63aesm2738633edb.56.2022.05.19.04.39.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 04:39:23 -0700 (PDT) Message-ID: <1524e013-99a7-5aa6-3d2f-c13dbb208605@gmail.com> Date: Thu, 19 May 2022 14:36:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 From: Alper Nebi Yasak Subject: Re: [RFC PATCH v2 2/8] rockchip: Add binman definitions for final images To: Andrew Abbott Cc: Jagan Teki , Johan Jonker , Simon Glass , Samuel Dionne-Riel , Peter Robinson , Kever Yang , Philipp Tomsich , U-Boot Mailing List References: <20220516110712.178958-1-andrew@mirx.dev> <20220516110712.178958-3-andrew@mirx.dev> Content-Language: en-US In-Reply-To: <20220516110712.178958-3-andrew@mirx.dev> Content-Type: text/plain; charset=UTF-8 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.5 at phobos.denx.de X-Virus-Status: Clean On 16/05/2022 14:07, Andrew Abbott wrote: > Currently, building for Rockchip targets produces: > > - idbloader.img > - rksd-formatted TPL with SPL appended; or > - rksd-formatted SPL > - u-boot.itb > - U-Boot Proper FIT image > - u-boot-rockchip.bin > - idbloader.img + u-boot.itb, padded the correct amount for SD/MMC > usage. > > 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]. [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. > > Signed-off-by: Andrew Abbott > --- > Question: Does this break/not play nicely with rockchip-optee > generation? It creates u-boot.itb for rk3288 targets. That would need to > 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. 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'. > > Changes in v2: > - Revert u-boot-rockchip-sdmmc.bin name to u-boot-rockchip.bin, to > keep the name the same as before. > - Fix whitespace issues. > > arch/arm/dts/rockchip-u-boot.dtsi | 53 +++++++++++++++++++++++++++++-- > arch/arm/mach-rockchip/Kconfig | 7 ++-- > 2 files changed, 53 insertions(+), 7 deletions(-) > > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi > index eae3ee715d..9354b0f5a7 100644 > --- a/arch/arm/dts/rockchip-u-boot.dtsi > +++ b/arch/arm/dts/rockchip-u-boot.dtsi > @@ -13,17 +13,64 @@ > > #ifdef CONFIG_SPL > &binman { > - simple-bin { > + sdmmc-idbloader { > + filename = "idbloader.img"; > + > + mkimage { > + args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; > + > +#ifdef CONFIG_TPL > + u-boot-tpl {}; > +#endif > + u-boot-spl {}; The closing braces should be on their own line, more instances below as well. > + }; > + }; > + > + sdmmc-image { > filename = "u-boot-rockchip.bin"; > pad-byte = <0xff>; > > - blob { > + idbloader { > filename = "idbloader.img"; > + type = "blob"; > }; > > - 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 = "u-boot.itb"; > + type = "blob"; > offset = ; > }; > +#else > + u-boot-img {}; I think this still needs the "offset = ;" which shouldn't be removed. > +#endif > }; > }; > + > +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE > +&binman { > + spi-image { > + filename = "u-boot-rockchip-spi.bin"; > + pad-byte = <0xff>; > + > + mkimage { > + args = "-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 = "u-boot.itb"; > + offset = ; > + }; > +#else > + u-boot-img {}; I think this also needs "offset = ;". > #endif > + }; > +}; Also consider adding a 'fdtmap' entry to both SPI and SD/MMC images, it's useful for some interactive binman features. > +#endif // CONFIG_ROCKCHIP_SPI_IMAGE > +#endif // CONFIG_SPL > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig > 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.bin) > + containing TPL (if enabled) and SPL, and U-Boot proper at the offset > + 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). > > config LNX_KRNL_IMG_TEXT_OFFSET_BASE > default SYS_TEXT_BASE