From 046e86e06ae695c54e01fa646ee84e663a8e5bdc 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 cb26fc8d3e..c82c67e310 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -383,9 +383,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))