arm: socfpga: Add fitImage for SPL programs periph RBF only
PATCH 1/1 arm: socfpga: Add fitImage for SPL programs periph RBF only
From: Dinesh Maniyam <[email protected]>
This is fitImage for programming peripheral RBF only in SPL, so that user has option to program core RBF in U-Boot proper. The advantage of programming core RBF in U-Boot proper especially for SDMMC boot the performance can be increased up to around 90%, because program core RBF in SPL hitting penalty on alignment issue in common FAT driver.
--- .../fit_spl_fpga_periph_only.its | 38 +++++++++++++++++++ configs/socfpga_arria10_defconfig | 2 +- include/configs/socfpga_common.h | 2 + 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 board/altera/arria10-socdk/fit_spl_fpga_periph_only.its
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +38 -0
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 + /* + * Copyright (C) 2020 Intel Corporation <www.intel.com> + * + */ + +/dts-v1/; + +/ { + description = "FIT image with FPGA bistream"; + #address-cells = <1>; + + images { + fpga-periph-1 { + description = "FPGA peripheral bitstream"; + data = /incbin/("../../../ghrd_10as066n2.periph.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + + fpga-core-1 { + description = "FPGA core bitstream"; + data = /incbin/("../../../ghrd_10as066n2.core.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1"; + }; + }; +};
configs/socfpga_arria10_defconfig +1 -1
@@ -20,7 +20,7 @@ CONFIG_SPL_FIT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" -# CONFIG_USE_BOOTCOMMAND is not set +CONFIG_BOOTCOMMAND="run fatscript;run prog_core;bridge enable;run distro_bootcmd" CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
include/configs/socfpga_common.h +2 -0
@@ -154,6 +154,8 @@"pxefile_addr_r=0x02200000\0" \"ramdisk_addr_r=0x02300000\0" \"socfpga_legacy_reset_compat=1\0" \ +"prog_core=if load mmc 0:1 ${loadaddr} fit_spl_fpga.itb;" \ +"then fpga loadmk 0 ${loadaddr}:fpga-core-1; fi\0" \ BOOTENV#endif
Signature · 1 line
2.43.7
Hi DInesh,
Quoted 6 lines · On 11/3/2026 1:03 pm, [email protected] wrote:
From: Dinesh Maniyam <[email protected]>
This is fitImage for programming peripheral RBF only in SPL, so that user has option to program core RBF in U-Boot proper. The advantage of programming core RBF in U-Boot proper especially for SDMMC boot the performance can be increased up to around 90%, because program core RBF
Please clarify what “~90%” is relative to (e.g. core programming time, total SPL time, etc.).
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its
Quoted 14 lines
in SPL hitting penalty on alignment issue in common FAT driver.
Signed-off-by Tien Fong Chee <[email protected]>Signed-off-by Dinesh Maniyam <[email protected]>--- .../fit_spl_fpga_periph_only.its | 38 +++++++++++++++++++ configs/socfpga_arria10_defconfig | 2 +- include/configs/socfpga_common.h | 2 + 3 files changed, 41 insertions(+), 1 deletion(-)create mode 100644 board/altera/arria10-socdk/fit_spl_fpga_periph_only.its
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +0
-0
Documentation: https://github.com/u-boot/u-boot/blob/master/doc/device-tree-bindings/fpga/altera-socfpga-a10-fpga-mgr.txt
still describe a single fit_spl_fpga.itb built from fit_spl_fpga.its.
Please document the two-stage flow: which ITS produces which ITB,what must be placed on the boot medium,
and what SPL vs U-Boot proper load.
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 2
Quoted 5 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +2
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 + /*
Comment block formatting after the SPDX line: avoid the stray space before /* for consistency with common U-Boot style
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 3
Quoted 1 line
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +1
-0+ * Copyright (C) 2020 Intel Corporation <www.intel.com>
Copyright year on the new file: align with current practice for new contributions.
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 10
Quoted 7 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +7
-0+ * + */ + +/dts-v1/; + +/ { + description = "FIT image with FPGA bistream";
description = "FIT image with FPGA bistream"; — typo: bitstream (same typo exists in fit_spl_fpga.its; fixing the new file at minimum would help).
Quoted 33 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +28
-0+ #address-cells = <1>; + + images { + fpga-periph-1 { + description = "FPGA peripheral bitstream"; + data = /incbin/("../../../ghrd_10as066n2.periph.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + + fpga-core-1 { + description = "FPGA core bitstream"; + data = /incbin/("../../../ghrd_10as066n2.core.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1"; + }; + }; +};configs/socfpga_arria10_defconfig +0
-0
configs/socfpga_arria10_defconfig CONFIG_SPL_FIT=y · line 23
Quoted 5 lines
configs/socfpga_arria10_defconfig +1
-1@@ -20,7 +20,7 @@ CONFIG_SPL_FIT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" -# CONFIG_USE_BOOTCOMMAND is not set +CONFIG_BOOTCOMMAND="run fatscript;run prog_core;bridge enable;run distro_bootcmd"
Changing from “no default bootcommand” to run fatscript; run prog_core; bridge enable; run distro_bootcmd is a strong default for all users of socfpga_arria10_defconfig.
It assumes MMC, FAT, optional u-boot.scr, fit_spl_fpga.itb on the card, and a
sensible ordering with bridge enable after FPGA steps.
Users booting from QSPI/NAND or without those files may get surprising behavior.
You can opt-in FPGA chain + clearer prog_core in socfpga_arria10_socdk.h, see the example in next comment.
include/configs/socfpga_common.h line 158
Quoted 13 lines
configs/socfpga_arria10_defconfig +0
-0CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=yinclude/configs/socfpga_common.h +2
-0@@ -154,6 +154,8 @@"pxefile_addr_r=0x02200000\0" \"ramdisk_addr_r=0x02300000\0" \"socfpga_legacy_reset_compat=1\0" \ +"prog_core=if load mmc 0:1 ${loadaddr} fit_spl_fpga.itb;" \ +"then fpga loadmk 0 ${loadaddr}:fpga-core-1; fi\0" \
prog_core must not live in socfpga_common.h for all SoCFPGA boards. Please move this to socfpga_arria10_socdk.h
You can replace above with macro SOCFPGA_BOARD_ENV_APPEND. And define the macro in socfpga_arria10_socdk.h
/*
* SD/MMC boot uses CFG_EXTRA_ENV_SETTINGS from socfpga_common.h; append
* Arria 10 SOCdk-only variables here so other SoCFPGA boards are unaffected. *
* Default CONFIG_BOOTCOMMAND stays "run distro_bootcmd" (no MMC/FAT/FIT
* assumptions at autoboot). For two-stage FPGA (script, core bitstream, bridges,
* then distro), run: bootcmd_fpga_mmc
* e.g. setenv bootcmd "run bootcmd_fpga_mmc"; saveenv
* or invoke that from u-boot.scr.
*/
#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_NAND_BOOT)
#define SOCFPGA_BOARD_ENV_APPEND \
"prog_core=if load mmc 0:1 ${loadaddr} fit_spl_fpga.itb; then " \
"if fpga loadmk 0 ${loadaddr}:fpga-core-1; then " \
"echo prog_core: ok; " \
"else echo prog_core: fpga_loadmk_failed; fi; " \
"else echo prog_core: fit_load_failed; fi\0" \
"bootcmd_fpga_mmc=run fatscript; run prog_core; bridge enable; " \
"run distro_bootcmd\0"
#endif
Best regards,
Tien Fong
Hi TF,
Quoted 6 lines · Tien Fong
Hi DInesh,
Quoted 2 lines · On 11/3/2026 1:03 pm, [email protected] wrote:
From: Dinesh Maniyam <[email protected]>
Quoted 8 lines
Quoted 4 lines
This is fitImage for programming peripheral RBF only in SPL, so that user has option to program core RBF in U-Boot proper. The advantage of programming core RBF in U-Boot proper especially for SDMMC boot the performance can be increased up to around 90%, because program core RBF
Please clarify what “~90%” is relative to (e.g. core programming time, total SPL time, etc.).
Will drop the percentage entirely, this is qualitative rather than a quantified percentage.
Quoted 20 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its
Quoted 15 lines
in SPL hitting penalty on alignment issue in common FAT driver.
Signed-off-by Tien Fong Chee <[email protected]>Signed-off-by Dinesh Maniyam <[email protected]>--- .../fit_spl_fpga_periph_only.its | 38 +++++++++++++++++++ configs/socfpga_arria10_defconfig | 2 +- include/configs/socfpga_common.h | 2 + 3 files changed, 41 insertions(+), 1 deletion(-)create mode 100644 board/altera/arria10-socdk/fit_spl_fpga_periph_only.its
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +0
-0Documentation:
https://github.com/u-boot/u-boot/blob/master/doc/device-tree-bindings/fpga/altera-socfpga-a10-fpga-mgr.txt
Quoted 7 lines
still describe a single fit_spl_fpga.itb built from fit_spl_fpga.its.
Please document the two-stage flow: which ITS produces which ITB,what must be placed on the boot medium,
and what SPL vs U-Boot proper load.
Two fixes: (1) wired altr,bitstream in the -u-boot.dtsi to the new periph-only .itb -- without this SPL still finds a core node in the old combined .itb and programs it, so v1 was a no-op in practice.
(2) Added the two-stage flow to the fpga-mgr binding doc: which .its builds which .itb, and that both .itb files must stay on the boot medium (prog_core loads the combined one for fpga-core-1).
Quoted 10 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 2
Quoted 6 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +2
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 + /*Comment block formatting after the SPDX line: avoid the stray space
before /* for consistency with common U-Boot style
will be updated!
Quoted 6 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 3
Quoted 2 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +1
-0+ * Copyright (C) 2020 Intel Corporation <www.intel.com>Copyright year on the new file: align with current practice for new contributions.
will be updated!
Quoted 61 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its line 10
Quoted 8 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +7
-0+ * + */ + +/dts-v1/; + +/ { + description = "FIT image with FPGA bistream";description = "FIT image with FPGA bistream"; — typo: bitstream (same typo exists in fit_spl_fpga.its; fixing the new file at minimum would help).
Quoted 33 lines
board/altera/arria10-socdk/fit_spl_fpga_periph_only.its new file +28
-0+ #address-cells = <1>; + + images { + fpga-periph-1 { + description = "FPGA peripheral bitstream"; + data = /incbin/("../../../ghrd_10as066n2.periph.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + + fpga-core-1 { + description = "FPGA core bitstream"; + data = /incbin/("../../../ghrd_10as066n2.core.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1"; + }; + }; +};configs/socfpga_arria10_defconfig +0
-0configs/socfpga_arria10_defconfig CONFIG_SPL_FIT=y · line 23
Quoted 5 lines
configs/socfpga_arria10_defconfig +1
-1@@ -20,7 +20,7 @@ CONFIG_SPL_FIT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" -# CONFIG_USE_BOOTCOMMAND is not set +CONFIG_BOOTCOMMAND="run fatscript;run prog_core;bridge enable;run distro_bootcmd"Changing from “no default bootcommand” to run fatscript; run
prog_core; bridge enable; rundistro_bootcmd
is a strong default for all users ofsocfpga_arria10_defconfig.It assumes MMC, FAT, optional u-boot.scr, fit_spl_fpga.itb on the card, and a
Quoted 8 lines
sensible ordering with bridge enable after FPGA steps.
Users booting from QSPI/NAND or without those files may get surprising behavior.
You can opt-in FPGA chain + clearer
prog_coreinsocfpga_arria10_socdk.h, see the example in next comment.
Dropped the override. v2 only adds CONFIG_CMD_FPGA_LOADMK=y; default bootcmd is untouched. Two-stage flow is opt-in via
"run bootcmd_fpga_mmc".
One deviation from your snippet: dropped "run fatscript;" -- it doesn't exist in upstream mainline. Say the word if you want it added as its own thing.
Quoted 18 lines
Quoted 9 lines
configs/socfpga_arria10_defconfig +0
-0CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=yinclude/configs/socfpga_common.h +0
-0include/configs/socfpga_common.h line 158
Quoted 5 lines
include/configs/socfpga_common.h +2
-0@@ -154,6 +154,8 @@"pxefile_addr_r=0x02200000\0" \"ramdisk_addr_r=0x02300000\0" \"socfpga_legacy_reset_compat=1\0" \ +"prog_core=if load mmc 0:1 ${loadaddr} fit_spl_fpga.itb;" \ +"then fpga loadmk 0 ${loadaddr}:fpga-core-1; fi\0" \
prog_coremust not live insocfpga_common.hfor all SoCFPGA boards. Please move this tosocfpga_arria10_socdk.h
Quoted 3 lines
You can replace above with macro
SOCFPGA_BOARD_ENV_APPEND. And define the macro in socfpga_arria10_socdk.h
Done as specified: empty-by-default hook in socfpga_common.h, real definition (same QSPI/NAND guard) in socfpga_arria10_socdk.h. socfpga_common.h otherwise untouched.
Quoted 24 lines
/*
* SD/MMC boot usesCFG_EXTRA_ENV_SETTINGSfromsocfpga_common.h; append
* Arria 10 SOCdk-only variables here so other SoCFPGA boards are
unaffected.
*
* DefaultCONFIG_BOOTCOMMANDstays "rundistro_bootcmd" (no MMC/FAT/FIT
* assumptions at autoboot). For two-stage FPGA (script, core
bitstream, bridges,
* then distro), run:bootcmd_fpga_mmc
* e.g. setenv bootcmd "runbootcmd_fpga_mmc"; saveenv
* or invoke that from u-boot.scr.
*/
#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_NAND_BOOT) #define SOCFPGA_BOARD_ENV_APPEND \
"prog_core=if load mmc 0:1 ${loadaddr} fit_spl_fpga.itb; then " \
"if fpga loadmk 0 ${loadaddr}:fpga-core-1; then " \
"echoprog_core: ok; " \
"else echoprog_core:fpga_loadmk_failed; fi; " \
"else echoprog_core:fit_load_failed; fi\0" \
"bootcmd_fpga_mmc=run fatscript; runprog_core; bridge enable; " \
"run distro_bootcmd\0"
#endif
Quoted 4 lines
Best regards,
Tien Fong
please expect v2.
Regards,
Dinesh