All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  3:11 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  3:11 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "{HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.

Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Brian Sune <briansune@gmail.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  3:30 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  3:30 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.

Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>

Signed-off-by: Brian Sune <briansune@gmail.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  3:35 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  3:35 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v5 -> v6:
 - Clean HANDOFF_KEEP comments.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.

Signed-off-by: Brian Sune <briansune@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  3:48 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  3:48 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v5 -> v6:
 - Clean HANDOFF_KEEP comments.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes: - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.
Signed-off-by: Brian Sune <briansune@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  4:04 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  4:04 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v5 -> v6:
 - Clean HANDOFF_KEEP comments.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Brian Sune <briansune@gmail.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  4:25 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-04-23  4:25 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v5 -> v6:
 - Clean HANDOFF_KEEP comments.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Brian Sune <briansune@gmail.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-04-23  4:28 Brian Sune
  2026-04-28 14:04 ` Simon Glass
  0 siblings, 1 reply; 17+ messages in thread
From: Brian Sune @ 2026-04-23  4:28 UTC (permalink / raw)
  To: u-boot, Tom Rini, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Changelog v5 -> v6:
 - Clean HANDOFF_KEEP comments.

Changelog v4 -> v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ]
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk

Changes:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.
Signed-off-by: Brian Sune <briansune@gmail.com>
---
 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-23  4:28 Brian Sune
@ 2026-04-28 14:04 ` Simon Glass
  2026-04-28 14:33   ` Sune Brian
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2026-04-28 14:04 UTC (permalink / raw)
  To: briansune; +Cc: u-boot, Tom Rini, Chee Tien Fong, Simon Glass

Hi Brian,

On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> Improve handoff prepare on SoCFPGA
>
> Ensure qts folder header files are properly updated by isolating
> the Python execution environment. This prevents partial or failed
> script runs from corrupting the target directory.
>
> Changelog v5 -> v6:
>  - Clean HANDOFF_KEEP comments.
>
> Changelog v4 -> v5:
>  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
>  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
>
> Changes:
>  - Implement a temp folder for Python script execution.
>  - Clean temp folder automatically despite execution failures.
>  - Gate the file replacement process on the successful exit of
>    the Python scripts.
>  - Execute the replacement (with or without keep) only upon script
>    success via the NEW HANDOFF_KEEP=xxx variable.
> [...]
>
> arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
>  1 file changed, 36 insertions(+), 3 deletions(-)

The per-version changelogs belong below the '---' separator, not in
the commit body. Also U-Boot convention is 'Changes in vN:' rather
than 'Changelog vN -> vN+1:'.

You could try using 'patman' which will get this right for you automatically:

https://docs.u-boot.org/en/latest/develop/patman.html

I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
right one?

Regards,
Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-28 14:04 ` Simon Glass
@ 2026-04-28 14:33   ` Sune Brian
  2026-04-29 14:21     ` Simon Glass
  0 siblings, 1 reply; 17+ messages in thread
From: Sune Brian @ 2026-04-28 14:33 UTC (permalink / raw)
  To: Simon Glass; +Cc: u-boot, Chee Tien Fong, Tom Rini

On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Brian,
>
> On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > Improve handoff prepare on SoCFPGA
> >
> > Ensure qts folder header files are properly updated by isolating
> > the Python execution environment. This prevents partial or failed
> > script runs from corrupting the target directory.
> >
> > Changelog v5 -> v6:
> >  - Clean HANDOFF_KEEP comments.
> >
> > Changelog v4 -> v5:
> >  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> >  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> >
> > Changes:
> >  - Implement a temp folder for Python script execution.
> >  - Clean temp folder automatically despite execution failures.
> >  - Gate the file replacement process on the successful exit of
> >    the Python scripts.
> >  - Execute the replacement (with or without keep) only upon script
> >    success via the NEW HANDOFF_KEEP=xxx variable.
> > [...]
> >
> > arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 36 insertions(+), 3 deletions(-)
>


Dear Simon,

B.C. the server is down and I don't expect Google to have an auto fail
mailing recovery.

> I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> right one?

I will try to respond to this email as politely as possible.
Please reference from "patchwork.ozlabs.org" list.

> The per-version changelogs belong below the '---' separator, not in
> the commit body. Also U-Boot convention is 'Changes in vN:' rather
> than 'Changelog vN -> vN+1:'.
>
> You could try using 'patman' which will get this right for you automatically:
>
> https://docs.u-boot.org/en/latest/develop/patman.html
>

1) I only do basic software
2) I used ./script/checkpatch.pl There are no errors, warnings etc.
3) There is nothing to do with the patch itself either the software
nor the file itself.
4) I am not too familiar with patman
5) There are many better things to do rather than complaining about
the patch headers.

So forgive me I really don't give a damn on whatever the header requirements.
If you feel this is not passing the patch standard simply reject or
label all patches to
"Changes Requested".

