Re: [PATCH v2 1/2] arm64: zynqmp: Generate desc when SPL_FS_LOAD_PAYLOAD_NAME is valid

2024-04-02 Thread Michal Simek




On 3/22/24 13:09, Michal Simek wrote:

Generate description only when CONFIG_SPL_FS_LOAD_PAYLOAD_NAME is not
empty. When name is empty there is no reason to generate description for
it because it is not aligned with dfu rules.

Signed-off-by: Michal Simek 
---

Changes in v2:
- New patch is series coming from discussion at
https://lore.kernel.org/all/561f9d0ee96ebb6cd674042f269f280ab68fbbac.1708705118.git.michal.si...@amd.com/

  board/xilinx/zynqmp/zynqmp.c | 17 +++--
  1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index ba49eb7be229..3844a9c9a8ff 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -661,8 +661,11 @@ void set_dfu_alt_info(char *interface, char *devstr)
len += snprintf(buf + len, DFU_ALT_BUF_LEN, ".bin fat %d 1",
   bootseq);
  #if defined(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME)
-   len += snprintf(buf + len, DFU_ALT_BUF_LEN, ";%s fat %d 1",
-  CONFIG_SPL_FS_LOAD_PAYLOAD_NAME, bootseq);
+   if (strlen(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME))
+   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
+   ";%s fat %d 1",
+   CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
+   bootseq);
  #endif
break;
case QSPI_MODE_24BIT:
@@ -671,10 +674,12 @@ void set_dfu_alt_info(char *interface, char *devstr)
   "sf 0:0=boot.bin raw %x 0x150",
   multiboot * SZ_32K);
  #if defined(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME) && 
defined(CONFIG_SYS_SPI_U_BOOT_OFFS)
-   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
-  ";%s raw 0x%x 0x50",
-  CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
-  multiboot * SZ_32K + CONFIG_SYS_SPI_U_BOOT_OFFS);
+   if (strlen(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME))
+   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
+   ";%s raw 0x%x 0x50",
+   CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
+   multiboot * SZ_32K +
+   CONFIG_SYS_SPI_U_BOOT_OFFS);
  #endif
break;
default:


Applied.
M


[PATCH v2 1/2] arm64: zynqmp: Generate desc when SPL_FS_LOAD_PAYLOAD_NAME is valid

2024-03-22 Thread Michal Simek
Generate description only when CONFIG_SPL_FS_LOAD_PAYLOAD_NAME is not
empty. When name is empty there is no reason to generate description for
it because it is not aligned with dfu rules.

Signed-off-by: Michal Simek 
---

Changes in v2:
- New patch is series coming from discussion at
https://lore.kernel.org/all/561f9d0ee96ebb6cd674042f269f280ab68fbbac.1708705118.git.michal.si...@amd.com/

 board/xilinx/zynqmp/zynqmp.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index ba49eb7be229..3844a9c9a8ff 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -661,8 +661,11 @@ void set_dfu_alt_info(char *interface, char *devstr)
len += snprintf(buf + len, DFU_ALT_BUF_LEN, ".bin fat %d 1",
   bootseq);
 #if defined(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME)
-   len += snprintf(buf + len, DFU_ALT_BUF_LEN, ";%s fat %d 1",
-  CONFIG_SPL_FS_LOAD_PAYLOAD_NAME, bootseq);
+   if (strlen(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME))
+   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
+   ";%s fat %d 1",
+   CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
+   bootseq);
 #endif
break;
case QSPI_MODE_24BIT:
@@ -671,10 +674,12 @@ void set_dfu_alt_info(char *interface, char *devstr)
   "sf 0:0=boot.bin raw %x 0x150",
   multiboot * SZ_32K);
 #if defined(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME) && 
defined(CONFIG_SYS_SPI_U_BOOT_OFFS)
-   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
-  ";%s raw 0x%x 0x50",
-  CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
-  multiboot * SZ_32K + CONFIG_SYS_SPI_U_BOOT_OFFS);
+   if (strlen(CONFIG_SPL_FS_LOAD_PAYLOAD_NAME))
+   len += snprintf(buf + len, DFU_ALT_BUF_LEN,
+   ";%s raw 0x%x 0x50",
+   CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
+   multiboot * SZ_32K +
+   CONFIG_SYS_SPI_U_BOOT_OFFS);
 #endif
break;
default:
-- 
2.44.0