* [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
@ 2025-11-19 11:16 Brian Sune
2025-11-21 21:40 ` Sune Brian
2025-11-27 3:18 ` Chee, Tien Fong
0 siblings, 2 replies; 7+ messages in thread
From: Brian Sune @ 2025-11-19 11:16 UTC (permalink / raw)
To: Chee Tien Fong, Tom Rini, u-boot
Add optimized Makefile support for SoCFPGA handoff
- Introduce socfpga_g5_handoff_prepare target in U-Boot
arch/arm/mach-socfpga/config.mk
- Users can convert the handoff via make prepare.
- Detects Altera/Intel SoCFPGA boards from .config
- Combines vendor/board extraction into a single shell call
- Checks for hps_isw_handoff folder and .hiof files
- Uses ls -d instead of find for faster folder detection
- Runs BSP generator script only if files exist
- Non-blocking: continues if handoff folder or files are missing
- HANDOFF_PATH user define allows overriding auto-detected folder
- Minimizes subshells and other slow constructs for faster CI
Signed-off-by: Brian Sune <briansune@gmail.com>
---
arch/arm/mach-socfpga/config.mk | 50 +++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 arch/arm/mach-socfpga/config.mk
diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
new file mode 100644
index 00000000000..df1eb909129
--- /dev/null
+++ b/arch/arm/mach-socfpga/config.mk
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Brian Sune <briansune@gmail.com>
+
+ifeq ($(CONFIG_TARGET_SOCFPGA_CYCLONE5),y)
+archprepare: socfpga_g5_handoff_prepare
+else ifeq ($(CONFIG_TARGET_SOCFPGA_ARRIA5),y)
+archprepare: socfpga_g5_handoff_prepare
+endif
+
+socfpga_g5_handoff_prepare:
+ @SOCFAMILY="$(SOCFAMILY)"; \
+ if [ -z "$$SOCFAMILY" ]; then \
+ exit 0; \
+ fi; \
+ echo "[INFO] SOC family detected: $$SOCFAMILY";
+ @set -- $$(awk -F'"' ' \
+ /^CONFIG_SYS_VENDOR=/ {v=$$2} \
+ /^CONFIG_SYS_BOARD=/ {b=$$2} \
+ END {print v, b}' .config); \
+ VENDOR=$$1; \
+ BOARD=$$2; \
+ if [ -z "$$VENDOR" ] || [ -z "$$BOARD" ]; then \
+ exit 0; \
+ fi; \
+ BOARD_DIR=$(src)/board/$$VENDOR/$$BOARD; \
+ if [ "$$HANDOFF_PATH" ]; then \
+ echo "[INFO] Using manually specified handoff folder: $$HANDOFF_PATH"; \
+ else \
+ HANDOFF_BASE=$$BOARD_DIR/hps_isw_handoff; \
+ if [ ! -d "$$HANDOFF_BASE" ]; then \
+ exit 0; \
+ fi; \
+ HANDOFF_PATH=$$(ls -d "$$HANDOFF_BASE"/*/ 2>/dev/null | head -n1); \
+ if [ -z "$$HANDOFF_PATH" ]; then \
+ exit 0; \
+ fi; \
+ echo "[INFO] Auto-detected handoff folder: $$HANDOFF_PATH"; \
+ fi; \
+ HIOF_FILE=$$HANDOFF_PATH/$$(basename $$HANDOFF_PATH).hiof; \
+ if [ ! -f "$$HIOF_FILE" ]; then \
+ echo "[WARN] No .hiof file found in $$HANDOFF_PATH, skipping BSP generation."; \
+ exit 0; \
+ fi; \
+ echo "[INFO] Found hiof file: $$HIOF_FILE"; \
+ echo "[INFO] Running BSP generator..."; \
+ python3 $(src)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$BOARD_DIR/qts" || echo "[WARN] BSP generator failed, continuing..."; \
+ echo "[DONE] SoCFPGA QTS handoff conversion complete."
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-11-19 11:16 [PATCH v8] Add optimized Makefile support for SoCFPGA handoff Brian Sune
@ 2025-11-21 21:40 ` Sune Brian
2025-11-27 2:25 ` Sune Brian
2025-11-27 3:18 ` Chee, Tien Fong
1 sibling, 1 reply; 7+ messages in thread
From: Sune Brian @ 2025-11-21 21:40 UTC (permalink / raw)
To: Chee Tien Fong, Tom Rini, u-boot
> - Introduce socfpga_g5_handoff_prepare target in U-Boot
> arch/arm/mach-socfpga/config.mk
> - Users can convert the handoff via make prepare.
> - Detects Altera/Intel SoCFPGA boards from .config
> - Combines vendor/board extraction into a single shell call
> - Checks for hps_isw_handoff folder and .hiof files
> - Uses ls -d instead of find for faster folder detection
> - Runs BSP generator script only if files exist
> - Non-blocking: continues if handoff folder or files are missing
> - HANDOFF_PATH user define allows overriding auto-detected folder
> - Minimizes subshells and other slow constructs for faster CI
Hi T.F.
Please review the new version.
Thanks,
Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-11-21 21:40 ` Sune Brian
@ 2025-11-27 2:25 ` Sune Brian
0 siblings, 0 replies; 7+ messages in thread
From: Sune Brian @ 2025-11-27 2:25 UTC (permalink / raw)
To: Chee Tien Fong; +Cc: u-boot, Tom Rini
> Hi T.F.
>
> Please review the new version.
> Thanks,
>
> Brian
Still no update on this please to pass this review.
So U-Boot can keep up the prepare setup.
Thanks
Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-11-19 11:16 [PATCH v8] Add optimized Makefile support for SoCFPGA handoff Brian Sune
2025-11-21 21:40 ` Sune Brian
@ 2025-11-27 3:18 ` Chee, Tien Fong
2025-12-01 7:54 ` Chee, Tien Fong
1 sibling, 1 reply; 7+ messages in thread
From: Chee, Tien Fong @ 2025-11-27 3:18 UTC (permalink / raw)
To: Brian Sune, Tom Rini, u-boot
On 19/11/2025 7:16 pm, Brian Sune wrote:
> [CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
>
> Add optimized Makefile support for SoCFPGA handoff
>
> - Introduce socfpga_g5_handoff_prepare target in U-Boot
> arch/arm/mach-socfpga/config.mk
> - Users can convert the handoff via make prepare.
> - Detects Altera/Intel SoCFPGA boards from .config
> - Combines vendor/board extraction into a single shell call
> - Checks for hps_isw_handoff folder and .hiof files
> - Uses ls -d instead of find for faster folder detection
> - Runs BSP generator script only if files exist
> - Non-blocking: continues if handoff folder or files are missing
> - HANDOFF_PATH user define allows overriding auto-detected folder
> - Minimizes subshells and other slow constructs for faster CI
>
> Signed-off-by: Brian Sune <briansune@gmail.com>
> ---
> arch/arm/mach-socfpga/config.mk | 50 +++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 arch/arm/mach-socfpga/config.mk
>
> diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
> new file mode 100644
> index 00000000000..df1eb909129
> --- /dev/null
> +++ b/arch/arm/mach-socfpga/config.mk
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +# Brian Sune <briansune@gmail.com>
> +
> +ifeq ($(CONFIG_TARGET_SOCFPGA_CYCLONE5),y)
> +archprepare: socfpga_g5_handoff_prepare
> +else ifeq ($(CONFIG_TARGET_SOCFPGA_ARRIA5),y)
> +archprepare: socfpga_g5_handoff_prepare
> +endif
> +
> +socfpga_g5_handoff_prepare:
> + @SOCFAMILY="$(SOCFAMILY)"; \
> + if [ -z "$$SOCFAMILY" ]; then \
> + exit 0; \
> + fi; \
> + echo "[INFO] SOC family detected: $$SOCFAMILY";
> + @set -- $$(awk -F'"' ' \
> + /^CONFIG_SYS_VENDOR=/ {v=$$2} \
> + /^CONFIG_SYS_BOARD=/ {b=$$2} \
> + END {print v, b}' .config); \
> + VENDOR=$$1; \
> + BOARD=$$2; \
> + if [ -z "$$VENDOR" ] || [ -z "$$BOARD" ]; then \
> + exit 0; \
> + fi; \
> + BOARD_DIR=$(src)/board/$$VENDOR/$$BOARD; \
> + if [ "$$HANDOFF_PATH" ]; then \
> + echo "[INFO] Using manually specified handoff folder: $$HANDOFF_PATH"; \
> + else \
> + HANDOFF_BASE=$$BOARD_DIR/hps_isw_handoff; \
> + if [ ! -d "$$HANDOFF_BASE" ]; then \
> + exit 0; \
> + fi; \
> + HANDOFF_PATH=$$(ls -d "$$HANDOFF_BASE"/*/ 2>/dev/null | head -n1); \
> + if [ -z "$$HANDOFF_PATH" ]; then \
> + exit 0; \
> + fi; \
> + echo "[INFO] Auto-detected handoff folder: $$HANDOFF_PATH"; \
> + fi; \
> + HIOF_FILE=$$HANDOFF_PATH/$$(basename $$HANDOFF_PATH).hiof; \
> + if [ ! -f "$$HIOF_FILE" ]; then \
> + echo "[WARN] No .hiof file found in $$HANDOFF_PATH, skipping BSP generation."; \
> + exit 0; \
> + fi; \
> + echo "[INFO] Found hiof file: $$HIOF_FILE"; \
> + echo "[INFO] Running BSP generator..."; \
> + python3 $(src)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$BOARD_DIR/qts" || echo "[WARN] BSP generator failed, continuing..."; \
> + echo "[DONE] SoCFPGA QTS handoff conversion complete."
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
Best regards,
Tien Fong
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-11-27 3:18 ` Chee, Tien Fong
@ 2025-12-01 7:54 ` Chee, Tien Fong
2025-12-01 8:44 ` Sune Brian
2025-12-01 9:28 ` Sune Brian
0 siblings, 2 replies; 7+ messages in thread
From: Chee, Tien Fong @ 2025-12-01 7:54 UTC (permalink / raw)
To: Brian Sune, Tom Rini, u-boot
Hi Brian,
On 27/11/2025 11:18 am, Chee, Tien Fong wrote:
>
> On 19/11/2025 7:16 pm, Brian Sune wrote:
>> [CAUTION: This email is from outside your organization. Unless you
>> trust the sender, do not click on links or open attachments as it may
>> be a fraudulent email attempting to steal your information and/or
>> compromise your computer.]
>>
>> Add optimized Makefile support for SoCFPGA handoff
>>
>> - Introduce socfpga_g5_handoff_prepare target in U-Boot
>> arch/arm/mach-socfpga/config.mk
>> - Users can convert the handoff via make prepare.
>> - Detects Altera/Intel SoCFPGA boards from .config
>> - Combines vendor/board extraction into a single shell call
>> - Checks for hps_isw_handoff folder and .hiof files
>> - Uses ls -d instead of find for faster folder detection
>> - Runs BSP generator script only if files exist
>> - Non-blocking: continues if handoff folder or files are missing
>> - HANDOFF_PATH user define allows overriding auto-detected folder
>> - Minimizes subshells and other slow constructs for faster CI
>>
>> Signed-off-by: Brian Sune <briansune@gmail.com>
>> ---
>> arch/arm/mach-socfpga/config.mk | 50 +++++++++++++++++++++++++++++++++
>> 1 file changed, 50 insertions(+)
>> create mode 100644 arch/arm/mach-socfpga/config.mk
>>
>> diff --git a/arch/arm/mach-socfpga/config.mk
>> b/arch/arm/mach-socfpga/config.mk
>> new file mode 100644
>> index 00000000000..df1eb909129
>> --- /dev/null
>> +++ b/arch/arm/mach-socfpga/config.mk
>> @@ -0,0 +1,50 @@
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +# Brian Sune <briansune@gmail.com>
>> +
>> +ifeq ($(CONFIG_TARGET_SOCFPGA_CYCLONE5),y)
>> +archprepare: socfpga_g5_handoff_prepare
>> +else ifeq ($(CONFIG_TARGET_SOCFPGA_ARRIA5),y)
>> +archprepare: socfpga_g5_handoff_prepare
>> +endif
>> +
>> +socfpga_g5_handoff_prepare:
>> + @SOCFAMILY="$(SOCFAMILY)"; \
>> + if [ -z "$$SOCFAMILY" ]; then \
>> + exit 0; \
>> + fi; \
>> + echo "[INFO] SOC family detected: $$SOCFAMILY";
>> + @set -- $$(awk -F'"' ' \
>> + /^CONFIG_SYS_VENDOR=/ {v=$$2} \
>> + /^CONFIG_SYS_BOARD=/ {b=$$2} \
>> + END {print v, b}' .config); \
>> + VENDOR=$$1; \
>> + BOARD=$$2; \
>> + if [ -z "$$VENDOR" ] || [ -z "$$BOARD" ]; then \
>> + exit 0; \
>> + fi; \
>> + BOARD_DIR=$(src)/board/$$VENDOR/$$BOARD; \
>> + if [ "$$HANDOFF_PATH" ]; then \
>> + echo "[INFO] Using manually specified handoff
>> folder: $$HANDOFF_PATH"; \
>> + else \
>> + HANDOFF_BASE=$$BOARD_DIR/hps_isw_handoff; \
>> + if [ ! -d "$$HANDOFF_BASE" ]; then \
>> + exit 0; \
>> + fi; \
>> + HANDOFF_PATH=$$(ls -d "$$HANDOFF_BASE"/*/
>> 2>/dev/null | head -n1); \
>> + if [ -z "$$HANDOFF_PATH" ]; then \
>> + exit 0; \
>> + fi; \
>> + echo "[INFO] Auto-detected handoff folder:
>> $$HANDOFF_PATH"; \
>> + fi; \
>> + HIOF_FILE=$$HANDOFF_PATH/$$(basename
>> $$HANDOFF_PATH).hiof; \
>> + if [ ! -f "$$HIOF_FILE" ]; then \
>> + echo "[WARN] No .hiof file found in
>> $$HANDOFF_PATH, skipping BSP generation."; \
>> + exit 0; \
>> + fi; \
>> + echo "[INFO] Found hiof file: $$HIOF_FILE"; \
>> + echo "[INFO] Running BSP generator..."; \
>> + python3
>> $(src)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH"
>> -o "$$BOARD_DIR/qts" || echo "[WARN] BSP generator failed,
>> continuing..."; \
>> + echo "[DONE] SoCFPGA QTS handoff conversion complete."
I tried applying it onto the latest main branch using:
git am -3 < v8-Add-optimized-Makefile-support-for-SoCFPGA-handoff.patch
However, the application fails with :
Applying: Add optimized Makefile support for SoCFPGA handoff
error: corrupt patch at line 61
error: could not build fake ancestor
Patch failed at 0001 Add optimized Makefile support for SoCFPGA handoff
It looks like the patch file may have been corrupted during generation
or transmission (possibly formatting or mbox header issues).
Could you please resend the patch in clean git format-patch (mbox)
format so that I can apply and submit for PR.
Thanks.
Tien Fong
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-12-01 7:54 ` Chee, Tien Fong
@ 2025-12-01 8:44 ` Sune Brian
2025-12-01 9:28 ` Sune Brian
1 sibling, 0 replies; 7+ messages in thread
From: Sune Brian @ 2025-12-01 8:44 UTC (permalink / raw)
To: Chee, Tien Fong; +Cc: Tom Rini, u-boot
Hi T.F.
> Could you please resend the patch in clean git format-patch (mbox)
> format so that I can apply and submit for PR.
I send it as V9.
Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v8] Add optimized Makefile support for SoCFPGA handoff
2025-12-01 7:54 ` Chee, Tien Fong
2025-12-01 8:44 ` Sune Brian
@ 2025-12-01 9:28 ` Sune Brian
1 sibling, 0 replies; 7+ messages in thread
From: Sune Brian @ 2025-12-01 9:28 UTC (permalink / raw)
To: Chee, Tien Fong, Tom Rini; +Cc: u-boot
Hi T.F. & Tom,
> >> arch/arm/mach-socfpga/config.mk | 50 +++++++++++++++++++++++++++++++++
> >> 1 file changed, 50 insertions(+)
> >> create mode 100644 arch/arm/mach-socfpga/config.mk
> >>
> >> diff --git a/arch/arm/mach-socfpga/config.mk
> >> b/arch/arm/mach-socfpga/config.mk
> >> new file mode 100644
> >> index 00000000000..df1eb909129
> >> --- /dev/null
> >> +++ b/arch/arm/mach-socfpga/config.mk
> >> @@ -0,0 +1,50 @@
> It looks like the patch file may have been corrupted during generation
> or transmission (possibly formatting or mbox header issues).
>
> Could you please resend the patch in clean git format-patch (mbox)
> format so that I can apply and submit for PR.
No thats my mistake on manually modify during V7 to V8 as you
request A10 is not involved in this flow.
I simply removed the lines but for get the fix the # of modification
from 50 to 48.
Sorry for that and script/checkpatch.pl cannot detect that.
Bests,
Brian
Hi Tom,
It is possible the checkpatch.pl can detect patch heading
and sanity?
Thanks,
Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-01 9:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 11:16 [PATCH v8] Add optimized Makefile support for SoCFPGA handoff Brian Sune
2025-11-21 21:40 ` Sune Brian
2025-11-27 2:25 ` Sune Brian
2025-11-27 3:18 ` Chee, Tien Fong
2025-12-01 7:54 ` Chee, Tien Fong
2025-12-01 8:44 ` Sune Brian
2025-12-01 9:28 ` Sune Brian
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.