[PATCH v1 5/7] verdin-imx8mm: switch to use binman to pack images

Heiko Thiery heiko.thiery at gmail.com
Mon Aug 23 08:37:11 CEST 2021


Hi Marcel,

Am Fr., 20. Aug. 2021 um 22:52 Uhr schrieb Marcel Ziswiler
<marcel at ziswiler.com>:
>
> From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
>
> Use binman to pack images.
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> ---
>
>  arch/arm/dts/imx8mm-verdin-u-boot.dtsi   | 122 ++++++++++++++++++++++-
>  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      |  54 +++++-----
>  5 files changed, 155 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi
> index a97626fa0c1..ba4c8d0436c 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,119 @@
>  &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 at 1 {
> +                       filename = "lpddr4_pmu_train_1d_imem.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_2: blob-ext at 2 {
> +                       filename = "lpddr4_pmu_train_1d_dmem.bin";
> +                       size = <0x4000>;
> +               };
> +
> +               blob_3: blob-ext at 3 {
> +                       filename = "lpddr4_pmu_train_2d_imem.bin";
> +                       size = <0x8000>;
> +               };
> +
> +               blob_4: blob-ext at 4 {
> +                       filename = "lpddr4_pmu_train_2d_dmem.bin";
> +                       size = <0x4000>;
> +               };
> +       };
> +
> +       spl {

Maybe you can add a "filename = spl.bin" property here. So it is more
clear that this is the output file. This should be the one you refer
to in your "board/toradex/verdin-imx8mm/imximage.cfg".

> +               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 = <CONFIG_FIT_EXTERNAL_OFFSET>;
> +                       #address-cells = <1>;
> +
> +                       images {
> +                               uboot {
> +                                       arch = "arm64";
> +                                       compression = "none";
> +                                       description = "U-Boot (64-bit)";
> +                                       load = <CONFIG_SYS_TEXT_BASE>;
> +                                       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 at 1 {
> +                       filename = "spl.bin";
> +                       offset = <0x0>;
> +               };
> +
> +               uboot: blob-ext at 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..9bd60e39fb5 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         mkimage.spl.mkimage     0x7E1000

I think you should use "spl.bin" here and not the
"mkimage.spl.mkimage". As far as I understand the mkimage files are
only binman temporary files.

-- 
Heiko


More information about the U-Boot mailing list