arm: socfpga: arria10: allow to reprogram FPGA with warm reboot
Subsystems (3)
cover arm: socfpga: arria10: allow to reprogram FPGA with warm reboot
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds Kconfig that allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.
Michał Barnaś (2):
arm: socfpga: arria10: add option to reprogram the FPGA every reboot
chameleonv3: set in defconfig for FPGA to reprogram every reboot
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ configs/socfpga_chameleonv3_defconfig | 1 + 3 files changed, 17 insertions(+)
Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
PATCH 1/2 arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Add Kconfig that enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.
---
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)
arch/arm/mach-socfpga/Kconfig +8 -0
@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5
arch/arm/mach-socfpga/spl_a10.c +8 -0
@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;
@@ -130,7 +134,11 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );if (ret)return ; +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + }else { +#else } else if (!is_fpgamgr_early_user_mode()) { +#endif /* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 );
Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
RE: [PATCH 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Quoted 73 lines
-----Original Message-----
From: Michał Barnaś <[email protected]>
Sent: Thursday, February 22, 2024 11:21 PM
To: [email protected]
Cc: Michał Barnaś <[email protected]>; Dinh Nguyen <[email protected]>; Marek Vasut <[email protected]>; Simon Glass <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>; Tom Rini <[email protected]>
Subject: [PATCH 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every rebootAdd
Kconfigthat enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.Signed-off-by Michał Barnaś <[email protected]>---
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)arch/arm/mach- renamed from arch/arm/mach-socfpga/Kconfig +0
-0socfpga/Kconfig index
114d243812..89303f1f16100644arch/arm/mach-socfpga/Kconfig +8
-0@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_a10.c +0
-0
socfpga/spl_a10.cindex9edbbf4a29..d5d3327a42100644arch/arm/mach-socfpga/spl_a10.c +8
-1@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;@@ -130,7 +134,11 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );if (ret)return ; +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + }else { +#else } else if (!is_fpgamgr_early_user_mode()) { +#endif /* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 ); --
Quoted 1 line
2.44.0.rc1.240.g4c46232300-goog
Regards
Tien Fong
Dinh Nguyen
maintainerRe: [PATCH 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every reboot
In reply to Michał BarnaśQuoted 48 lines · Michał Barnaś
Add
Kconfigthat enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.Signed-off-by Michał Barnaś <[email protected]>---
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)arch/arm/mach-socfpga/Kconfig +8
-0@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5arch/arm/mach-socfpga/spl_a10.c +4
-0@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;@@ -130,7 +134,11 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );
arch/arm/mach-socfpga/spl_a10.c void spl_board_init(void) · line 144
Quoted 10 lines
arch/arm/mach-socfpga/spl_a10.c +4
-0if (ret)return ; +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + }else { +#else } else if (!is_fpgamgr_early_user_mode()) { +#endif /* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 );
I got an error while trying to apply this patch:
Checking patch arch/arm/mach-socfpga/Kconfig...
error: while searching for:
imply FPGA_SOCFPGA
imply SPL_USE_TINY_PRINTF
config TARGET_SOCFPGA_CYCLONE5
bool
select TARGET_SOCFPGA_GEN5
error: patch failed: arch/arm/mach-socfpga/Kconfig:80 Checking patch arch/arm/mach-socfpga/spl_a10.c...
Please rebase to the latest and re-send.
Dinh
v2 cover arm: socfpga: arria10: allow to reprogram FPGA with warm reboot
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds Kconfig that allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.
Changes in v2:
- Rebase on current master branch
Michał Barnaś (2):
arm: socfpga: arria10: add option to reprogram the FPGA every reboot
chameleonv3: set in defconfig for FPGA to reprogram every reboot
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ configs/socfpga_chameleonv3_defconfig | 1 + 3 files changed, 17 insertions(+)
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
PATCH v2 1/2 arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Add Kconfig that enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.
---
Changes in v2:
- Rebase on current master branch
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)
arch/arm/mach-socfpga/Kconfig +8 -0
@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5
arch/arm/mach-socfpga/spl_a10.c +8 -0
@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;
@@ -130,7 +134,11 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );if (ret)return ; +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + }else { +#else } else if (!is_fpgamgr_early_user_mode()) { +#endif /* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 );
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
Re: [PATCH v2 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Quoted 19 lines · Michał Barnaś
Add
Kconfigthat enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.Signed-off-by Michał Barnaś <[email protected]>---
Changes in v2:
- Rebase on current master brancharch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)arch/arm/mach-socfpga/Kconfig +0
-0
arch/arm/mach-socfpga/Kconfig config TARGET_SOCFPGA_ARRIA10 · line 83
Quoted 4 lines
arch/arm/mach-socfpga/Kconfig +1
-0@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM
This is not TARGET (as in SoC), but a regular config option, so please drop the TARGET_ prefix .
Quoted 15 lines
arch/arm/mach-socfpga/Kconfig +7
-0+ bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5arch/arm/mach-socfpga/spl_a10.c +0
-0
arch/arm/mach-socfpga/spl_a10.c void spl_board_init(void) · line 129
Quoted 8 lines
arch/arm/mach-socfpga/spl_a10.c +4
-0@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif
Use CONFIG_IS_ENABLED() or IS_ENABLED() macro please .
v3 cover arm: socfpga: arria10: allow to reprogram FPGA with warm reboot
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds Kconfig that allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.
Changes in v3:
- Rebase on current master branch
- Drop the TARGET_ prefix in Kconfig
- Remove #ifdefs and use IS_ENABLED
- Update defconfig to use renamed Kconfig
Changes in v2:
- Rebase on current master branch
Michał Barnaś (2):
arm: socfpga: arria10: add option to reprogram the FPGA every reboot
chameleonv3: set in defconfig for FPGA to reprogram every reboot
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++-- configs/socfpga_chameleonv3_defconfig | 1 + 3 files changed, 15 insertions(+), 2 deletions(-)
Signature · 1 line
2.44.0.291.gc1ea87d7ee-goog
PATCH v3 1/2 arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Add Kconfig that enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.
---
Changes in v3:
- Rebase on current master branch
- Drop the TARGET_ prefix in Kconfig
- Remove #ifdefs and use IS_ENABLED
Changes in v2:
- Rebase on current master branch
arch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/Kconfig +8 -0
@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5
arch/arm/mach-socfpga/spl_a10.c +6 -2
@@ -122,7 +122,10 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ -if (is_fpgamgr_user_mode ()) { +if ((IS_ENABLED (CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM ) && +is_regular_boot_valid ()) || + (!IS_ENABLED (CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM ) && +is_fpgamgr_user_mode ())) { ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;
@@ -130,7 +133,8 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );if (ret)return ; - }else if (!is_fpgamgr_early_user_mode ()) { + }else if (IS_ENABLED (CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM ) || + !is_fpgamgr_early_user_mode ()) {/* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 );
Signature · 1 line
2.44.0.291.gc1ea87d7ee-goog
RE: [PATCH v3 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every reboot
Quoted 82 lines
-----Original Message-----
From: Michał Barnaś <[email protected]>
Sent: Wednesday, March 20, 2024 2:18 AM
To: [email protected]
Cc: Michał Barnaś <[email protected]>; Dinh Nguyen <[email protected]>; Marek Vasut <[email protected]>; Simon Glass <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>; Tom Rini <[email protected]>
Subject: [PATCH v3 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every rebootAdd
Kconfigthat enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.Signed-off-by Michał Barnaś <[email protected]>---
Changes in v3:
- Rebase on current master branch
- Drop theTARGET_prefix inKconfig
- Remove #ifdefs and useIS_ENABLEDChanges in v2:
- Rebase on current master brancharch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-)arch/arm/mach- renamed from arch/arm/mach-socfpga/Kconfig +0
-0socfpga/Kconfig index
114d243812..a89bd8ca58100644arch/arm/mach-socfpga/Kconfig +8
-0@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config SOCFPGA_ARRIA10_ALWAYS_REPROGRAM + bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_a10.c +0
-0
socfpga/spl_a10.cindex9edbbf4a29..3981d2d4f1100644arch/arm/mach-socfpga/spl_a10.c +1
-1@@ -122,7 +122,10 @@ void spl_board_init(void)arch_early_init_r ();/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ -if (is_fpgamgr_user_mode ()) { + if((
IS_ENABLED(CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM)&&arch/arm/mach-socfpga/spl_a10.c +2
-0+ is_regular_boot_valid()) || +(!IS_ENABLED(CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM) &&
arch/arm/mach-socfpga/spl_a10.c +2
-1+ is_fpgamgr_user_mode())) { ret =config_pins (gd->fdt_blob,"shared" );if (ret)return ;@@ -130,7 +133,8 @@ void spl_board_init(void) ret =config_pins (gd->fdt_blob,"fpga" );if (ret)return ; - }else if (!is_fpgamgr_early_user_mode ()) { + } else if(
IS_ENABLED(CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM)||arch/arm/mach-socfpga/spl_a10.c +1
-1+ !is_fpgamgr_early_user_mode()) {/* Program IOSSM(early IO release) or full FPGA */ fpgamgr_program (buf,FPGA_BUFSIZ ,0 ); --
Quoted 1 line
2.44.0.291.gc1ea87d7ee-goog
Regards
Tien Fong
PATCH v3 2/2 chameleonv3: set in defconfig for FPGA to reprogram every reboot
In reply to Michał BarnaśSet CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM as enabled in chameleon v3 board's defconfig.
---
Changes in v3:
- Update defconfig to use renamed Kconfig
configs/socfpga_chameleonv3_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/socfpga_chameleonv3_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_chameleonv3_480_2" CONFIG_SPL_TEXT_BASE=0xFFE00000 CONFIG_SPL_DRIVERS_MISC=y CONFIG_TARGET_SOCFPGA_CHAMELEONV3=y +CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM=y CONFIG_SPL_FS_FAT=y CONFIG_FIT=y CONFIG_SPL_FIT=y
Signature · 1 line
2.44.0.291.gc1ea87d7ee-goog
RE: [PATCH v3 2/2] chameleonv3: set in defconfig for FPGA to reprogramevery reboot
In reply to Michał BarnaśQuoted 33 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of "Michal Barnas"
Sent: Wednesday, March 20, 2024 2:18 AM
To: [email protected]
Cc: "Michał Barnaś" <[email protected]>; "Marcel Ziswiler" <[email protected]>; "Martyn Welch" <[email protected]>; "Paweł Anikiel" <[email protected]>; "Simon Glass" <[email protected]>; "Svyatoslav Ryhel" <[email protected]>; "Tom Rini" <[email protected]>
Subject: [PATCH v3 2/2] chameleonv3: set in defconfig for FPGA to reprogramevery rebootSet
CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAMas enabled in chameleon v3 board's defconfig.Signed-off-by Michał Barnaś <[email protected]>---
Changes in v3:
- Update defconfig to use renamedKconfigconfigs/socfpga_chameleonv3_defconfig | 1 + 1 file changed, 1 insertion(+)configs/socfpga_chameleonv3_defconfig +0
-0@@ -7,6 +7,7 @@
Quoted 8 lines
CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_chameleonv3_480_2"
CONFIG_SPL_TEXT_BASE=0xFFE00000CONFIG_SPL_DRIVERS_MISC=yCONFIG_TARGET_SOCFPGA_CHAMELEONV3=y
+CONFIG_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM=y
CONFIG_SPL_FS_FAT=y
CONFIG_FIT=y
CONFIG_SPL_FIT=y
Regards
Tien Fong
Re: [PATCH v2 1/2] arm: socfpga: arria10: add option to reprogram the FPGA every reboot
In reply to Marek VasutQuoted 46 lines · Marek Vasut
Quoted 19 lines · Michał Barnaś
Add
Kconfigthat enables FPGA reprogramming with warm boot on Arria 10. This option allows to change the bitstream on the filesystem and apply changes with warm reboot without the need for a power cycle.Signed-off-by Michał Barnaś <[email protected]>---
Changes in v2:
- Rebase on current master brancharch/arm/mach-socfpga/Kconfig | 8 ++++++++ arch/arm/mach-socfpga/spl_a10.c | 8 ++++++++ 2 files changed, 16 insertions(+)arch/arm/mach-socfpga/Kconfig +0
-0arch/arm/mach-socfpga/Kconfig config TARGET_SOCFPGA_ARRIA10 · line 83
Quoted 4 lines
arch/arm/mach-socfpga/Kconfig +1
-0@@ -80,6 +80,14 @@ config TARGET_SOCFPGA_ARRIA10 imply FPGA_SOCFPGA imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAMThis is not TARGET (as in SoC), but a regular config option, so please drop the
TARGET_prefix .Quoted 17 lines
arch/arm/mach-socfpga/Kconfig +7
-0+ bool "Always reprogram Arria 10 FPGA" + depends on TARGET_SOCFPGA_ARRIA10 + help + Arria 10 FPGA is only programmed during the cold boot. + This option forces the FPGA to be reprogrammed every reboot, + allowing to change the bitstream and apply it with warm reboot. + config TARGET_SOCFPGA_CYCLONE5 bool select TARGET_SOCFPGA_GEN5arch/arm/mach-socfpga/spl_a10.c +0
-0@@ -122,7 +122,11 @@ void spl_board_init(void)arch_early_init_r ();
Quoted 8 lines
arch/arm/mach-socfpga/spl_a10.c void spl_board_init(void) · line 129
Quoted 6 lines
arch/arm/mach-socfpga/spl_a10.c +4
-0/* If the full FPGA is already loaded, ie.from EPCQ, config fpga pins */ +#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM +if (is_regular_boot_valid ()) { +#else if (is_fpgamgr_user_mode ()) { +#endif Use
CONFIG_IS_ENABLED()orIS_ENABLED()macro please .
I used the ifdefs because I thought that it would be more readable, but changed as you requested.
Thank you for your response.
PATCH v2 2/2 chameleonv3: set in defconfig for FPGA to reprogram every reboot
In reply to Michał BarnaśSet CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM as enabled in chameleon v3 board's defconfig.
---
(no changes since v1)
configs/socfpga_chameleonv3_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/socfpga_chameleonv3_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_chameleonv3_480_2" CONFIG_SPL_TEXT_BASE=0xFFE00000 CONFIG_SPL_DRIVERS_MISC=y CONFIG_TARGET_SOCFPGA_CHAMELEONV3=y +CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM=y CONFIG_SPL_FS_FAT=y CONFIG_FIT=y CONFIG_SPL_FIT=y
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
PATCH 2/2 chameleonv3: set in defconfig for FPGA to reprogram every reboot
In reply to Michał BarnaśSet CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM as enabled in chameleon v3 board's defconfig.
---
configs/socfpga_chameleonv3_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/socfpga_chameleonv3_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_chameleonv3_480_2" CONFIG_SPL_TEXT_BASE=0xFFE00000 CONFIG_SPL_DRIVERS_MISC=y CONFIG_TARGET_SOCFPGA_CHAMELEONV3=y +CONFIG_TARGET_SOCFPGA_ARRIA10_ALWAYS_REPROGRAM=y CONFIG_SPL_FS_FAT=y CONFIG_FIT=y CONFIG_SPL_FIT=y
Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
Dinh Nguyen
maintainerQuoted 8 lines · Michał Barnaś
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds
Kconfigthat allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.
If we want to enable the reprogramming on every boot, would it make sense to just do it and not even bother with the Kconfig option?
Dinh
Quoted 13 lines · Dinh Nguyen
Quoted 8 lines · Michał Barnaś
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds
Kconfigthat allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.
Quoted 4 lines
If we want to enable the reprogramming on every boot, would it make sense to just do it and not even bother with the
Kconfigoption?Dinh
The FPGA programming part takes quite a long time, so it increases the reboot time significantly.
I don't think that everyone needs the reprogramming to happen every time. We need that
because our boards are closed in the lab and the power is not easily accessible, so in case of
update to the bitstream, we should be able to remotely update it with a pure warm reboot.
So I thought that this should be set by Kconfig to not bother other users with longer reboot times.
Michał
Quoted 44 lines
-----Original Message-----
From: Michał Barnaś <[email protected]>
Sent: Thursday, February 29, 2024 9:49 PM
To: Dinh Nguyen <[email protected]>
Cc: [email protected]; Marcel Ziswiler <[email protected]>; Marek Vasut <[email protected]>; Martyn Welch <[email protected]>; Paweł Anikiel <[email protected]>; Simon Glass <[email protected]>; Simon Goldschmidt <[email protected]>; Svyatoslav Ryhel <[email protected]>; Chee, Tien Fong <[email protected]>; Tom Rini <[email protected]>
Subject: Re: [PATCH 0/2] arm: socfpga: arria10: allow to reprogram FPGA with warm rebootQuoted 13 lines · Dinh Nguyen
Quoted 8 lines · Michał Barnaś
By default, the board requires power cycle (cold boot) to program the FPGA with bitstream. This change adds
Kconfigthat allows to enable reprogramming the FPGA with every boot. This makes the update process of the bitstream on the filesystem to be applied with simple system reboot.Quoted 4 lines
If we want to enable the reprogramming on every boot, would it make sense to just do it and not even bother with the
Kconfigoption?Dinh
The FPGA programming part takes quite a long time, so it increases the reboot time significantly.
I don't think that everyone needs the reprogramming to happen every time. We need that because our boards are closed in the lab and the power is not easily accessible, so in case of update to the bitstream, we should be able to remotely update it with a pure warm reboot.
So I thought that this should be set byKconfigto not bother other users with longer reboot times.
Quoted 1 line
Michał
Reprogram should be avoided when FPGA already in user mode, this is for FPGA boot first use case.
Full reprogram is slow in SPL, because very small buffer in this small OCRAM can only be used to process the full RBF.
Since this is an optional configuration, I don't see any issue with these changes.
Tien Fong