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 X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81944C4338F for ; Tue, 24 Aug 2021 16:14:13 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 893C361357 for ; Tue, 24 Aug 2021 16:14:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 893C361357 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CAF2882DB2; Tue, 24 Aug 2021 18:14:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JB71Dvbr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2288881BC0; Tue, 24 Aug 2021 18:14:07 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 59A2B82DB6 for ; Tue, 24 Aug 2021 18:13:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wr1-x42c.google.com with SMTP id u16so32138971wrn.5 for ; Tue, 24 Aug 2021 09:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1vc92h1CwBCiK+TqlgB/BE0wM18KDjt7rFctK6BHeYo=; b=JB71Dvbr/3KNcwhftUwRZjVZkyw4YMH9ZjFmFWPtqPRS7RO+gxSnW70BD+93Kg5SNj 1drDoYbAjKxC+xozwZWwbNRnA1SZpvT7sJPo3JnBHGgWBRwFfkRxoyufCh1oqAE2v8bP ZDvk0mv9waroRC8aMD8bDI/b8LVIsgymk5V3M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1vc92h1CwBCiK+TqlgB/BE0wM18KDjt7rFctK6BHeYo=; b=KmTGB1oRoR/2BXyIiyTwOuZyL7dxfD4mWIYM7ZpFNiJA2d5RDgphRCmTNOfcCKKoJ+ pvFxZncmgYHks0UPaKg8LTEWo0Ufp7HrBis22y+YIGQgqvkCjWbjW2OpiOR6cyWDsosn WoKYf5yDEUXEhG15GCyw8pp4mxzuWHAyIvl+d49dMv0GqZGQkElHGrqt32XQwz1G1HAi tKvN2PDZTiMRtxu3E5lUY8O5av/0/+qdOQFxQ5nE174zA5/iNlsjfwJ/dL10uqN3eSOY /C5+5HaJx3QzXJasItbZzLBFLLn6qW6IQXjla8cIefsO3Ygg5z5bvaGj9prlFOsTooQJ 6DBg== X-Gm-Message-State: AOAM531gF2BfmSpT+i98sjuWjkZK2hYPYnk+ugATJi9a1BGBf3/AlEnh +Vup6ZrN60lCiO9aLjwOeAFbBRJ0QwEcT8TsdlkEuA== X-Google-Smtp-Source: ABdhPJwMzHA718hqbZCEVbfLJiqKOQTftI0J5OcRDtvO30AoU4jR5YuQjqVhsix5L2NfIEth9oS9ytzyzdvYjDn66ts= X-Received: by 2002:a5d:68d2:: with SMTP id p18mr10355591wrw.43.1629821634200; Tue, 24 Aug 2021 09:13:54 -0700 (PDT) MIME-Version: 1.0 References: <20210823150357.247295-1-marcel@ziswiler.com> <20210823150357.247295-5-marcel@ziswiler.com> In-Reply-To: <20210823150357.247295-5-marcel@ziswiler.com> From: Simon Glass Date: Tue, 24 Aug 2021 10:13:42 -0600 Message-ID: Subject: Re: [PATCH v2 4/9] verdin-imx8mm: switch to use binman to pack images To: Marcel Ziswiler Cc: U-Boot Mailing List , Stefano Babic , Heiko Thiery , Fabio Estevam , Frieder Schrempf , Marcel Ziswiler , Heiko Schocher , Igor Opaniuk , Ilko Iliev , Jagan Teki , Marek Vasut , Max Krummenacher , "NXP i.MX U-Boot Team" , Peng Fan , Teresa Remmet Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Marcel, On Mon, 23 Aug 2021 at 09:09, Marcel Ziswiler wrote: > > From: Marcel Ziswiler > > Use binman to pack images. > > Signed-off-by: Marcel Ziswiler > > --- > > Changes in v2: > - Explicitly pass filename to binman when generating binaries as > suggested by Heiko. > - Use proper intermediate binary u-boot-spl-ddr.bin for imximage as > pointed out by Heiko. > > arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 124 ++++++++++++++++++++++- > arch/arm/mach-imx/imx8m/Kconfig | 1 + > board/toradex/verdin-imx8mm/imximage.cfg | 11 +- > configs/verdin-imx8mm_defconfig | 2 +- > doc/board/toradex/verdin-imx8mm.rst | 53 +++++----- > 5 files changed, 157 insertions(+), 34 deletions(-) > > diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi > index a97626fa0c1..a3ad8f3ad37 100644 > --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi > +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi > @@ -1,11 +1,15 @@ > // SPDX-License-Identifier: GPL-2.0+ OR MIT > /* > - * Copyright 2020 Toradex > + * Copyright 2021 Toradex > */ > > #include "imx8mm-u-boot.dtsi" > > / { > + binman: binman { > + multiple-images; > + }; > + > firmware { > optee { > compatible = "linaro,optee-tz"; > @@ -91,3 +95,121 @@ > &wdog1 { > u-boot,dm-spl; > }; > + > +&binman { > + u-boot-spl-ddr { > + align = <4>; > + align-size = <4>; > + filename = "u-boot-spl-ddr.bin"; > + pad-byte = <0xff>; > + > + u-boot-spl { > + align-end = <4>; > + }; > + > + blob_1: blob-ext@1 { This works but the naming is a little odd. You can do: 1d-imem { type = "blob-ext"; > + filename = "lpddr4_pmu_train_1d_imem.bin"; > + size = <0x8000>; > + }; > + > + blob_2: blob-ext@2 { > + filename = "lpddr4_pmu_train_1d_dmem.bin"; > + size = <0x4000>; > + }; > + > + blob_3: blob-ext@3 { > + filename = "lpddr4_pmu_train_2d_imem.bin"; > + size = <0x8000>; > + }; > + > + blob_4: blob-ext@4 { > + filename = "lpddr4_pmu_train_2d_dmem.bin"; > + size = <0x4000>; > + }; > + }; > + > + spl { > + filename = "spl.bin"; > + > + mkimage { > + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; > + > + blob { > + filename = "u-boot-spl-ddr.bin"; > + }; > + }; > + }; > + > + itb { > + filename = "u-boot.itb"; > + > + fit { > + description = "Configuration to load ATF before U-Boot"; > + fit,external-offset = ; > + #address-cells = <1>; > + > + images { > + uboot { > + arch = "arm64"; > + compression = "none"; > + description = "U-Boot (64-bit)"; > + load = ; > + type = "standalone"; > + > + uboot_blob: blob-ext { > + filename = "u-boot-nodtb.bin"; > + }; > + }; > + > + atf { > + arch = "arm64"; > + compression = "none"; > + description = "ARM Trusted Firmware"; > + entry = <0x920000>; > + load = <0x920000>; > + type = "firmware"; > + > + atf_blob: blob-ext { > + filename = "bl31.bin"; > + }; > + }; > + > + fdt { > + compression = "none"; > + description = "NAME"; > + type = "flat_dt"; > + > + uboot_fdt_blob: blob-ext { > + filename = "u-boot.dtb"; > + }; > + }; > + }; > + > + configurations { > + default = "conf"; > + > + conf { > + description = "NAME"; > + fdt = "fdt"; > + firmware = "uboot"; > + loadables = "atf"; > + }; > + }; > + }; > + }; > + > + imx-boot { > + filename = "flash.bin"; > + pad-byte = <0x00>; > + > + spl: blob-ext@1 { > + filename = "spl.bin"; > + offset = <0x0>; > + }; > + > + uboot: blob-ext@2 { > + filename = "u-boot.itb"; > + offset = <0x5fc00>; > + }; > + }; > +}; > diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig > index a2ba30cf332..3eccc6b4d4f 100644 > --- a/arch/arm/mach-imx/imx8m/Kconfig > +++ b/arch/arm/mach-imx/imx8m/Kconfig > @@ -106,6 +106,7 @@ config TARGET_PICO_IMX8MQ > > config TARGET_VERDIN_IMX8MM > bool "Support Toradex Verdin iMX8M Mini module" > + select BINMAN > select IMX8MM > select SUPPORT_SPL > select IMX8M_LPDDR4 > diff --git a/board/toradex/verdin-imx8mm/imximage.cfg b/board/toradex/verdin-imx8mm/imximage.cfg > index b8b25ff4201..a303f98e170 100644 > --- a/board/toradex/verdin-imx8mm/imximage.cfg > +++ b/board/toradex/verdin-imx8mm/imximage.cfg > @@ -1,16 +1,9 @@ > /* SPDX-License-Identifier: GPL-2.0+ */ > /* > - * Copyright 2020 Toradex > + * Copyright 2021 Toradex > */ > > #define __ASSEMBLY__ > > -FIT > BOOT_FROM emmc_fastboot > -LOADER spl/u-boot-spl-ddr.bin 0x7E1000 > -SECOND_LOADER u-boot.itb 0x40200000 0x60000 > - > -DDR_FW lpddr4_pmu_train_1d_imem.bin > -DDR_FW lpddr4_pmu_train_1d_dmem.bin > -DDR_FW lpddr4_pmu_train_2d_imem.bin > -DDR_FW lpddr4_pmu_train_2d_dmem.bin > +LOADER u-boot-spl-ddr.bin 0x7E1000 > diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig > index 624f1b99096..b323ceb19af 100644 > --- a/configs/verdin-imx8mm_defconfig > +++ b/configs/verdin-imx8mm_defconfig > @@ -24,7 +24,7 @@ CONFIG_DISTRO_DEFAULTS=y > CONFIG_FIT=y > CONFIG_FIT_EXTERNAL_OFFSET=0x3000 > CONFIG_SPL_LOAD_FIT=y > -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" > +# CONFIG_USE_SPL_FIT_GENERATOR is not set > CONFIG_OF_SYSTEM_SETUP=y > CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/verdin-imx8mm/imximage.cfg" > # CONFIG_USE_BOOTCOMMAND is not set > diff --git a/doc/board/toradex/verdin-imx8mm.rst b/doc/board/toradex/verdin-imx8mm.rst > index b9f7dc39c96..a11c82da2f5 100644 > --- a/doc/board/toradex/verdin-imx8mm.rst > +++ b/doc/board/toradex/verdin-imx8mm.rst > @@ -34,10 +34,10 @@ Get the DDR Firmware > .. code-block:: bash > > $ cd .. > - $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.4.1.bin > - $ chmod +x firmware-imx-8.4.1.bin > - $ ./firmware-imx-8.4.1.bin > - $ cp firmware-imx-8.4.1/firmware/ddr/synopsys/lpddr4*.bin ./ > + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.10.1.bin > + $ chmod +x firmware-imx-8.10.1.bin > + $ ./firmware-imx-8.10.1.bin > + $ cp firmware-imx-8.10.1/firmware/ddr/synopsys/lpddr4*.bin ./ This makes me wonder if we should add a way for binman to locate blobs? > > Build U-Boot > ------------ > @@ -46,7 +46,7 @@ Build U-Boot > $ export CROSS_COMPILE=aarch64-linux-gnu- > $ export ATF_LOAD_ADDR=0x920000 > $ make verdin-imx8mm_defconfig > - $ make flash.bin > + $ make > > Flash to eMMC > ------------- > @@ -78,21 +78,28 @@ Output: > > .. code-block:: bash > > - U-Boot SPL 2020.01-00187-gd411d164e5 (Jan 26 2020 - 04:47:26 +0100) > - Normal Boot > - Trying to boot from MMC1 > - > - U-Boot 2020.01-00187-gd411d164e5 (Jan 26 2020 - 04:47:26 +0100) > - > - CPU: Freescale i.MX8MMQ rev1.0 at 0 MHz > - Reset cause: POR > - DRAM: 2 GiB > - MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2 > - Loading Environment from MMC... OK > - In: serial > - Out: serial > - Err: serial > - Model: Toradex Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT V1.0A, Serial: > - Net: eth0: ethernet@30be0000 > - Hit any key to stop autoboot: 0 > - Verdin iMX8MM # > +U-Boot SPL 2021.10-rc2-00028-gee010ba1129 (Aug 23 2021 - 16:56:02 +0200) > +Normal Boot > +WDT: Started with servicing (60s timeout) > +Trying to boot from MMC1 > +NOTICE: BL31: v2.2(release):rel_imx_5.4.70_2.3.2_rc1-5-g835a8f67b > +NOTICE: BL31: Built : 18:02:12, Aug 16 2021 > + > + > +U-Boot 2021.10-rc2-00028-gee010ba1129 (Aug 23 2021 - 16:56:02 +0200) > + > +CPU: Freescale i.MX8MMQ rev1.0 at 1200 MHz > +Reset cause: POR > +DRAM: 2 GiB > +WDT: Started with servicing (60s timeout) > +MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2 > +Loading Environment from MMC... OK > +In: serial > +Out: serial > +Err: serial > +Model: Toradex Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT V1.1A, Serial# 06760554 > +Carrier: Toradex Verdin Development Board V1.1A, Serial# 10754333 > +Setting variant to wifi > +Net: eth0: ethernet@30be0000 > +Hit any key to stop autoboot: 0 > +Verdin iMX8MM # > -- > 2.26.2 > Regards, Simon