Hi Dinesh,

On Tue, 30 Jun 2026 14:55:22 +0800, [email protected] wrote:

diff --git a/arch/arm/mach-socfpga/rsu_spl.c b/arch/arm/mach-socfpga/rsu_spl.c
@@ -0,0 +228,16 @@ finding 232-239
+       if ((strlen(UBOOT_PREFIX) + MAX_PART_NAME_LENGTH + 
strlen(UBOOT_ITB_EXT))
+            > (size_t)max_size)
+               return -ENAMETOOLONG;
+
+       ret = get_spl_slot(&rsu_spt, sizeof(rsu_spt), &crt_spt_index);
+       if (ret) {
+               if (ret == -EOPNOTSUPP) {
+                       puts("RSU: Error - mbox_rsu_status failed! Check for RSU 
image.\n");
+                       return -EOPNOTSUPP;
+               }
+
+               panic("ERROR: could not find u-boot proper (SSBL) for MMC 
load");
+       }
+
+       if (IS_ENABLED(CONFIG_SPL_LOAD_FIT))
+               ret = snprintf(filename, (size_t)max_size, "%s%s%s", 
UBOOT_PREFIX,

SPL panics if the RSU SPT lookup fails during MMC payload name selection (patman-adjacent: boot hard-stop).

When CONFIG_SOCFPGA_RSU_MULTIBOOT is on, rsu_spl_mmc_filename() calls panic() if get_spl_slot() fails for any reason other than -EOPNOTSUPP. That hangs SPL instead of returning an error the generic loader can recover from. common/spl/spl_mmc.c already treats any non-zero return as fatal and never falls back to CONFIG_SPL_FS_LOAD_PAYLOAD_NAME, so a missing SSBL.* SPT entry (or a transient mailbox miss that is not EOPNOTSUPP) bricks MMC boot. Kconfig for SPL_SOCFPGA_RSU_SSBL_FALLBACK claims a bounded fallback exists for env-offset math; MMC filename selection has no equivalent.

Please: Return the errno (or -ENOENT) instead of panic(). In spl_mmc_load_image(), if rsu_spl_mmc_filename() fails, fall back to CONFIG_SPL_FS_LOAD_PAYLOAD_NAME rather than aborting the boot.


diff --git a/env/sf.c b/env/sf.c
@@ -98,18 +109,9 @@ finding 110-115
if (gd->env_valid == ENV_VALID) {
                env_new_offset = CONFIG_ENV_OFFSET_REDUND;
-               env_offset = CONFIG_ENV_OFFSET;
+               env_offset = env_sf_get_env_offset();
        } else {
-               env_new_offset = CONFIG_ENV_OFFSET;
+               env_new_offset = env_sf_get_env_offset();

SPI env redundant offset stays CONFIG_ENV_OFFSET_REDUND while the primary offset becomes runtime.

env_sf_get_env_offset() is used for the primary copy, but CONFIG_ENV_OFFSET_REDUND is still a compile-time address. With RSU multiboot the SSBL slot moves; the redundant environment does not move with it, so save/load can erase or read a slot that is no longer paired with the running image.

Please: Either document that redundant SPI env is not used with MULTIBOOT, or add env_sf_get_env_offset_redund() (primary + CONFIG_ENV_SIZE, or SPT-derived) and use it everywhere CONFIG_ENV_OFFSET_REDUND is read in this file.

                env_offset = CONFIG_ENV_OFFSET_REDUND;
        }
- read1_fail = spi_flash_read(env_flash, CONFIG_ENV_OFFSET,
-               saved_offset = CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE;
-       ret = spi_flash_erase(env_flash, CONFIG_ENV_OFFSET,
-               sector * sect_size);
-       ret = spi_flash_write(env_flash, CONFIG_ENV_OFFSET,
-               CONFIG_ENV_SIZE, &env_new);
-               CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, buf);
-       ret = spi_flash_write(env_flash, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, 
&env);
-       read1_fail = spi_flash_read(env_flash, CONFIG_ENV_OFFSET,

Fix the SPL panic and MMC fallback before v2. Mailbox length check and SPI redundant-env offset should ship in the same respin. Style/checkpatch warnings are not merge-blocking.

Best regards,
Tien Fong

Reply via email to