With all respect,
Brian

>
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-28 14:33   ` Sune Brian
@ 2026-04-29 14:21     ` Simon Glass
  2026-04-29 14:34       ` Sune Brian
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2026-04-29 14:21 UTC (permalink / raw)
  To: Sune Brian; +Cc: u-boot, Chee Tien Fong, Tom Rini

Hi Brian,

On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
>
> On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Brian,
> >
> > On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > > Improve handoff prepare on SoCFPGA
> > >
> > > Ensure qts folder header files are properly updated by isolating
> > > the Python execution environment. This prevents partial or failed
> > > script runs from corrupting the target directory.
> > >
> > > Changelog v5 -> v6:
> > >  - Clean HANDOFF_KEEP comments.
> > >
> > > Changelog v4 -> v5:
> > >  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> > >  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> > >
> > > Changes:
> > >  - Implement a temp folder for Python script execution.
> > >  - Clean temp folder automatically despite execution failures.
> > >  - Gate the file replacement process on the successful exit of
> > >    the Python scripts.
> > >  - Execute the replacement (with or without keep) only upon script
> > >    success via the NEW HANDOFF_KEEP=xxx variable.
> > > [...]
> > >
> > > arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> > >  1 file changed, 36 insertions(+), 3 deletions(-)
> >
>
>
> Dear Simon,
>
> B.C. the server is down and I don't expect Google to have an auto fail
> mailing recovery.
>
> > I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> > right one?
>
> I will try to respond to this email as politely as possible.
> Please reference from "patchwork.ozlabs.org" list.
>
> > The per-version changelogs belong below the '---' separator, not in
> > the commit body. Also U-Boot convention is 'Changes in vN:' rather
> > than 'Changelog vN -> vN+1:'.
> >
> > You could try using 'patman' which will get this right for you automatically:
> >
> > https://docs.u-boot.org/en/latest/develop/patman.html
> >
>
> 1) I only do basic software
> 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> 3) There is nothing to do with the patch itself either the software
> nor the file itself.
> 4) I am not too familiar with patman
> 5) There are many better things to do rather than complaining about
> the patch headers.
>
> So forgive me I really don't give a damn on whatever the header requirements.
> If you feel this is not passing the patch standard simply reject or
> label all patches to
> "Changes Requested".

That's up to whoever applies this patch. I am just a reviewer :-)

The reason for the formatting rules is mostly so that maintainers can
apply them without manually redoing the patch, etc.

There is also this which might help (although you might not want more reading):

https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions

Regards,
Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-29 14:21     ` Simon Glass
@ 2026-04-29 14:34       ` Sune Brian
  2026-04-29 14:44         ` Simon Glass
  0 siblings, 1 reply; 17+ messages in thread
From: Sune Brian @ 2026-04-29 14:34 UTC (permalink / raw)
  To: Simon Glass; +Cc: u-boot, Chee Tien Fong, Tom Rini

On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Brian,
>
> On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> >
> > On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Brian,
> > >
> > > On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > > > Improve handoff prepare on SoCFPGA
> > > >
> > > > Ensure qts folder header files are properly updated by isolating
> > > > the Python execution environment. This prevents partial or failed
> > > > script runs from corrupting the target directory.
> > > >
> > > > Changelog v5 -> v6:
> > > >  - Clean HANDOFF_KEEP comments.
> > > >
> > > > Changelog v4 -> v5:
> > > >  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> > > >  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> > > >
> > > > Changes:
> > > >  - Implement a temp folder for Python script execution.
> > > >  - Clean temp folder automatically despite execution failures.
> > > >  - Gate the file replacement process on the successful exit of
> > > >    the Python scripts.
> > > >  - Execute the replacement (with or without keep) only upon script
> > > >    success via the NEW HANDOFF_KEEP=xxx variable.
> > > > [...]
> > > >
> > > > arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> > > >  1 file changed, 36 insertions(+), 3 deletions(-)
> > >
> >
> >
> > Dear Simon,
> >
> > B.C. the server is down and I don't expect Google to have an auto fail
> > mailing recovery.
> >
> > > I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> > > right one?
> >
> > I will try to respond to this email as politely as possible.
> > Please reference from "patchwork.ozlabs.org" list.
> >
> > > The per-version changelogs belong below the '---' separator, not in
> > > the commit body. Also U-Boot convention is 'Changes in vN:' rather
> > > than 'Changelog vN -> vN+1:'.
> > >
> > > You could try using 'patman' which will get this right for you automatically:
> > >
> > > https://docs.u-boot.org/en/latest/develop/patman.html
> > >
> >
> > 1) I only do basic software
> > 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> > 3) There is nothing to do with the patch itself either the software
> > nor the file itself.
> > 4) I am not too familiar with patman
> > 5) There are many better things to do rather than complaining about
> > the patch headers.
> >
> > So forgive me I really don't give a damn on whatever the header requirements.
> > If you feel this is not passing the patch standard simply reject or
> > label all patches to
> > "Changes Requested".
>
> That's up to whoever applies this patch. I am just a reviewer :-)

