From a5b360e53f864ac10f9a93182f89c8b2bde2797c Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Tue, 21 Jan 2025 10:22:20 +0000 Subject: [PATCH] boot/uboot.mk: new zynqmp pmufw embeddedsw option The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_EMBEDDEDSW option will enable u-boot to use the xilinx-embeddedsw package for building a pmufw.elf that gets included in the generated boot.bin. If the BR2_TARGET_UBOOT_ZYNQMP_PMUFW_EMBEDDEDSW option is enabled, then the BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw from a custom location will be ignored. Signed-off-by: Neal Frager Tested-by: Luca Ceresoli [Luca: Tested on Kria KV260 starter kit] Reviewed-by: Luca Ceresoli Signed-off-by: Julien Olivain --- boot/uboot/Config.in | 44 ++++++++++++++++++++++++++++++++++++++------ boot/uboot/uboot.mk | 5 ++++- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index b6ac2f9380..13d45140eb 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -572,23 +572,55 @@ config BR2_TARGET_UBOOT_ZYNQMP if BR2_TARGET_UBOOT_ZYNQMP -config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT - bool "xilinx-prebuilt pmufw.elf" +choice + prompt "PMUFW origin" + default BR2_TARGET_UBOOT_ZYNQMP_PMUFW_CUSTOM depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG + help + Choose between the following options: + 1) Build from source via xilinx-embeddedsw + 2) Official prebuilt via xilinx-prebuilt + 3) Prebuilt from custom location + + U-Boot build process will generate a boot.bin (to be loaded + by the ZynqMP boot ROM) containing both the U-Boot SPL and + the PMU firmware in the Xilinx-specific boot format. + +config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_EMBEDDEDSW + bool "Build from source via xilinx-embeddedsw" + depends on BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW + help + Use xilinx-embeddedsw boot package for building + zynqmp pmufw.elf from + https://github.com/Xilinx/embeddedsw repo. + +comment "To build from source, xilinx-embeddedsw needs to be enabled with zynqmp_pmufw option." + depends on !BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW + +config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT + bool "Prebuilt via xilinx-prebuilt" depends on BR2_TARGET_XILINX_PREBUILT_ZYNQMP || BR2_TARGET_XILINX_PREBUILT_KRIA help Use xilinx-prebuilt boot package for downloading prebuilt zynqmp pmufw.elf from https://github.com/Xilinx/soc-prebuilt-firmware repo. - U-Boot build process will generate a boot.bin (to be loaded by - by the ZynqMP boot ROM) containing both the U-Boot SPL and the - PMU firmware in the Xilinx-specific boot format. +comment "To use official prebuilt, xilinx-prebuilt needs to be enabled with zynqmp or kria option." + depends on !BR2_TARGET_XILINX_PREBUILT_KRIA + depends on !BR2_TARGET_XILINX_PREBUILT_ZYNQMP + +config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_CUSTOM + bool "Prebuilt from custom location" + help + Location of a PMU firmware binary defined by: + BR2_TARGET_UBOOT_ZYNQMP_PMUFW + +endchoice # PMUFW origin config BR2_TARGET_UBOOT_ZYNQMP_PMUFW string "Custom PMU firmware location" depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG - depends on !BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT + depends on BR2_TARGET_UBOOT_ZYNQMP_PMUFW_CUSTOM help Location of a PMU firmware binary. diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index b3094029e7..cb745413e4 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -453,7 +453,10 @@ endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) -ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT),y) +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_EMBEDDEDSW),y) +UBOOT_DEPENDENCIES += xilinx-embeddedsw +UBOOT_ZYNQMP_PMUFW_PATH = $(BINARIES_DIR)/pmufw.elf +else ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT),y) UBOOT_DEPENDENCIES += xilinx-prebuilt UBOOT_ZYNQMP_PMUFW_PATH = $(BINARIES_DIR)/pmufw.elf else