[PATCH v1] Improve handosff prepare on SoCFPGA

Chee, Tien Fong tien.fong.chee at altera.com
Mon Apr 20 07:02:30 CEST 2026


Hi Brian,


On 12/4/2026 1:27 am, Brian Sune wrote:
> There are some cases that the Python scripts
> are run and the qts files are not replaced.
> Make sure qts folder h files are removed before
> handoff script runs.
>
> Signed-off-by: Brian Sune<briansune at gmail.com>
> ---
>   arch/arm/mach-socfpga/config.mk | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-socfpga/config.mk b/arch/arm/mach-socfpga/config.mk
> index 1ca1d33cb16..d9d9d4f2373 100644
> --- a/arch/arm/mach-socfpga/config.mk
> +++ b/arch/arm/mach-socfpga/config.mk
> @@ -43,6 +43,11 @@ socfpga_g5_handoff_prepare:
>   			exit 0; \
>   		fi; \
>   		echo "[INFO] Found hiof file: $$HIOF_FILE"; \
> +		echo "[INFO] Clean old BSP files..."; \
> +		if ls "$$BOARD_DIR/qts"/*.h >/dev/null 2>&1; then \
> +			rm -r "$$BOARD_DIR/qts"/*.h; \
> +			echo "[INFO] Removed old BSP files..."; \
> +		fi; \


Thanks for tackling stale qts/*.h when the BSP generator does not 
refresh outputs.

Concern: the series deletes existing board/.../qts/*.h before running 
cv_bsp_generator.py, while the recipe still continues on generator 
failure (|| … continuing). If Python fails or produces no headers, the 
tree can be left without the previous QTS headers but the build still 
proceeds, that is a regression risk.

Nits: rm -r …/*.h on plain files is unusual; rm -f is clearer.

Suggestion: generate into a temporary directory (e.g. mktemp -d under 
qts/), and only replace existing *.h after a successful run (optionally 
copy the old set to qts/.handoff_backup.<timestamp>/ first for diff). 
That keeps the “stale vs new” comparison you want without breaking 
builds when generation fails.

Best regards,

Tien Fong


More information about the U-Boot mailing list