arm64: zynqmp: Enable capsule update
PATCH 1/1 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.
---
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 at 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 at ff0e0000
Scanning disk mmc at 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 at 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 at ff0e0000
Scanning disk mmc at 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(-)
configs/xilinx_zynqmp_virt_defconfig +9 -0
@@ -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
include/configs/xilinx_zynqmp.h +1 -1
@@ -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
Signature · 1 line
2.31.1
Michal Simek
AppliedPATCH 1/1 arm64: zynqmp: Enable capsule update
po 26. 4. 2021 v 13:08 odes?latel Michal Simek <[email protected]> napsal:
Quoted 143 lines
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 raw0x800000x500000".There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by Michal Simek <[email protected]>CC Sughosh Ganu <[email protected]>CC Ilias Apalodimas <[email protected]>CC Heinrich Schuchardt <[email protected]>---
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 2021U-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 at ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serialNet:
ZYNQ GEM:ff0e0000, mdio busff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet atff0e0000
Scanning disk mmc at 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 2021U-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 at ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serialNet:
ZYNQ GEM:ff0e0000, mdio busff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet atff0e0000
Scanning disk mmc at 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(-)configs/xilinx_zynqmp_virt_defconfig +9
-0@@ -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=yinclude/configs/xilinx_zynqmp.h +1
-2@@ -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 --
Quoted 2 lines
2.31.1
Applied.
M
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
PATCH 1/1 arm64: zynqmp: Enable capsule update
In reply to Michal SimekQuoted 15 lines · Michal Simek
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 raw0x800000x500000".There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by Michal Simek <[email protected]>CC Sughosh Ganu <[email protected]>CC Ilias Apalodimas <[email protected]>CC Heinrich Schuchardt <[email protected]>
Quoted 5 lines
---
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
Quoted 122 lines
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 MMC1spl_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 2021U-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 at ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serialNet:
ZYNQ GEM:ff0e0000, mdio busff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet atff0e0000
Scanning disk mmc at 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 MMC1spl_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 2021U-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 at ff170000: 0 Loading Environment from FAT... OK In: serial Out: serial Err: serialNet:
ZYNQ GEM:ff0e0000, mdio busff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet atff0e0000
Scanning disk mmc at 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(-)configs/xilinx_zynqmp_virt_defconfig +9
-0@@ -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=yinclude/configs/xilinx_zynqmp.h +1
-1@@ -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
PATCH 1/1 arm64: zynqmp: Enable capsule update
Quoted 18 lines · Heinrich Schuchardt
Quoted 17 lines · Michal Simek
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 raw0x800000x500000".There is a need to increase malloc size for getting dfu mmc to work.
Signed-off-by Michal Simek <[email protected]>CC Sughosh Ganu <[email protected]>CC Ilias Apalodimas <[email protected]>CC Heinrich Schuchardt <[email protected]>---
Quoted 7 lines
Quoted 3 lines
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