All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Sune <briansune@gmail.com>
To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de
Subject: [PATCH v4] Add make feature support for SoCFPGA Handoff
Date: Tue,  4 Nov 2025 07:44:23 +0800	[thread overview]
Message-ID: <20251103234423.487-1-briansune@gmail.com> (raw)

Introduce socfpga_gen5_handoff_prepare target in U-Boot Makefile
Automatically detects Altera/Intel SoCFPGA boards from .config
Checks for presence of hps_isw_handoff folder and .hiof files
Runs BSP generator script tools/cv_bsp_generator/cv_bsp_generator.py 
if files exist
Non-blocking: prepare continues even if handoff folder or files are missing
HANDOFF_PATH user define: override the auto detection in board folder

Signed-off-by: Brian Sune <briansune@gmail.com>
---
 Makefile | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 32568a6c477..f5efe679259 100644
--- a/Makefile
+++ b/Makefile
@@ -2207,23 +2207,28 @@ socfpga_g5_hanoff_prepare:
 		exit 0; \
 	fi; \
 	BOARD_DIR=board/$$VENDOR/$$BOARD; \
-	HANDOFF_BASE=$$BOARD_DIR/hps_isw_handoff; \
-	if [ ! -d $$HANDOFF_BASE ]; then \
-		exit 0; \
-	fi; \
-	echo "[INFO] Handoff folder found: $$HANDOFF_BASE"; \
-	HANDOFF_FOLDER_NAME=$$(basename "$$(find $$HANDOFF_BASE -mindepth 1 -maxdepth 1 -type d | head -n1)"); \
-	if [ -z "$$HANDOFF_FOLDER_NAME" ]; then \
-		exit 0; \
-	fi; \
-	echo "[INFO] Handoff subfolder found under $$HANDOFF_BASE"; \
-	if [ -f $$HANDOFF_BASE/$$HANDOFF_FOLDER_NAME/$$HANDOFF_FOLDER_NAME.hiof ]; then \
-		echo "[INFO] Found hiof file: $$HANDOFF_BASE/$$HANDOFF_FOLDER_NAME/$$HANDOFF_FOLDER_NAME.hiof"; \
-		echo "[INFO] Using handoff folder: $$HANDOFF_FOLDER_NAME"; \
-		echo "[INFO] Running BSP generator..."; \
+	if [ -n "$$HANDOFF_PATH" ]; then \
+		echo "[INFO] Using manually assigned handoff path: $$HANDOFF_PATH"; \
+	else \
+		HANDOFF_BASE=$$BOARD_DIR/hps_isw_handoff; \
+		if [ ! -d $$HANDOFF_BASE ]; then \
+			exit 0; \
+		fi; \
+		echo "[INFO] Handoff folder found: $$HANDOFF_BASE"; \
+		HANDOFF_FOLDER_NAME=$$(basename "$$(find $$HANDOFF_BASE -mindepth 1 -maxdepth 1 -type d | head -n1)"); \
+		if [ -z "$$HANDOFF_FOLDER_NAME" ]; then \
+			exit 0; \
+		fi; \
+		echo "[INFO] Handoff subfolder found under $$HANDOFF_BASE"; \
+		if [ -f $$HANDOFF_BASE/$$HANDOFF_FOLDER_NAME/$$HANDOFF_FOLDER_NAME.hiof ]; then \
+			echo "[INFO] Found hiof file: $$HANDOFF_BASE/$$HANDOFF_FOLDER_NAME/$$HANDOFF_FOLDER_NAME.hiof"; \
+			echo "[INFO] Using handoff folder: $$HANDOFF_FOLDER_NAME"; \
+			echo "[INFO] Running BSP generator..."; \
+		fi; \
+		HANDOFF_PATH=$$BOARD_DIR/hps_isw_handoff/$$HANDOFF_FOLDER_NAME; \
 	fi; \
 	python3 tools/cv_bsp_generator/cv_bsp_generator.py \
-		-i $$BOARD_DIR/hps_isw_handoff/$$HANDOFF_FOLDER_NAME \
+		-i $$HANDOFF_PATH \
 		-o $$BOARD_DIR/qts || echo "[WARN] BSP generator failed, continuing..."; \
 	echo "[DONE] SoCFPGA QTS handoff conversion complete."
 
-- 
2.25.1


                 reply	other threads:[~2025-11-03 23:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251103234423.487-1-briansune@gmail.com \
    --to=briansune@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.