Hi Simon,

I am going to ignore all your mail in the future.
So review whatever you like, don't care.
There are many patch not following whatever rules or guidelines you
mentioned.
Just review those as well. What a waste of time on your emails.

As politely as possible!!!
Brian

>
> The reason for the formatting rules is mostly so that maintainers can
> apply them without manually redoing the patch, etc.
>
> There is also this which might help (although you might not want more reading):
>
> https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions
>
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-29 14:34       ` Sune Brian
@ 2026-04-29 14:44         ` Simon Glass
  2026-04-29 17:14           ` Simon Glass
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2026-04-29 14:44 UTC (permalink / raw)
  To: Sune Brian; +Cc: u-boot, Chee Tien Fong, Tom Rini

Hi Sune,

On Wed, 29 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
>
> On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Brian,
> >
> > On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> > >
> > > On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > Hi Brian,
> > > >
> > > > On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > > > > Improve handoff prepare on SoCFPGA
> > > > >
> > > > > Ensure qts folder header files are properly updated by isolating
> > > > > the Python execution environment. This prevents partial or failed
> > > > > script runs from corrupting the target directory.
> > > > >
> > > > > Changelog v5 -> v6:
> > > > >  - Clean HANDOFF_KEEP comments.
> > > > >
> > > > > Changelog v4 -> v5:
> > > > >  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> > > > >  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> > > > >
> > > > > Changes:
> > > > >  - Implement a temp folder for Python script execution.
> > > > >  - Clean temp folder automatically despite execution failures.
> > > > >  - Gate the file replacement process on the successful exit of
> > > > >    the Python scripts.
> > > > >  - Execute the replacement (with or without keep) only upon script
> > > > >    success via the NEW HANDOFF_KEEP=xxx variable.
> > > > > [...]
> > > > >
> > > > > arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> > > > >  1 file changed, 36 insertions(+), 3 deletions(-)
> > > >
> > >
> > >
> > > Dear Simon,
> > >
> > > B.C. the server is down and I don't expect Google to have an auto fail
> > > mailing recovery.
> > >
> > > > I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> > > > right one?
> > >
> > > I will try to respond to this email as politely as possible.
> > > Please reference from "patchwork.ozlabs.org" list.
> > >
> > > > The per-version changelogs belong below the '---' separator, not in
> > > > the commit body. Also U-Boot convention is 'Changes in vN:' rather
> > > > than 'Changelog vN -> vN+1:'.
> > > >
> > > > You could try using 'patman' which will get this right for you automatically:
> > > >
> > > > https://docs.u-boot.org/en/latest/develop/patman.html
> > > >
> > >
> > > 1) I only do basic software
> > > 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> > > 3) There is nothing to do with the patch itself either the software
> > > nor the file itself.
> > > 4) I am not too familiar with patman
> > > 5) There are many better things to do rather than complaining about
> > > the patch headers.
> > >
> > > So forgive me I really don't give a damn on whatever the header requirements.
> > > If you feel this is not passing the patch standard simply reject or
> > > label all patches to
> > > "Changes Requested".
> >
> > That's up to whoever applies this patch. I am just a reviewer :-)
>
> Hi Simon,
>
> I am going to ignore all your mail in the future.
> So review whatever you like, don't care.
> There are many patch not following whatever rules or guidelines you
> mentioned.
> Just review those as well. What a waste of time on your emails.
>
> As politely as possible!!!

Oh, sorry about that and also the server being down, etc.. The
maintainer for SoCFPGA will handle applying this in any case.

> Brian
>
> >
> > The reason for the formatting rules is mostly so that maintainers can
> > apply them without manually redoing the patch, etc.
> >
> > There is also this which might help (although you might not want more reading):
> >
> > https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions

- Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-29 14:44         ` Simon Glass
@ 2026-04-29 17:14           ` Simon Glass
  2026-04-30  4:28             ` Chee, Tien Fong
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2026-04-29 17:14 UTC (permalink / raw)
  To: Sune Brian; +Cc: u-boot, Chee Tien Fong, Tom Rini

On Thu, 30 Apr 2026 at 02:44, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Sune,
>
> On Wed, 29 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> >
> > On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Brian,
> > >
> > > On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> > > >
> > > > On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> > > > >
> > > > > Hi Brian,
> > > > >
> > > > > On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > > > > > Improve handoff prepare on SoCFPGA
> > > > > >
> > > > > > Ensure qts folder header files are properly updated by isolating
> > > > > > the Python execution environment. This prevents partial or failed
> > > > > > script runs from corrupting the target directory.
> > > > > >
> > > > > > Changelog v5 -> v6:
> > > > > >  - Clean HANDOFF_KEEP comments.
> > > > > >
> > > > > > Changelog v4 -> v5:
> > > > > >  - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> > > > > >  - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> > > > > >
> > > > > > Changes:
> > > > > >  - Implement a temp folder for Python script execution.
> > > > > >  - Clean temp folder automatically despite execution failures.
> > > > > >  - Gate the file replacement process on the successful exit of
> > > > > >    the Python scripts.
> > > > > >  - Execute the replacement (with or without keep) only upon script
> > > > > >    success via the NEW HANDOFF_KEEP=xxx variable.
> > > > > > [...]
> > > > > >
> > > > > > arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> > > > > >  1 file changed, 36 insertions(+), 3 deletions(-)
> > > > >
> > > >
> > > >
> > > > Dear Simon,
> > > >
> > > > B.C. the server is down and I don't expect Google to have an auto fail
> > > > mailing recovery.
> > > >
> > > > > I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> > > > > right one?
> > > >
> > > > I will try to respond to this email as politely as possible.
> > > > Please reference from "patchwork.ozlabs.org" list.
> > > >
> > > > > The per-version changelogs belong below the '---' separator, not in
> > > > > the commit body. Also U-Boot convention is 'Changes in vN:' rather
> > > > > than 'Changelog vN -> vN+1:'.
> > > > >
> > > > > You could try using 'patman' which will get this right for you automatically:
> > > > >
> > > > > https://docs.u-boot.org/en/latest/develop/patman.html
> > > > >
> > > >
> > > > 1) I only do basic software
> > > > 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> > > > 3) There is nothing to do with the patch itself either the software
> > > > nor the file itself.
> > > > 4) I am not too familiar with patman
> > > > 5) There are many better things to do rather than complaining about
> > > > the patch headers.
> > > >
> > > > So forgive me I really don't give a damn on whatever the header requirements.
> > > > If you feel this is not passing the patch standard simply reject or
> > > > label all patches to
> > > > "Changes Requested".
> > >
> > > That's up to whoever applies this patch. I am just a reviewer :-)
> >
> > Hi Simon,
> >
> > I am going to ignore all your mail in the future.
> > So review whatever you like, don't care.
> > There are many patch not following whatever rules or guidelines you
> > mentioned.
> > Just review those as well. What a waste of time on your emails.
> >
> > As politely as possible!!!
>
> Oh, sorry about that and also the server being down, etc.. The
> maintainer for SoCFPGA will handle applying this in any case.
>
> > Brian
> >
> > >
> > > The reason for the formatting rules is mostly so that maintainers can
> > > apply them without manually redoing the patch, etc.
> > >
> > > There is also this which might help (although you might not want more reading):
> > >
> > > https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions
>
> - Simon

Since I've reviewed it and we are only talking formatting:

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-29 17:14           ` Simon Glass
@ 2026-04-30  4:28             ` Chee, Tien Fong
  2026-04-30  4:32               ` Sune Brian
  0 siblings, 1 reply; 17+ messages in thread
From: Chee, Tien Fong @ 2026-04-30  4:28 UTC (permalink / raw)
  To: Simon Glass, Sune Brian; +Cc: u-boot, Tom Rini

Hi Brian,


On 30/4/2026 1:14 am, Simon Glass 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.]
>
> On Thu, 30 Apr 2026 at 02:44, Simon Glass <sjg@chromium.org> wrote:
>> Hi Sune,
>>
>> On Wed, 29 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
>>> On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
>>>> Hi Brian,
>>>>
>>>> On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
>>>>> On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
>>>>>> Hi Brian,
>>>>>>
>>>>>> On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
>>>>>>> Improve handoff prepare on SoCFPGA
>>>>>>>
>>>>>>> Ensure qts folder header files are properly updated by isolating
>>>>>>> the Python execution environment. This prevents partial or failed
>>>>>>> script runs from corrupting the target directory.
>>>>>>>
>>>>>>> Changelog v5 -> v6:
>>>>>>>   - Clean HANDOFF_KEEP comments.
>>>>>>>
>>>>>>> Changelog v4 -> v5:
>>>>>>>   - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
>>>>>>>   - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
>>>>>>>
>>>>>>> Changes:
>>>>>>>   - Implement a temp folder for Python script execution.
>>>>>>>   - Clean temp folder automatically despite execution failures.
>>>>>>>   - Gate the file replacement process on the successful exit of
>>>>>>>     the Python scripts.
>>>>>>>   - Execute the replacement (with or without keep) only upon script
>>>>>>>     success via the NEW HANDOFF_KEEP=xxx variable.
>>>>>>> [...]
>>>>>>>
>>>>>>> arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
>>>>>>>   1 file changed, 36 insertions(+), 3 deletions(-)
>>>>>
>>>>> Dear Simon,
>>>>>
>>>>> B.C. the server is down and I don't expect Google to have an auto fail
>>>>> mailing recovery.
>>>>>
>>>>>> I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
>>>>>> right one?
>>>>> I will try to respond to this email as politely as possible.
>>>>> Please reference from "patchwork.ozlabs.org" list.
>>>>>
>>>>>> The per-version changelogs belong below the '---' separator, not in
>>>>>> the commit body. Also U-Boot convention is 'Changes in vN:' rather
>>>>>> than 'Changelog vN -> vN+1:'.
>>>>>>
>>>>>> You could try using 'patman' which will get this right for you automatically:
>>>>>>
>>>>>> https://docs.u-boot.org/en/latest/develop/patman.html
>>>>>>
>>>>> 1) I only do basic software
>>>>> 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
>>>>> 3) There is nothing to do with the patch itself either the software
>>>>> nor the file itself.
>>>>> 4) I am not too familiar with patman
>>>>> 5) There are many better things to do rather than complaining about
>>>>> the patch headers.
>>>>>
>>>>> So forgive me I really don't give a damn on whatever the header requirements.
>>>>> If you feel this is not passing the patch standard simply reject or
>>>>> label all patches to
>>>>> "Changes Requested".
>>>> That's up to whoever applies this patch. I am just a reviewer :-)
>>> Hi Simon,
>>>
>>> I am going to ignore all your mail in the future.
>>> So review whatever you like, don't care.
>>> There are many patch not following whatever rules or guidelines you
>>> mentioned.
>>> Just review those as well. What a waste of time on your emails.
>>>
>>> As politely as possible!!!
>> Oh, sorry about that and also the server being down, etc.. The
>> maintainer for SoCFPGA will handle applying this in any case.
>>
>>> Brian
>>>
>>>> The reason for the formatting rules is mostly so that maintainers can
>>>> apply them without manually redoing the patch, etc.
>>>>
>>>> There is also this which might help (although you might not want more reading):
>>>>
>>>> https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions


I have reviewed this patch.


While the functional change appears reasonable, the patch cannot be
applied in its current form because the commit message and version
history do not follow U-Boot patch submission conventions. Specifically:

- Per-version change history must be placed below the '---' separator.
- The required format is 'Changes in vN:'. Custom formats such as
   'Changelog vN -> vN+1:' are not acceptable.

Maintainers rely on these conventions so patches can be applied directly
using git am without manual rework. I will not correct the commit history
on behalf of the contributor.

Please resend the patch with the commit message formatted correctly.
Further review or application will only proceed once this requirement is
met.

Best regards,

Tien Fong


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-30  4:28             ` Chee, Tien Fong
@ 2026-04-30  4:32               ` Sune Brian
  2026-04-30  4:42                 ` Sune Brian
  0 siblings, 1 reply; 17+ messages in thread
From: Sune Brian @ 2026-04-30  4:32 UTC (permalink / raw)
  To: Chee, Tien Fong; +Cc: Simon Glass, u-boot, Tom Rini

On Thu, Apr 30, 2026 at 12:28 PM Chee, Tien Fong
<tien.fong.chee@altera.com> wrote:
>
> Hi Brian,
>
>
> On 30/4/2026 1:14 am, Simon Glass 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.]
> >
> > On Thu, 30 Apr 2026 at 02:44, Simon Glass <sjg@chromium.org> wrote:
> >> Hi Sune,
> >>
> >> On Wed, 29 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> >>> On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
> >>>> Hi Brian,
> >>>>
> >>>> On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> >>>>> On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> >>>>>> Hi Brian,
> >>>>>>
> >>>>>> On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> >>>>>>> Improve handoff prepare on SoCFPGA
> >>>>>>>
> >>>>>>> Ensure qts folder header files are properly updated by isolating
> >>>>>>> the Python execution environment. This prevents partial or failed
> >>>>>>> script runs from corrupting the target directory.
> >>>>>>>
> >>>>>>> Changelog v5 -> v6:
> >>>>>>>   - Clean HANDOFF_KEEP comments.
> >>>>>>>
> >>>>>>> Changelog v4 -> v5:
> >>>>>>>   - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> >>>>>>>   - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> >>>>>>>
> >>>>>>> Changes:
> >>>>>>>   - Implement a temp folder for Python script execution.
> >>>>>>>   - Clean temp folder automatically despite execution failures.
> >>>>>>>   - Gate the file replacement process on the successful exit of
> >>>>>>>     the Python scripts.
> >>>>>>>   - Execute the replacement (with or without keep) only upon script
> >>>>>>>     success via the NEW HANDOFF_KEEP=xxx variable.
> >>>>>>> [...]
> >>>>>>>
> >>>>>>> arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> >>>>>>>   1 file changed, 36 insertions(+), 3 deletions(-)
> >>>>>
> >>>>> Dear Simon,
> >>>>>
> >>>>> B.C. the server is down and I don't expect Google to have an auto fail
> >>>>> mailing recovery.
> >>>>>
> >>>>>> I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> >>>>>> right one?
> >>>>> I will try to respond to this email as politely as possible.
> >>>>> Please reference from "patchwork.ozlabs.org" list.
> >>>>>
> >>>>>> The per-version changelogs belong below the '---' separator, not in
> >>>>>> the commit body. Also U-Boot convention is 'Changes in vN:' rather
> >>>>>> than 'Changelog vN -> vN+1:'.
> >>>>>>
> >>>>>> You could try using 'patman' which will get this right for you automatically:
> >>>>>>
> >>>>>> https://docs.u-boot.org/en/latest/develop/patman.html
> >>>>>>
> >>>>> 1) I only do basic software
> >>>>> 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> >>>>> 3) There is nothing to do with the patch itself either the software
> >>>>> nor the file itself.
> >>>>> 4) I am not too familiar with patman
> >>>>> 5) There are many better things to do rather than complaining about
> >>>>> the patch headers.
> >>>>>
> >>>>> So forgive me I really don't give a damn on whatever the header requirements.
> >>>>> If you feel this is not passing the patch standard simply reject or
> >>>>> label all patches to
> >>>>> "Changes Requested".
> >>>> That's up to whoever applies this patch. I am just a reviewer :-)
> >>> Hi Simon,
> >>>
> >>> I am going to ignore all your mail in the future.
> >>> So review whatever you like, don't care.
> >>> There are many patch not following whatever rules or guidelines you
> >>> mentioned.
> >>> Just review those as well. What a waste of time on your emails.
> >>>
> >>> As politely as possible!!!
> >> Oh, sorry about that and also the server being down, etc.. The
> >> maintainer for SoCFPGA will handle applying this in any case.
> >>
> >>> Brian
> >>>
> >>>> The reason for the formatting rules is mostly so that maintainers can
> >>>> apply them without manually redoing the patch, etc.
> >>>>
> >>>> There is also this which might help (although you might not want more reading):
> >>>>
> >>>> https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions
>
>
> I have reviewed this patch.
>
>
> While the functional change appears reasonable, the patch cannot be
> applied in its current form because the commit message and version
> history do not follow U-Boot patch submission conventions. Specifically:
>
> - Per-version change history must be placed below the '---' separator.
> - The required format is 'Changes in vN:'. Custom formats such as
>    'Changelog vN -> vN+1:' are not acceptable.
>
> Maintainers rely on these conventions so patches can be applied directly
> using git am without manual rework. I will not correct the commit history
> on behalf of the contributor.
>
> Please resend the patch with the commit message formatted correctly.
> Further review or application will only proceed once this requirement is
> met.

Hi T.F.,

Drop this, I don't care.

Thanks,
Brian

>
> Best regards,
>
> Tien Fong
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v6] Improve handoff prepare on SoCFPGA
  2026-04-30  4:32               ` Sune Brian
@ 2026-04-30  4:42                 ` Sune Brian
  0 siblings, 0 replies; 17+ messages in thread
From: Sune Brian @ 2026-04-30  4:42 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, u-boot, Chee, Tien Fong

