[PATCH] arm64: zynqmp: Enable capsule update

Enable EFI capsule update features to be enabled by default also with all dfu valid options for ZynqMP.
This feature was tested on Xilinx ZynqMP zcu104 board with defining dfu_alt_info="mmc 0:1=boot.bin fat 0 1;u-boot.itb fat 0 1" and dfu_alt_info="sf 0:0=boot.bin raw 0 0x50000;u-boot.itb raw 0x80000 0x500000".
There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by: Michal Simek michal.simek@xilinx.com CC: Sughosh Ganu sughosh.ganu@linaro.org CC: Ilias Apalodimas ilias.apalodimas@linaro.org CC: Heinrich Schuchardt xypron.glpk@gmx.de ---
I actually didn't try to boot out of qspi because qspi writing is likely broken and should be fixed. But I have checked that images are written to that previously erased locations.
U-Boot SPL 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks ##Hit any key to stop autoboot: 0 ZynqMP> reset resetting ...
U-Boot SPL 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks Hit any key to stop autoboot: 0 ZynqMP>
--- configs/xilinx_zynqmp_virt_defconfig | 9 +++++++++ include/configs/xilinx_zynqmp.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 89c1dae2a1d9..9c496098584f 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -86,7 +86,11 @@ CONFIG_SATA_CEVA=y CONFIG_CLK_ZYNQMP=y CONFIG_DFU_TFTP=y CONFIG_DFU_TIMEOUT=y +CONFIG_DFU_MMC=y +CONFIG_DFU_NAND=y CONFIG_DFU_RAM=y +CONFIG_DFU_SF=y +CONFIG_DFU_MTD=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 @@ -178,3 +182,8 @@ CONFIG_TPM=y CONFIG_SPL_GZIP=y # CONFIG_SPL_HEXDUMP is not set CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y +CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 36f3d962e417..986af2be7819 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -27,7 +27,7 @@ #endif
/* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x4000000)
/* Serial setup */ #define CONFIG_CPU_ARMV8

po 26. 4. 2021 v 13:08 odesÃlatel Michal Simek michal.simek@xilinx.com napsal:
Enable EFI capsule update features to be enabled by default also with all dfu valid options for ZynqMP.
This feature was tested on Xilinx ZynqMP zcu104 board with defining dfu_alt_info="mmc 0:1=boot.bin fat 0 1;u-boot.itb fat 0 1" and dfu_alt_info="sf 0:0=boot.bin raw 0 0x50000;u-boot.itb raw 0x80000 0x500000".
There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by: Michal Simek michal.simek@xilinx.com CC: Sughosh Ganu sughosh.ganu@linaro.org CC: Ilias Apalodimas ilias.apalodimas@linaro.org CC: Heinrich Schuchardt xypron.glpk@gmx.de
I actually didn't try to boot out of qspi because qspi writing is likely broken and should be fixed. But I have checked that images are written to that previously erased locations.
U-Boot SPL 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks ##Hit any key to stop autoboot: 0 ZynqMP> reset resetting ...
U-Boot SPL 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks Hit any key to stop autoboot: 0 ZynqMP>
configs/xilinx_zynqmp_virt_defconfig | 9 +++++++++ include/configs/xilinx_zynqmp.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 89c1dae2a1d9..9c496098584f 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -86,7 +86,11 @@ CONFIG_SATA_CEVA=y CONFIG_CLK_ZYNQMP=y CONFIG_DFU_TFTP=y CONFIG_DFU_TIMEOUT=y +CONFIG_DFU_MMC=y +CONFIG_DFU_NAND=y CONFIG_DFU_RAM=y +CONFIG_DFU_SF=y +CONFIG_DFU_MTD=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 @@ -178,3 +182,8 @@ CONFIG_TPM=y CONFIG_SPL_GZIP=y # CONFIG_SPL_HEXDUMP is not set CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y +CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 36f3d962e417..986af2be7819 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -27,7 +27,7 @@ #endif
/* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x4000000)
/* Serial setup */
#define CONFIG_CPU_ARMV8
2.31.1
Applied. M

