diff mbox series

[v4,3/4] boot/uboot.mk: new zynqmp pmufw source option

Message ID 20240630134503.3658120-3-neal.frager@amd.com
State New
Headers show
Series [v4,1/4] boot/xilinx-source: new boot package | expand

Commit Message

Neal Frager June 30, 2024, 1:45 p.m. UTC
The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option will enable u-boot to
use the xilinx-source package for building a pmufw.elf that gets included
in the generated boot.bin.

If the BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option is enabled, then the
BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw will
be ignored.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V3:
- no changes
V3->V4:
- it is no longer possible to select both BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
  and BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT
- added a comment that if either BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE or
  BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT is selected, then
  BR2_TARGET_UBOOT_ZYNQMP_PMUFW will be ignored
---
 boot/uboot/Config.in | 22 +++++++++++++++++++++-
 boot/uboot/uboot.mk  |  3 +++
 2 files changed, 24 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index f37040a28a..f18095807e 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -512,9 +512,12 @@  config BR2_TARGET_UBOOT_ZYNQMP
 
 if BR2_TARGET_UBOOT_ZYNQMP
 
+choice
+	bool "prebuilt pmufw.elf or build it from source"
+	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+
 config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT
 	bool "xilinx-prebuilt pmufw.elf"
-	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
 	depends on BR2_TARGET_XILINX_PREBUILT_ZYNQMP || BR2_TARGET_XILINX_PREBUILT_KRIA
 	help
 	  Use xilinx-prebuilt boot package for downloading prebuilt
@@ -525,10 +528,27 @@  config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT
 	  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_SOURCE
+	bool "xilinx-source pmufw.elf build from source"
+	depends on BR2_TARGET_XILINX_SOURCE_ZYNQMP || BR2_TARGET_XILINX_SOURCE_KRIA
+	help
+	  Use xilinx-source boot package for building
+	  zynqmp pmufw.elf from
+	    https://github.com/Xilinx/embeddedsw 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.	  
+
+endchoice
+
+comment "If prebuilt pmufw.elf or build it from source is selected, custom PMU firmware location will be ignored."
+
 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_SOURCE
 	help
 	  Location of a PMU firmware binary.
 
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 19f4cdb557..837cb01f68 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -439,6 +439,9 @@  ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
 ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT),y)
 UBOOT_DEPENDENCIES += xilinx-prebuilt
 UBOOT_ZYNQMP_PMUFW_PATH = $(BINARIES_DIR)/pmufw.elf
+else ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE),y)
+UBOOT_DEPENDENCIES += xilinx-source
+UBOOT_ZYNQMP_PMUFW_PATH = $(BINARIES_DIR)/pmufw.elf
 else
 UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW))