]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Generate desc when SPL_FS_LOAD_PAYLOAD_NAME is valid
authorMichal Simek <michal.simek@amd.com>
Fri, 22 Mar 2024 12:09:18 +0000 (13:09 +0100)
committerMichal Simek <michal.simek@amd.com>
Tue, 2 Apr 2024 13:08:21 +0000 (15:08 +0200)
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 <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4cec866f5fffa742258c65796371d7bfc6068915.1711109356.git.michal.simek@amd.com
board/xilinx/zynqmp/zynqmp.c

index 79daaf8723acfd4b1f3d2d96e8c7539b765aa343..e6b562e3309de1df804969d99cdba07c3c0411a1 100644 (file)
@@ -663,8 +663,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:
@@ -673,10 +676,12 @@ void set_dfu_alt_info(char *interface, char *devstr)
                               "sf 0:0=boot.bin raw %x 0x1500000",
                               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 0x500000",
-                              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 0x500000",
+                                       CONFIG_SPL_FS_LOAD_PAYLOAD_NAME,
+                                       multiboot * SZ_32K +
+                                       CONFIG_SYS_SPI_U_BOOT_OFFS);
 #endif
                break;
        default: