From 8a46938524515b2d0ef0dd047a72d2a6d55fb761 Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Thu, 13 Oct 2022 00:49:31 -0600 Subject: [PATCH] boot/uboot/uboot.mk: add pmufw.elf support 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 in addition to still supporting pmufw.bin binaries built by the zynqmp-pmufw-builder. https://github.com/Xilinx/ubuntu-firmware/tree/v2022.1_22.04_1/xlnx-firmware Signed-off-by: Neal Frager Reviewed-by: Luca Ceresoli Signed-off-by: Peter Korsgaard (cherry picked from commit d07e6b7071cf9496aa67b2459d0574bc5ffd9c46) Signed-off-by: Peter Korsgaard --- boot/uboot/uboot.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a9f9b1bf16..0439ec5e4b 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -391,9 +391,12 @@ UBOOT_ZYNQMP_PMUFW_PATH = $(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)) 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)) define UBOOT_ZYNQMP_KCONFIG_PMUFW - $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_ZYNQMP_PMUFW_PATH)") + $(if $(filter %.elf,$(UBOOT_ZYNQMP_PMUFW_PATH)), + 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))