On 26.04.21 13:08, Michal Simek wrote:
Enable EFI capsule update features to be enabled by default also with all dfu valid options for ZynqMP.
This feature was tested on Xilinx ZynqMP zcu104 board with defining dfu_alt_info="mmc 0:1=boot.bin fat 0 1;u-boot.itb fat 0 1" and dfu_alt_info="sf 0:0=boot.bin raw 0 0x50000;u-boot.itb raw 0x80000 0x500000".
There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by: Michal Simek michal.simek@xilinx.com CC: Sughosh Ganu sughosh.ganu@linaro.org CC: Ilias Apalodimas ilias.apalodimas@linaro.org CC: Heinrich Schuchardt xypron.glpk@gmx.de
I actually didn't try to boot out of qspi because qspi writing is likely broken and should be fixed. But I have checked that images are written to that previously erased locations.
There is a DFU driver for writing to RAM. You should be able to write to memory using capsule update and then do a CRC32 on the memory region for testing the correct result.
Best regards
Heinrich
U-Boot SPL 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g76a8101e4548 (Apr 26 2021 - 13:01:46 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks ##Hit any key to stop autoboot: 0 ZynqMP> reset resetting ...
U-Boot SPL 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200) PMUFW: v1.1 Loading new PMUFW cfg obj (2024 bytes) Silicon version: 3 EL Level: EL3 Chip ID: zu7e Multiboot: 0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 spl_load_image_fat_os: error reading image u-boot.bin, err - -2 NOTICE: ATF running on XCZU7EG/EV/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: v2.2(release):xilinx-v2020.2.2-k26 NOTICE: BL31: Built : 11:51:16, Apr 21 2021
U-Boot 2021.04-00978-g01e9f0ec63e4 (Apr 26 2021 - 13:04:48 +0200)
Model: ZynqMP ZCU104 RevC Board: Xilinx ZynqMP DRAM: 2 GiB PMUFW: v1.1 EL Level: EL2 Chip ID: zu7e WDT: Started with servicing (60s timeout) NAND: 0 MiB MMC: mmc@ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serial Net: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id eth0: ethernet@ff0e0000 Scanning disk mmc@ff170000.blk... Found 4 disks Hit any key to stop autoboot: 0 ZynqMP>
configs/xilinx_zynqmp_virt_defconfig | 9 +++++++++ include/configs/xilinx_zynqmp.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 89c1dae2a1d9..9c496098584f 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -86,7 +86,11 @@ CONFIG_SATA_CEVA=y CONFIG_CLK_ZYNQMP=y CONFIG_DFU_TFTP=y CONFIG_DFU_TIMEOUT=y +CONFIG_DFU_MMC=y +CONFIG_DFU_NAND=y CONFIG_DFU_RAM=y +CONFIG_DFU_SF=y +CONFIG_DFU_MTD=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 @@ -178,3 +182,8 @@ CONFIG_TPM=y CONFIG_SPL_GZIP=y # CONFIG_SPL_HEXDUMP is not set CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y +CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 36f3d962e417..986af2be7819 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -27,7 +27,7 @@ #endif
/* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x4000000)
/* Serial setup */ #define CONFIG_CPU_ARMV8

On 4/29/21 10:52 AM, Heinrich Schuchardt wrote:
On 26.04.21 13:08, Michal Simek wrote:
Enable EFI capsule update features to be enabled by default also with all dfu valid options for ZynqMP.
This feature was tested on Xilinx ZynqMP zcu104 board with defining dfu_alt_info="mmc 0:1=boot.bin fat 0 1;u-boot.itb fat 0 1" and dfu_alt_info="sf 0:0=boot.bin raw 0 0x50000;u-boot.itb raw 0x80000 0x500000".
There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by: Michal Simek michal.simek@xilinx.com CC: Sughosh Ganu sughosh.ganu@linaro.org CC: Ilias Apalodimas ilias.apalodimas@linaro.org CC: Heinrich Schuchardt xypron.glpk@gmx.de
I actually didn't try to boot out of qspi because qspi writing is likely broken and should be fixed. But I have checked that images are written to that previously erased locations.
There is a DFU driver for writing to RAM. You should be able to write to memory using capsule update and then do a CRC32 on the memory region for testing the correct result.
That's a good point. As I said to Ilias and Sughosh I think it will be good to list all dfu_alt_info setting and these testing procedures to be able to test them quickly. The same is when runtime service is working how to use it with fwupd. Ilias also mentioned work in progress on A/B update which I would like to enable when it is ready.
Thanks, Michal
participants (3)
-
Heinrich Schuchardt
-
Michal Simek
-
Michal Simek