]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm64: versal-net: Do not print bootmode from spi_get_env_dev()
authorMichal Simek <michal.simek@amd.com>
Tue, 23 Jun 2026 12:53:41 +0000 (14:53 +0200)
committerMichal Simek <michal.simek@amd.com>
Wed, 8 Jul 2026 06:55:51 +0000 (08:55 +0200)
spi_get_bootseq() printed the QSPI/OSPI mode banner, which is noise when
called from spi_get_env_dev() during environment setup. The banner is
only meaningful for the "Bootmode:" announcement in boot_targets_setup().

Make spi_get_bootseq() a pure lookup that returns the banner string
through an optional output argument instead of printing it.
spi_get_env_dev() passes NULL and stays silent, while
boot_targets_setup() prints the returned mode name as before.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/ae257af9d2fe026306b32c647e406450319a3c7a.1782219202.git.michal.simek@amd.com
board/xilinx/versal-net/board.c

index 50dd49927be2e55190c8c81b404c53ab894bb246..687d042d1062edc598aa4d33cf891482e5f989e3 100644 (file)
@@ -68,7 +68,7 @@ int board_early_init_r(void)
        return 0;
 }
 
-static int spi_get_bootseq(u8 bootmode)
+static int spi_get_bootseq(u8 bootmode, const char **modename)
 {
        struct udevice *dev;
        const char *name;
@@ -76,15 +76,18 @@ static int spi_get_bootseq(u8 bootmode)
 
        switch (bootmode) {
        case QSPI_MODE_24BIT:
-               puts("QSPI_MODE_24\n");
+               if (modename)
+                       *modename = "QSPI_MODE_24\n";
                name = "spi@f1030000";
                break;
        case QSPI_MODE_32BIT:
-               puts("QSPI_MODE_32\n");
+               if (modename)
+                       *modename = "QSPI_MODE_32\n";
                name = "spi@f1030000";
                break;
        case OSPI_MODE:
-               puts("OSPI_MODE\n");
+               if (modename)
+                       *modename = "OSPI_MODE\n";
                name = "spi@f1010000";
                break;
        default:
@@ -104,7 +107,7 @@ static int spi_get_bootseq(u8 bootmode)
 
 int spi_get_env_dev(void)
 {
-       return spi_get_bootseq(versal_net_get_bootmode());
+       return spi_get_bootseq(versal_net_get_bootmode(), NULL);
 }
 
 static int boot_targets_setup(void)
@@ -115,6 +118,7 @@ static int boot_targets_setup(void)
        int bootseq_len = 0;
        int env_targets_len = 0;
        const char *mode = NULL;
+       const char *modename = NULL;
        char *new_targets;
        char *env_targets;
 
@@ -133,7 +137,9 @@ static int boot_targets_setup(void)
        case QSPI_MODE_24BIT:
        case QSPI_MODE_32BIT:
        case OSPI_MODE:
-               bootseq = spi_get_bootseq(bootmode);
+               bootseq = spi_get_bootseq(bootmode, &modename);
+               if (modename)
+                       puts(modename);
                if (bootseq >= 0)
                        mode = "xspi";
                break;