[RFC] imx: imx8qm-rom7720: switch to binman

Oliver Graute oliver.graute at gmail.com
Wed Jan 26 09:18:13 CET 2022


On 12/01/22, Oliver Graute wrote:
> Switch to use binman to pack images
> 
> Signed-off-by: Oliver Graute <oliver.graute at kococonnector.com>
> ---
> 
> A flash.bin is now generated by binman but its now bigger then with
> mkimage_fit_atf.sh 800K vs. 1.1M and is currently NOT booting.
> So something is still messed up.
> 
>  arch/arm/dts/imx8qm-rom7720-a1.dts            |   1 +
>  arch/arm/dts/imx8qm-u-boot.dtsi               | 136 ++++++++++++++++++
>  arch/arm/mach-imx/imx8/Kconfig                |   1 +
>  .../advantech/imx8qm_rom7720_a1/imximage.cfg  |  16 +--
>  configs/imx8qm_rom7720_a1_4G_defconfig        |   2 +-
>  doc/board/advantech/imx8qm-rom7720-a1.rst     |   3 +-
>  6 files changed, 142 insertions(+), 17 deletions(-)
>  create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsi
> 
> diff --git a/arch/arm/dts/imx8qm-rom7720-a1.dts b/arch/arm/dts/imx8qm-rom7720-a1.dts
> index d1f2fff869..332d441c6d 100644
> --- a/arch/arm/dts/imx8qm-rom7720-a1.dts
> +++ b/arch/arm/dts/imx8qm-rom7720-a1.dts
> @@ -10,6 +10,7 @@
>  /memreserve/ 0x80000000 0x00020000;
>  
>  #include "fsl-imx8qm.dtsi"
> +#include "imx8qm-u-boot.dtsi"
>  
>  / {
>  	model = "Advantech iMX8QM Qseven series";
> diff --git a/arch/arm/dts/imx8qm-u-boot.dtsi b/arch/arm/dts/imx8qm-u-boot.dtsi
> new file mode 100644
> index 0000000000..98379516cc
> --- /dev/null
> +++ b/arch/arm/dts/imx8qm-u-boot.dtsi
> @@ -0,0 +1,136 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2021 NXP
> + */
> +
> +/ {
> +	binman: binman {
> +		multiple-images;
> +	};
> +};
> +
> +&binman {
> +	u-boot {
> +		align-size = <4>;
> +		align = <4>;
> +		filename = "u-boot.bin";
> +		pad-byte = <0xff>;
> +
> +		u-boot-spl {
> +			align-end = <4>;
> +		};
> +	};
> +
> +	spl {
> +		filename = "spl.bin";
> +		mkimage {
> +			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x100000";

this refers to the wrong container format for imx8qm!
So replacing s/imx8mimage/imx8image/ does help to get a working image.

>  
>  #define __ASSEMBLY__
>  
> -/* Boot from SD, sector size 0x400 */
> -BOOT_FROM SD 0x400
> -/* SoC type IMX8QM */
> -SOC_TYPE IMX8QM
> -/* Append seco container image */
> -APPEND mx8qm-ahab-container.img
> -/* Create the 2nd container */
> -CONTAINER
> -/* Add scfw image with exec attribute */
> -IMAGE SCU mx8qm-val-scfw-tcm.bin
> -/* Add ATF image with exec attribute */
> -IMAGE A35 bl31.bin 0x80000000
> -/* Add U-Boot image with load attribute */
> -DATA A35 u-boot-dtb.bin 0x80020000

I need to keep this here to.  

> +BOOT_FROM	sd
> +LOADER		u-boot-dtb.bin	0x10000

with this changes the resulting flash.bin is as big as before and its
booting flawlessly.

I 'll ppst later a patch v1 for this.

Best regards,

Oliver


More information about the U-Boot mailing list