[Buildroot] [PATCH v1 1/1] boot/uboot/uboot.mk: add pmufw.elf support

Neal Frager neal.frager at amd.com
Wed Oct 12 12:36:51 UTC 2022


This patch adds support for zynqmp pmufw.elf files.
It will allow buildroot to use pmufw.elf binaries directly
from the Xilinx git repository built by petalinux.

https://github.com/Xilinx/ubuntu-firmware/tree/v2022.1_22.04_1/xlnx-firmware

It will solve the problem of the pmufw built by the
zynqmp-pmufw-builder where soft resets crash.  Details of the issue
can be found here:

https://lore.kernel.org/buildroot/87ilqccu3k.fsf@dell.be.48ers.dk/

Instead of using a pmufw binary built by the zynqmp-pmufw-builder, this patch
enables a pmufw binary built by petalinux to solve the issue.

Signed-off-by: Neal Frager <neal.frager at amd.com>
---
 boot/uboot/uboot.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a9f9b1bf16..136cd9e306 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -392,8 +392,17 @@ else ifneq ($(UBOOT_ZYNQMP_PMUFW),)
 UBOOT_ZYNQMP_PMUFW_PATH = $(shell readlink -f $(UBOOT_ZYNQMP_PMUFW))
 endif
 
+UBOOT_ZYNQMP_PMUFW_BASENAME=$(basename $(UBOOT_ZYNQMP_PMUFW_PATH))
+UBOOT_ZYNQMP_PMUFW_SUFFIX=$(suffix $(UBOOT_ZYNQMP_PMUFW_PATH))
+
+ifeq ($(UBOOT_ZYNQMP_PMUFW_SUFFIX),.elf)
+UBOOT_ZYNQMP_PMUFW_CONVERT=y
+endif
+
 define UBOOT_ZYNQMP_KCONFIG_PMUFW
-	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_ZYNQMP_PMUFW_PATH)")
+	$(if $(UBOOT_ZYNQMP_PMUFW_CONVERT),
+		$(CROSS_COMPILE)objcopy -O binary -I elf32-little $(UBOOT_ZYNQMP_PMUFW_BASENAME).elf $(UBOOT_ZYNQMP_PMUFW_BASENAME).bin)
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_ZYNQMP_PMUFW_BASENAME).bin")
 endef
 
 UBOOT_ZYNQMP_PM_CFG = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PM_CFG))
-- 
2.17.1




More information about the buildroot mailing list