On Thu, Apr 30, 2026 at 12:32 PM Sune Brian <briansune@gmail.com> wrote:
>
> On Thu, Apr 30, 2026 at 12:28 PM Chee, Tien Fong
> <tien.fong.chee@altera.com> wrote:
> >
> > Hi Brian,
> >
> >
> > On 30/4/2026 1:14 am, Simon Glass 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.]
> > >
> > > On Thu, 30 Apr 2026 at 02:44, Simon Glass <sjg@chromium.org> wrote:
> > >> Hi Sune,
> > >>
> > >> On Wed, 29 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> > >>> On Wed, Apr 29, 2026 at 10:21 PM Simon Glass <sjg@chromium.org> wrote:
> > >>>> Hi Brian,
> > >>>>
> > >>>> On Tue, 28 Apr 2026 at 08:34, Sune Brian <briansune@gmail.com> wrote:
> > >>>>> On Tue, Apr 28, 2026 at 10:04 PM Simon Glass <sjg@chromium.org> wrote:
> > >>>>>> Hi Brian,
> > >>>>>>
> > >>>>>> On 2026-04-23T04:28:24, Sune Brian <briansune@gmail.com> wrote:
> > >>>>>>> Improve handoff prepare on SoCFPGA
> > >>>>>>>
> > >>>>>>> Ensure qts folder header files are properly updated by isolating
> > >>>>>>> the Python execution environment. This prevents partial or failed
> > >>>>>>> script runs from corrupting the target directory.
> > >>>>>>>
> > >>>>>>> Changelog v5 -> v6:
> > >>>>>>>   - Clean HANDOFF_KEEP comments.
> > >>>>>>>
> > >>>>>>> Changelog v4 -> v5:
> > >>>>>>>   - Change HANDOFF_KEEP condition to if [ '$${HANDOFF_KEEP:-0}' != '0' ]
> > >>>>>>>   - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
> > >>>>>>>
> > >>>>>>> Changes:
> > >>>>>>>   - Implement a temp folder for Python script execution.
> > >>>>>>>   - Clean temp folder automatically despite execution failures.
> > >>>>>>>   - Gate the file replacement process on the successful exit of
> > >>>>>>>     the Python scripts.
> > >>>>>>>   - Execute the replacement (with or without keep) only upon script
> > >>>>>>>     success via the NEW HANDOFF_KEEP=xxx variable.
> > >>>>>>> [...]
> > >>>>>>>
> > >>>>>>> arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++++++++---
> > >>>>>>>   1 file changed, 36 insertions(+), 3 deletions(-)
> > >>>>>
> > >>>>> Dear Simon,
> > >>>>>
> > >>>>> B.C. the server is down and I don't expect Google to have an auto fail
> > >>>>> mailing recovery.
> > >>>>>
> > >>>>>> I see 6 copies of this v6 patch in patchwork, so I wonder if I got the
> > >>>>>> right one?
> > >>>>> I will try to respond to this email as politely as possible.
> > >>>>> Please reference from "patchwork.ozlabs.org" list.
> > >>>>>
> > >>>>>> The per-version changelogs belong below the '---' separator, not in
> > >>>>>> the commit body. Also U-Boot convention is 'Changes in vN:' rather
> > >>>>>> than 'Changelog vN -> vN+1:'.
> > >>>>>>
> > >>>>>> You could try using 'patman' which will get this right for you automatically:
> > >>>>>>
> > >>>>>> https://docs.u-boot.org/en/latest/develop/patman.html
> > >>>>>>
> > >>>>> 1) I only do basic software
> > >>>>> 2) I used ./script/checkpatch.pl There are no errors, warnings etc.
> > >>>>> 3) There is nothing to do with the patch itself either the software
> > >>>>> nor the file itself.
> > >>>>> 4) I am not too familiar with patman
> > >>>>> 5) There are many better things to do rather than complaining about
> > >>>>> the patch headers.
> > >>>>>
> > >>>>> So forgive me I really don't give a damn on whatever the header requirements.
> > >>>>> If you feel this is not passing the patch standard simply reject or
> > >>>>> label all patches to
> > >>>>> "Changes Requested".
> > >>>> That's up to whoever applies this patch. I am just a reviewer :-)
> > >>> Hi Simon,
> > >>>
> > >>> I am going to ignore all your mail in the future.
> > >>> So review whatever you like, don't care.
> > >>> There are many patch not following whatever rules or guidelines you
> > >>> mentioned.
> > >>> Just review those as well. What a waste of time on your emails.
> > >>>
> > >>> As politely as possible!!!
> > >> Oh, sorry about that and also the server being down, etc.. The
> > >> maintainer for SoCFPGA will handle applying this in any case.
> > >>
> > >>> Brian
> > >>>
> > >>>> The reason for the formatting rules is mostly so that maintainers can
> > >>>> apply them without manually redoing the patch, etc.
> > >>>>
> > >>>> There is also this which might help (although you might not want more reading):
> > >>>>
> > >>>> https://docs.u-boot.org/en/latest/develop/sending_patches.html#commit-message-conventions
> >
> >
> > I have reviewed this patch.
> >
> >
> > While the functional change appears reasonable, the patch cannot be
> > applied in its current form because the commit message and version
> > history do not follow U-Boot patch submission conventions. Specifically:
> >
> > - Per-version change history must be placed below the '---' separator.
> > - The required format is 'Changes in vN:'. Custom formats such as
> >    'Changelog vN -> vN+1:' are not acceptable.
> >
> > Maintainers rely on these conventions so patches can be applied directly
> > using git am without manual rework. I will not correct the commit history
> > on behalf of the contributor.
> >
> > Please resend the patch with the commit message formatted correctly.
> > Further review or application will only proceed once this requirement is
> > met.
>
> Hi T.F.,
>
> Drop this, I don't care.
>
> Thanks,
> Brian
>
> >
> > Best regards,
> >
> > Tien Fong
> >

Dear Tom,

Sorry for the trouble.
Please reject this patch series.

Thanks,
Brian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v6] Improve handoff prepare on SoCFPGA
@ 2026-05-14  1:42 Brian Sune
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Sune @ 2026-05-14  1:42 UTC (permalink / raw)
  To: u-boot, Tom Rini, Marek Vasut, Chee Tien Fong, Simon Glass; +Cc: Brian Sune

Ensure qts folder header files are properly updated by isolating
the Python execution environment. This prevents partial or failed
script runs from corrupting the target directory.

