[PATCH v1] configs: socfpga: Add QSPI support for Cyclone 5
Chee, Tien Fong
tien.fong.chee at altera.com
Fri Apr 17 09:44:01 CEST 2026
Hi Boon Khai,
On 18/3/2026 6:40 pm, Boon Khai Ng wrote:
> Add QSPI boot support to boot target devices list.
> Platform can provide their own boot settings through
> OCFPGA_BOOT_SETTINGS macro if needed.
Commit message typo: “OCFPGA_BOOT_SETTINGS” — should be
SOCFPGA_BOOT_SETTINGS.
>
> Add SOCFPGA_BOOT_SETTINGS for Cyclone 5.
>
> Signed-off-by: Boon Khai Ng <boon.khai.ng at altera.com>
> ---
> include/configs/socfpga_common.h | 18 ++++++++++++++++++
> include/configs/socfpga_cyclone5_socdk.h | 18 ++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index 36d6bfb3d03..5d98d662ea7 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -137,11 +137,28 @@
> #define BOOT_TARGET_DEVICES_MMC(func)
> #endif
>
> +#ifdef CONFIG_CMD_SF
> +#define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
Any defconfig that sets CONFIG_CMD_SF=y and includes this header
will get qspi in boot_targets and a generic bootcmd_qspi=run qspiload;
run qspiboot.
Those commands only exist in the default env if the board defines
SOCFPGA_BOOT_SETTINGS (this patch only defines it for Cyclone V SOCdk).
Other SoCFPGA targets (Arria V, DE10, Sockit, …) might enable CMD_SF for
a small SPI flash or a different layout without defining qspiload /
qspiboot.
After this change, distro autoboot can eventually run bootcmd_qspi and
fail once MMC/PXE/DHCP paths do not boot a kernel.
QSPI boot-target integration should be restricted to Cyclone V with new
Kconfig-guarded macro.
Example:
config SOCFPGA_DISTRO_BOOT_QSPI
bool "Append QSPI to distro boot targets (boot_targets)"
depends on CMD_SF
default y if TARGET_SOCFPGA_CYCLONE5_SOCDK
help
When enabled, socfpga_common.h adds QSPI to the distro boot device
list and defines bootcmd_qspi (run qspiload; run qspiboot). The board
header must supply qspiload and qspiboot in default environment (for
example via SOCFPGA_BOARD_ENV_APPEND). Disable on boards that enable
CMD_SF for a small SPI flash or a layout incompatible with that flow.
Any other board stays n unless it sets CONFIG_SOCFPGA_DISTRO_BOOT_QSPI=y
in its defconfig (and defines qspiload / qspiboot in env).
#if IS_ENABLED(CONFIG_CMD_SF) && IS_ENABLED(CONFIG_SOCFPGA_DISTRO_BOOT_QSPI)
#define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
[...]
> +#else
> +#define BOOT_TARGET_DEVICES_QSPI(func)
> +#endif
> +
> +#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
> + "bootcmd_qspi=run qspiload; run qspiboot\0"
> +
> +#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
> + "qspi "
> +
> #define BOOT_TARGET_DEVICES(func) \
> BOOT_TARGET_DEVICES_MMC(func) \
> + BOOT_TARGET_DEVICES_QSPI(func) \
> BOOT_TARGET_DEVICES_PXE(func) \
> BOOT_TARGET_DEVICES_DHCP(func)
Best regards,
Tien Fong
More information about the U-Boot
mailing list