Re: [PATCH] ARM: socfpga: fix dead guard on board_spl_mmc_get_uboot_raw_sector()

Marek Vasut via U-Boot <[email protected]> Tue, 4 Aug 2026 05:38:45 +0200
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
On 8/4/26 3:38 AM, Mahmoud Komaiha wrote:
> From: Mahmoud Komaiha <[email protected]>
> 
> board_spl_mmc_get_uboot_raw_sector() is guarded on
> CONFIG_TARGET_SOCFPGA_ARRIA10 and CONFIG_TARGET_SOCFPGA_GEN5. Neither
> symbol exists in Kconfig: the family symbols are ARCH_SOCFPGA_ARRIA10 and
> ARCH_SOCFPGA_GEN5, while the per-board symbols are of the form
> TARGET_SOCFPGA_ARRIA10_SOCDK / TARGET_SOCFPGA_TERASIC_DE10_NANO. These two
> lines are the only references to either symbol in the tree.
> 
> The guard is therefore never true and the function is dead code on every
> SoCFPGA board, so the offset of u-boot proper inside u-boot-with-spl.sfp
> is never applied.
> 
> When SPL loads u-boot proper from the 0xa2 partition
> (SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE) the resulting load address
> is the start of that partition, which holds SPL itself rather than u-boot
> proper. SPL then hangs with no diagnostic after printing
> "spl: mmc boot mode: raw".
> 
> Observed on a Terasic DE10-Nano (Cyclone V, GEN5) booting from SD with the
> standard layout (0xa2 partition at sector 1024). Instrumenting
> mmc_load_image_raw_partition() showed the computed load sector as 1024
> instead of 1536. With the guard corrected the offset is applied, the load
> sector becomes 1536, and the board boots to the U-Boot prompt.
> 
> Signed-off-by: Mahmoud Komaiha <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>

Fixes: 62f7a9460209 ("Replace TARGET namespace and cleanup properly")

Thanks !