Signed-off-by: Brian Sune <briansune@gmail.com>
---
Changes for v6:
 - Clean HANDOFF_KEEP comments.
Changes for v5:
 - Change HANDOFF_KEEP condition to if [ "$${HANDOFF_KEEP:-0}" != "0" ];
 - Add HANDOFF_KEEP and HANDOFF_PATH comments in config.mk
Changes for v4:
 - Move trap 'rm -rf "$$TEMP_DIR"' EXIT; after temp folder create
 - Change HANDOFF_KEEP condition to
   if [ -n "$${HANDOFF_KEEP+x}" ] && [ "$${HANDOFF_KEEP:-1}" != "0" ];
   HANDOFF_KEEP=0 from rename to discard old header files
Changes for v3:
 - Implement a temp folder for Python script execution.
 - Clean temp folder automatically despite execution failures.
 - Gate the file replacement process on the successful exit of
   the Python scripts.
 - Execute the replacement (with or without keep) only upon script
   success via the NEW HANDOFF_KEEP=xxx variable.
 - Rename old files to .h.handoff_backup.<timestamp> when the
   keep option is selected.
Changes for v2:
 - Add handoff Python script execution check
Changes for v1:
 - Implement basic remove and replace header files
 
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>

 arch/arm/mach-socfpga/config.mk | 39 ++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
index 1ca1d33cb16..f341aaaea56 100644
--- a/arch/arm/mach-socfpga/config.mk
+++ b/arch/arm/mach-socfpga/config.mk
@@ -1,6 +1,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Brian Sune <briansune@gmail.com>
+#
+# HANDOFF_PATH
+# ------------
+# Unset - Board path where qts locates and "hps_isw_handoff" should be placed.
+# Set   - Custom path points to "hps_isw_handoff" folder.
+#
+# HANDOFF_KEEP
+# ------------
+# Unset	- Clean header files.
+# Set	- HANDOFF_KEEP= , Clean header files.
+#	  HANDOFF_KEEP=0, Clean header files.
+#	  HANDOFF_KEEP=1, Backup header files and rename to ".h.handoff_backup.<timestamp>".
 
 ifeq ($(CONFIG_ARCH_SOCFPGA_CYCLONE5),y)
 archprepare: socfpga_g5_handoff_prepare
@@ -43,6 +55,27 @@ socfpga_g5_handoff_prepare:
 			exit 0; \
 		fi; \
 		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
-		echo "[INFO] Running BSP generator..."; \
-		python3 $(srctree)/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."
+		echo "[INFO] Try BSP generator..."; \
+		TEMP_DIR=$$(mktemp -dp "$$BOARD_DIR/"); \
+		trap 'rm -rf "$$TEMP_DIR"' EXIT; \
+		if python3 $(srctree)/tools/cv_bsp_generator/cv_bsp_generator.py -i "$$HANDOFF_PATH" -o "$$TEMP_DIR"; then \
+			if [ "$${HANDOFF_KEEP:-0}" != "0" ]; then \
+				echo "[INFO] Preserving old BSP files..."; \
+				TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
+				for f in "$$BOARD_DIR"/qts/*.h; do \
+					[ -e "$$f" ] || continue; \
+					echo "[INFO] $$f -> $${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+					mv "$$f" "$${f%.h}.h.handoff_backup.$$TIMESTAMP"; \
+				done; \
+			else \
+				echo "[INFO] Clean old BSP files..."; \
+				if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
+					rm "$$BOARD_DIR/qts"/*.h; \
+					echo "[INFO] Removed old BSP files..."; \
+				fi; \
+			fi; \
+			mv "$$TEMP_DIR"/*.h "$$BOARD_DIR"/qts; \
+			echo "[INFO] SoCFPGA QTS handoff conversion complete."; \
+		else \
+			echo "[WARN] BSP generator failed!"; \
+		fi;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-05-14  1:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23  3:30 [PATCH v6] Improve handoff prepare on SoCFPGA Brian Sune
  -- strict thread matches above, loose matches on Subject: below --
2026-05-14  1:42 Brian Sune
2026-04-23  4:28 Brian Sune
2026-04-28 14:04 ` Simon Glass
2026-04-28 14:33   ` Sune Brian
2026-04-29 14:21     ` Simon Glass
2026-04-29 14:34       ` Sune Brian
2026-04-29 14:44         ` Simon Glass
2026-04-29 17:14           ` Simon Glass
2026-04-30  4:28             ` Chee, Tien Fong
2026-04-30  4:32               ` Sune Brian
2026-04-30  4:42                 ` Sune Brian
2026-04-23  4:25 Brian Sune
2026-04-23  4:04 Brian Sune
2026-04-23  3:48 Brian Sune
2026-04-23  3:35 Brian Sune
2026-04-23  3:11 Brian Sune

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.