Skip to content

binman: Add support for generating more complex FITs

Heinrich Schuchardt u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 of 7 patches 0 repliesNew

1 of 7 patches is in this archive. The cover letter announces 7.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
4/7binman: Add support for ATF BL31+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] binman: Add support for generating more complex FITs
Quoted 168 lines · Simon Glass

Hi Heinrich,

Quoted 165 lines · Heinrich Schuchardt
Quoted 76 lines · Heinrich Schuchardt
Quoted 7 lines · Simon Glass

This series allows binman to generate FITs that include multiple DTB images and the configuration to use them.

It is then possible to remove the sunxi FIT generator script, so this series handles that also.

With this, sunxi is fully converted to use binman.

I have applied this patch series and it does not work on my pine64-lts_defconfig.

Environment variable BL31 points to my bl31.bin:

$ echo $BL31
../trusted-firmware-a/build/sun50i_a64/debug/bl31.bin

U-Boot SPL 2020.10-rc2-00147-g72293dc579 (Aug 25 2020 - 03:29:28 +0000)
DRAM: 2048 MiB
Trying to boot from MMC1
No matching DT out of these options:
Configuration to load ATF before U-Boot
No matching DT out of these options:
Configuration to load ATF before U-Boot
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Without your patches U-Boot works. But CONFIG_SYS_MALLOC_F_LEN=0x400 is
too small. This results in a warning "alloc space exhausted". Cf.
https://patchwork.ozlabs.org/project/uboot/patch/20200725181851.4339-1-xypron.glpk at gmx.de/

U-Boot SPL 2020.10-rc2-00140-g1aa3966173 (Aug 25 2020 - 03:46:36 +0000)
DRAM: 2048 MiB
Trying to boot from MMC1

NOTICE:  BL31: v2.2():v2.2-1138-g78460ced4
NOTICE:  BL31: Built : 05:50:47, Apr  7 2020
NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC (1689)
NOTICE:  BL31: Found U-Boot DTB at 0x4092cc8, model: Pine64 LTS
INFO:    ARM GICv2 driver initialized
INFO:    Configuring SPC Controller
INFO:    PMIC: Probing AXP803 on RSB
INFO:    PMIC: dcdc1 voltage: 3.300V
INFO:    PMIC: dcdc5 voltage: 1.200V
INFO:    PMIC: dcdc6 voltage: 1.100V
INFO:    PMIC: dldo1 voltage: 3.300V
INFO:    PMIC: dldo2 voltage: 3.300V
INFO:    PMIC: dldo4 voltage: 3.300V
INFO:    PMIC: fldo1 voltage: 1.200V
INFO:    PMIC: Enabling DC SW
INFO:    BL31: Platform setup done
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 843419 was applied
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
NOTICE:  PSCI: System suspend is unavailable
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x4a000000
INFO:    SPSR = 0x3c9

alloc space exhausted

U-Boot 2020.10-rc2-00140-g1aa3966173 (Aug 25 2020 - 03:46:36 +0000) Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: Pine64 LTS
DRAM:  2 GiB
MMC:   mmc at 1c0f000: 0, mmc at 1c11000: 1
Loading Environment from FAT... Card did not respond to voltage select!
In:    serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet at 1c30000
Hit any key to stop autoboot:  0
Quoted 3 lines

Best regards

Heinrich

This is u-boot.its created without your patches:

/dts-v1/;

/ {
        description = "Configuration to load ATF before U-Boot";
        #address-cells = <1>;

        images {
                uboot {
                        description = "U-Boot (64-bit)";
                        data = /incbin/("u-boot-nodtb.bin");
                        type = "standalone";
                        arch = "arm64";
                        compression = "none";
                        load = <0x4a000000>;
                };
                atf {
                        description = "ARM Trusted Firmware";
                        data =
/incbin/("../trusted-firmware-a/build/sun50i_a64/debug/bl31.bin");
                        type = "firmware";
                        arch = "arm64";
                        compression = "none";
                        load = <0x44000>;
                        entry = <0x44000>;
                };
                fdt_1 {
                        description = "sun50i-a64-pine64-lts";
                        data =
/incbin/("arch/arm/dts/sun50i-a64-pine64-lts.dtb");
                        type = "flat_dt";
                        compression = "none";
                };
        };
        configurations {
                default = "config_1";

                config_1 {
                        description = "sun50i-a64-pine64-lts";
                        firmware = "uboot";
                        loadables = "atf";
                        fdt = "fdt_1";
                };
        };
};

This is the itb that is created with your patches:

/dts-v1/;

/ {
        description = "Configuration to load ATF before U-Boot";
        #address-cells = < 0x01 >;

        images {

                uboot {
                        data = < 0x1f000 ...
                        description = "U-Boot (64-bit)";
                        type = "standalone";
                        arch = "arm64";
                        compression = "none";
                        load = < 0x4a000000 >;
                };

                atf {
                        data = [ f4 ...
                        description = "ARM Trusted Firmware";
                        type = "firmware";
                        arch = "arm64";
                        compression = "none";
                        load = < 0x44000 >;
                        entry = < 0x44000 >;
                };
        };

        configurations {
                default = "config-1";
        };
};
Quoted 3 lines
Quoted 1 line

The device tree is missing and the default configuration is empty.

There was a thread on this, I thought.

Do you have a link?

Quoted 1 line

Can you check u-boot-dm/binman-working ?

Bad luck. The problem is reproducible with your branch

commit c6723231a80ad6c2a842778fea7d4857ba81d7c3 (HEAD -> binman-working, dm/binman-working)

Author: Simon Glass <[email protected]>
Date:   Fri Aug 21 20:25:56 2020 -0600

sunxi: Drop the FIT-generator script

U-Boot SPL 2020.10-rc2-00107-gc6723231a8 (Aug 25 2020 - 17:29:26 +0000)
DRAM: 2048 MiB
Trying to boot from MMC1
No matching DT out of these options:
Configuration to load ATF before U-Boot
No matching DT out of these options:
Configuration to load ATF before U-Boot
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Best regards

Heinrich

Quoted 6 lines

I can send v2 I suppose.

Regards,
Simon