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 3F966C433EF for ; Wed, 27 Apr 2022 09:22:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BDA883C05; Wed, 27 Apr 2022 11:22:22 +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="H0d6pc1z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C5D3083E2B; Wed, 27 Apr 2022 11:22:20 +0200 (CEST) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 7EB6F83E15 for ; Wed, 27 Apr 2022 11:22:16 +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=jbx6244@gmail.com Received: by mail-ej1-x62f.google.com with SMTP id kq17so2175458ejb.4 for ; Wed, 27 Apr 2022 02:22:16 -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:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=TZ1bHswp7You7bFz/vTyQYvgd+ToAHN/9L+7McPnQ5Y=; b=H0d6pc1z1iD8OkwatUwXbtA0uaSgp1ejnSvj/RY5RPlZVnry5sZvM0sEa/0Akb/Xqz nGCdDu9uHKGKtPZYVn9QGUaHKyXe0vKOl1KI1j+hP0tX7f/9doGlyP7BKqE314HbBIZM HtuIGnf5HsQsWsTBMqkSYh3sv1wK+a4qLVfpe2+ftqXREEWfMPKC64NkcHEouXBvPIjV DfRPCM20XzqNaUblrnAu/Fwt6WAy5thmvNebbj/R7fTjp8tirg6AajaEVswzlk8x5GmM RFN0VfSAsWcJBkfRvj1qmLc34LTZWI8kHcajz809Nj5aeDpine7aorbeB4uxEQvqF3gp CO+A== 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:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=TZ1bHswp7You7bFz/vTyQYvgd+ToAHN/9L+7McPnQ5Y=; b=cSPzMXwtBh56YzcV/qhAVVhYaN2o45m3j4TLn9d6fV4Gu/ynSCdPxF7OHgehZjjFZm sImVtAa8F2jaJLbk7RRpM7VkB1fiXo+I3nMD6JAe8YrBWEyCKN2VHhtAc/hdT4I7oVvU SA2kk10PFOQJZ0zewm/W+UoOdH0AzeYqcqY67vTQNDcv6Z9f5mw7cYR5pInm3Yb2bni/ HgP+OVhCgHttVG7M8sMZLBL/L/bWZr2TXJ4uuInxye+8dtzLPQw0aVipV2fwpAM4wfUS O0pgyKmf3itLXr39bZBGBnh/CeEksFz2pe2igTz4yDPfRYP4VFlx1091dUA7gd0OfJIe BJ2w== X-Gm-Message-State: AOAM531HiDGp90LcEjW+I9wcrOYBKHGMS16SlnaMf5ILXxiZr9Ki/dfo WVTRzkAAcRe9Mlt5+JnZ4Y4= X-Google-Smtp-Source: ABdhPJw9j1LfowAp6OQlhC/NAYjJJMRO8hHlHaIfYL++V889bukNi2gXzlyBK6m6OK4BgD4Tme+ZmQ== X-Received: by 2002:a17:907:105d:b0:6f3:a3ea:cdfd with SMTP id oy29-20020a170907105d00b006f3a3eacdfdmr10320281ejb.704.1651051336021; Wed, 27 Apr 2022 02:22:16 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id g11-20020a1709061e0b00b006eff90d9c18sm6451936ejj.92.2022.04.27.02.22.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Apr 2022 02:22:15 -0700 (PDT) Message-ID: Date: Wed, 27 Apr 2022 11:22:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [RFC PATCH 2/8] rockchip: Add binman definitions for final images Content-Language: en-US To: Andrew Abbott , u-boot@lists.denx.de Cc: Simon Glass , Philipp Tomsich , Kever Yang , Peter Robinson , Akash Gajjar , Jagan Teki , Samuel Dionne-Riel References: <20220425000329.28124-1-andrew@mirx.dev> <20220425000329.28124-3-andrew@mirx.dev> From: Johan Jonker In-Reply-To: <20220425000329.28124-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 4/25/22 02:03, 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). > > This commit adds binman definitions to produce these images: > > - idbloader.img > - u-boot-rockchip-sdmmc.bin > - [TPL + ] SPL all rksd-formatted + u-boot.itb padded for SD/MMC > usage. > - 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. > > 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? > > --- > arch/arm/dts/rockchip-u-boot.dtsi | 59 +++++++++++++++++++++++++++---- > arch/arm/mach-rockchip/Kconfig | 7 ++-- > 2 files changed, 56 insertions(+), 10 deletions(-) > > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi > index eae3ee715d..05d79e6c55 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 { > - filename = "u-boot-rockchip.bin"; Hi, This name "u-boot-rockchip.bin"is in use in user space scripts and shows up in examples on the web. No desire for yet another naming variant. What you change must give exact the same result as we had in the existing situation. "git am " gives these warnings: warning: 3 lines add whitespace errors. Resulting dtsi is full of TAB and alignment issues. Use an editor with TAB highlighter. There's a trend to solve everything in python. Don't have knowledge about python, but there's a 3rd image format for NAND [1]. Could someone advise how to fit the extra XXX padding option in the mkimage.py file? (Simon ?) Could someone from Rockchip give info on whether the SD or SPI image format has similarity to the NAND image format to reuse code? (Kever ?) Missing are u-boot documents on Rockchip file formats itself other then reading the /tools/rkxxx.c code. Currently there's a small section about rkimage, rksd and rkspi in README.rockchip. Move that to rockchip.rst as well when busy with image formats in this serie? Johan === [1] [PATCH v4 11/19] rockchip: mkimage: add support for rockchip nand boot image https://lore.kernel.org/u-boot/45576df80a77657cb2245ea1d1fc2e69908a909d.1502974488.git.paweljarosz3691@gmail.com/ > - pad-byte = <0xff>; > + sdmmc-idbloader { > + filename = "idbloader.img"; > > - blob { > - filename = "idbloader.img"; > + mkimage { > + args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; > + > +#ifdef CONFIG_TPL > + u-boot-tpl {}; > +#endif > + u-boot-spl {}; > }; > + }; > + > + sdmmc-image { > + filename = "u-boot-rockchip-sdmmc.bin"; > + pad-byte = <0xff>; > + > + idbloader { > + filename = "idbloader.img"; > + type = "blob"; > + }; > > - u-boot-img { > +#ifdef CONFIG_ARM64 > + u-boot-fit { > + filename = "u-boot.itb"; > + type = "blob"; > offset = ; > }; > +#else > + u-boot-img {}; > +#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 { > + filename = "u-boot.itb"; > + offset = ; > + }; > +#else > + u-boot-img {}; > #endif > + }; > +}; > +#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. > > config LNX_KRNL_IMG_TEXT_OFFSET_BASE > default SYS_TEXT_BASE