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 18C76C433EF for ; Sat, 23 Jul 2022 12:07:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D60683FA2; Sat, 23 Jul 2022 14:07:38 +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="ooxiBmYF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61EC783FA6; Sat, 23 Jul 2022 14:07:37 +0200 (CEST) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 20B8E83F85 for ; Sat, 23 Jul 2022 14:07:34 +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-ed1-x530.google.com with SMTP id r6so8552378edd.7 for ; Sat, 23 Jul 2022 05:07:34 -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=7MAzeU68QyY2fU4aXtE7a1XYIQBm78nYw+Gr1ybLLz0=; b=ooxiBmYFdcdSycltLt2OquIQZPY9xwowTOOwZYL+nTJmx0p0KXzTjriRaMPHSE6aXF B08Dkb7PlvPZ4HvaKbX5STc+zqqK+wQtCqbtx0UUTxEHCn5iux347YtASJuIIxcbazdF 9JHHXZ+sfz9DVhTZyZF14TjdxlhbAS4Ge+NPcFZfy8irKzWzsc5ATIorUitPzxDSVvjH 5sDJLp9tQzHahlVgrVGMTNd4NU/9eLCyR+Gy8pFDalKjuy+lGX0uYcacbqgWSdPN6hr4 AbgxL9VQhchKMmw+HPeECGpzT35+gAg+vLrxHcZFR2+dPmf8sM3hj3+Ol4IpFU9Jw4+G XNBQ== 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=7MAzeU68QyY2fU4aXtE7a1XYIQBm78nYw+Gr1ybLLz0=; b=Zk3e+aTe3Pa4W2JGvPxdkyoGwSkurTebUvbSPiAq3qQOw9cHGb56Mm0XsMYE+qLRF7 x0zGkOlhkCeNmgJ0SEofwGMrZdgg0WrDjMJuFk9dymuSltuzeU5+TKgvQGkqTjwSLOYW gbaj3LDxhlODYrOeRohosHmai9vIeqrDGvCvIGvp98RqMYWgCqUrne8WsnhO40mIfX1/ i12N3OC5bUrK1dhvh9J0zqtjq0gxEdKmdUJVhG44/TXxL50gi3wKWz0qrK1icVf8s4LG O8tQDlReitxS9+6CuhP3jRgZNdHOaIC4fampWYWKWge5xYdo2agJbLYYqKW4VxtAvqx2 NCdg== X-Gm-Message-State: AJIora+U4h0ZJ23NYFd7gibRFF4Hb632Tely7s1Lyk+4PpmrQL7rFyJL G2pLEf70vXkBpfolnQ57alQ= X-Google-Smtp-Source: AGRyM1tnwt+Yl+tzyemhFaw89PXqrP+9AD49dGyy+EOf6BfaT4E4ANfvw7SAZ5actV+kUjtmNgsYFA== X-Received: by 2002:a05:6402:5202:b0:43a:a238:61c with SMTP id s2-20020a056402520200b0043aa238061cmr4190455edd.186.1658578053258; Sat, 23 Jul 2022 05:07:33 -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 l10-20020a1709060cca00b00722e5b234basm3056343ejh.179.2022.07.23.05.07.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Jul 2022 05:07:32 -0700 (PDT) Message-ID: <794bbfad-6579-ce3a-5faa-c8f758221196@gmail.com> Date: Sat, 23 Jul 2022 14:07:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 From: Johan Jonker Subject: Re: [PATCH v2 1/7] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM To: Quentin Schulz Cc: bharat.gooty@broadcom.com, rayagonda.kokatanur@broadcom.com, sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com, jagan@amarulasolutions.com, alpernebiyasak@gmail.com, andy.yan@rock-chips.com, hl@rock-chips.com, chenjh@rock-chips.com, manivannan.sadhasivam@linaro.org, nick@khadas.com, klaus.goger@theobroma-systems.com, jernej.skrabec@gmail.com, deepakdas.linux@gmail.com, linux@alxd.me, mail@david-bauer.net, peterwillcn@gmail.com, heiko@sntech.de, w.egorov@phytec.de, pbrobinson@gmail.com, sunil@amarulasolutions.com, ldevulder@suse.com, akash@openedev.com, banglang.huang@foxmail.com, matwey.kornilov@gmail.com, michael@amarulasolutions.com, xypron.glpk@gmx.de, u-boot@lists.denx.de, Quentin Schulz References: <20220722113505.3875669-1-foss+uboot@0leil.net> <20220722113505.3875669-2-foss+uboot@0leil.net> Content-Language: en-US In-Reply-To: <20220722113505.3875669-2-foss+uboot@0leil.net> 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Quentin and others, Some comments. Have a look if it's useful. It works, but is in need for some improvement... Johan On 7/22/22 13:34, Quentin Schulz wrote: > From: Quentin Schulz > > idbloader.img content - currently created by way of Makefile - can be > created by binman directly. > > So let's do that for Rockchip ARM platforms. > > Cc: Quentin Schulz > Signed-off-by: Quentin Schulz > --- > Makefile | 2 +- > arch/arm/dts/rockchip-u-boot.dtsi | 15 +++++++++++++-- > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/Makefile b/Makefile > index d76ec69b52..f780bfe211 100644 > --- a/Makefile > +++ b/Makefile > @@ -1005,7 +1005,7 @@ endif > else > ifeq ($(CONFIG_SPL),y) > # Generate these inputs for binman which will create the output files > -INPUTS-y += idbloader.img u-boot.img > +INPUTS-y += u-boot.img > endif > endif > endif > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi > index eae3ee715d..0362c97e0b 100644 > --- a/arch/arm/dts/rockchip-u-boot.dtsi > +++ b/arch/arm/dts/rockchip-u-boot.dtsi > @@ -17,9 +17,20 @@ > filename = "u-boot-rockchip.bin"; > pad-byte = <0xff>; > > - blob { > - filename = "idbloader.img"; "u-boot-rockchip.bin" is a combination image of mkimage(TPL/SPL) + "u-boot.img". Not everyone suites this fixed GPT format. People may still want to write them separate while testing or whatever, so "idbloader.img" and "u-boot.img" must be kept available after this change! === rockchip.rst and README.rockchip and elsewhere on the internet still refer to "idbloader.img" so it should come back, but then made by binman. idbloader { filename = "idbloader.img"; mkimage { args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; #ifdef CONFIG_TPL multiple-data-files; u-boot-tpl { }; #endif u-boot-spl { }; }; }; === After this patch serie "idbloader.img" is not removed. make clean After: CLEAN include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map Before: CLEAN include/generated/env.in u-boot-nodtb.bin u-boot.lds u-boot.cfg.configs u-boot.bin u-boot-dtb.bin u-boot.img u-boot-dtb.img u-boot.sym u-boot.map u-boot.srec u-boot.cfg u-boot.dtb.out u-boot-tpl.dtb.out u-boot u-boot-spl.dtb.out u-boot.dtb u-boot-rockchip.bin System.map idbloader.img === Your serie generates zombie files. PLease remove after use. Same for others like: simple-bin.map mkimage-out.rom.mkimage mkimage.rom.mkimage rom.map tools/boot/bootm.c tools/boot/fdt_region.c tools/boot/image-cipher.c tools/boot/image-fit-sig.c tools/boot/image-fit.c tools/boot/image-host.c tools/boot/image.c u_boot_logo.S Untracked files: (use "git add ..." to include in what will be committed) mkimage-out.simple-bin.mkimage mkimage.simple-bin.mkimage === === > + mkimage { > + args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; > +#ifndef CONFIG_TPL > + u-boot-spl { > + }; > }; > +#else > + u-boot-tpl { > + }; > + }; > + u-boot-spl is the input for mkimage and should be a subnode. > + u-boot-spl { > + }; > +#endif Fix your dts format: simple-bin { filename = "u-boot-rockchip.bin"; pad-byte = <0xff>; mkimage { args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; #ifdef CONFIG_TPL multiple-data-files; u-boot-tpl { }; #endif u-boot-spl { }; }; #ifdef CONFIG_ARM64 blob { filename = "u-boot.itb"; #else u-boot-img { #endif offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; }; }; === CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is only related to MMC! There are other boot mediums like NAND or USB, so don't assume that CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is defined. See my patch serie that still is in need for review: https://lore.kernel.org/u-boot/20220508150825.21711-7-jbx6244@gmail.com/ Without it generates a warning: Error: arch/arm/dts/rockchip-u-boot.dtsi:54.16-17 syntax error FATAL ERROR: Unable to parse input tree Add more compile conditions! === RK3066: For NAND the "idbloader.img" might be useful for my serie (in need for review) when it gets TPL/SPL and rc4 right: [PATCH v2 00/11] Add Rockchip IDB device https://lore.kernel.org/u-boot/a1458a7b-2043-6397-3107-2d1fdf08c8e1@gmail.com/ In mk808_defconfig change: CONFIG_TPL_TEXT_BASE=0x10080C04 to: CONFIG_TPL_TEXT_BASE=0x10080C00 In rockchip.rst change: printf "RK30" > tplspl.bin dd if=u-boot-tpl.bin >> tplspl.bin to: printf "RK30" > tplspl.bin dd if=u-boot-tpl.bin ibs=1 skip=4 >> tplspl.bin The NAND can be programmed simular to MMC with: rkdeveloptool wlx loader1 idbloader.img TODO: rk30 usbplug (open source) === > > u-boot-img { > offset = ;