Skip to contentSkip to conversation

xilinx: Update capsule update support for Zynq and ZynqMP SD

PATCH Applied Michal Simek 1 participant 6 messages Aug 9, 2022 – Aug 23, 2022 Arm/Zynq architecture

lore
Share & tools
lore

Michal Simek

author maintainer
#0 lore raw

cover xilinx: Update capsule update support for Zynq and ZynqMP SD

Hi,

I am sending some patches to fix SD capsule support for Zynq and ZynqMP. And also improving logic around it.

Thanks,
Michal

Michal Simek (4):
xilinx: zynq: Enable mkeficapsule tools compilation
xilinx: Fix logic when dfu_alt_info is generated
xilinx: zynq: Use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME for dfu_alt_info
xilinx: Define only mmc devnum not partition

 board/xilinx/zynq/board.c          | 10 +++++-----
 board/xilinx/zynqmp/zynqmp.c       |  7 +++----
 configs/xilinx_zynq_virt_defconfig |  1 +
 3 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.36.1
author maintainer
#1 lore raw

PATCH 1/4 xilinx: zynq: Enable mkeficapsule tools compilation

Zynq can use efi capsule infrastructure that's why enable it by default. For capsule generation for zynq you can use:

pushd spl
../tools/mkeficapsule -g "1ba29a15-9969-40aa-b424-e86121618664" boot.bin \
--index 1 ../capsule1.bin
popd
./tools/mkeficapsule -g "1a5178f0-87d3-4f36-ac63-3b31a23be305" u-boot.img \
--index 2 capsule2.bin

---

 configs/xilinx_zynq_virt_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/xilinx_zynq_virt_defconfig +1 -0
index 7beb5915fcec..e6f8e221a5d5 100644
@@ -149,3 +149,4 @@ CONFIG_DISPLAY=y
 CONFIG_SPL_GZIP=y
 CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_TOOLS_MKEFICAPSULE=y
Signature · 1 line
2.36.1
author maintainer
#2 lore raw

PATCH 2/4 xilinx: Fix logic when dfu_alt_info is generated

In reply to Michal Simek

Generate dfu_alt_info only when it is not defined.

---

 board/xilinx/zynq/board.c    | 3 +--
 board/xilinx/zynqmp/zynqmp.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
board/xilinx/zynq/board.c +1 -2
index 63aff0474bea..26ef0488358d 100644
@@ -168,8 +168,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
 {
 	ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
 
-	if (!CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) &&
-	    env_get("dfu_alt_info"))
+	if (env_get("dfu_alt_info"))
 		return;
 
 	memset(buf, 0, sizeof(buf));
board/xilinx/zynqmp/zynqmp.c +1 -2
index 57259b60a02e..29a6e3675f3c 100644
@@ -641,8 +641,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
 
 	ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
 
-	if (!CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) &&
-	    env_get("dfu_alt_info"))
+	if (env_get("dfu_alt_info"))
 		return;
 
 	memset(buf, 0, sizeof(buf));
Signature · 1 line
2.36.1
author maintainer
#3 lore raw

PATCH 3/4 xilinx: zynq: Use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME for dfu_alt_info

In reply to Michal Simek

CONFIG_SPL_FS_LOAD_PAYLOAD_NAME stores the name of firmware file to be loaded by SPL. Name can be selected via Kconfig that's why use the macro.

---

 board/xilinx/zynq/board.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
board/xilinx/zynq/board.c +3 -2
index 26ef0488358d..3ab63fa76e09 100644
@@ -177,12 +177,13 @@ void set_dfu_alt_info(char *interface, char *devstr)
 	case ZYNQ_BM_SD:
 		snprintf(buf, DFU_ALT_BUF_LEN,
 			 "mmc 0:1=boot.bin fat 0 1;"
-			 "u-boot.img fat 0 1");
+			 "%s fat 0 1", CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
 		break;
 	case ZYNQ_BM_QSPI:
 		snprintf(buf, DFU_ALT_BUF_LEN,
 			 "sf 0:0=boot.bin raw 0 0x1500000;"
-			 "u-boot.img raw 0x%x 0x500000",
+			 "%s raw 0x%x 0x500000",
+			 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
 			 CONFIG_SYS_SPI_U_BOOT_OFFS);
 		break;
 	default:
Signature · 1 line
2.36.1
author maintainer
#4 lore raw

PATCH 4/4 xilinx: Define only mmc devnum not partition

In reply to Michal Simek

The commit 53b406369e9d ("DFU: Check the number of arguments and argument string strictly") added strict control over string that 0:1 partition definition is not valid anymore that's why use only device number without partition ID. Device is specified by 2nd parameter and partition by 3rd.

---

 board/xilinx/zynq/board.c    | 2 +-
 board/xilinx/zynqmp/zynqmp.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
board/xilinx/zynq/board.c +1 -1
index 3ab63fa76e09..c96433be693b 100644
@@ -176,7 +176,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
 	switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
 	case ZYNQ_BM_SD:
 		snprintf(buf, DFU_ALT_BUF_LEN,
-			 "mmc 0:1=boot.bin fat 0 1;"
+			 "mmc 0=boot.bin fat 0 1;"
 			 "%s fat 0 1", CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
 		break;
 	case ZYNQ_BM_QSPI:
board/xilinx/zynqmp/zynqmp.c +2 -2
index 29a6e3675f3c..21bcc266826a 100644
@@ -661,13 +661,13 @@ void set_dfu_alt_info(char *interface, char *devstr)
 		bootseq = mmc_get_env_dev();
 		if (!multiboot)
 			snprintf(buf, DFU_ALT_BUF_LEN,
-				 "mmc %d:1=boot.bin fat %d 1;"
+				 "mmc %d=boot.bin fat %d 1;"
 				 "%s fat %d 1",
 				 bootseq, bootseq,
 				 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME, bootseq);
 		else
 			snprintf(buf, DFU_ALT_BUF_LEN,
-				 "mmc %d:1=boot%04d.bin fat %d 1;"
+				 "mmc %d=boot%04d.bin fat %d 1;"
 				 "%s fat %d 1",
 				 bootseq, multiboot, bootseq,
 				 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME, bootseq);
Signature · 1 line
2.36.1
author maintainer Applied
#5 lore raw
In reply to Michal Simek
Quoted 15 lines · Michal Simek

Hi,

I am sending some patches to fix SD capsule support for Zynq and ZynqMP. And also improving logic around it.

Thanks,
Michal

Michal Simek (4):
xilinx: zynq: Enable mkeficapsule tools compilation
xilinx: Fix logic when dfu_alt_info is generated
xilinx: zynq: Use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME for dfu_alt_info
xilinx: Define only mmc devnum not partition

Quoted 5 lines
  board/xilinx/zynq/board.c          | 10 +++++-----
  board/xilinx/zynqmp/zynqmp.c       |  7 +++----
  configs/xilinx_zynq_virt_defconfig |  1 +
  3 files changed, 9 insertions(+), 9 deletions(-)

applied.
M