diff mbox series

[v4,1/1] boot/uboot/uboot.mk: add pmufw.elf support

Message ID 20221013064931.60174-1-neal.frager@amd.com
State Accepted
Headers show
Series [v4,1/1] boot/uboot/uboot.mk: add pmufw.elf support | expand

Commit Message

Neal Frager Oct. 13, 2022, 6:49 a.m. UTC
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 <neal.frager@amd.com>
---
V1->V2:
  - corrected objcopy instruction for converting elf to bin
V2->V3:
  - removed unnecessary spaces
  - simplified if statement to check for a pmufw.elf file
V3->V4:
  - added spaces around = sign of UBOOT_ZYNQMP_PMUFW_BASENAME definition
---
 boot/uboot/uboot.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Luca Ceresoli Oct. 13, 2022, 1:18 p.m. UTC | #1
Hello Neal,

On Thu, 13 Oct 2022 00:49:31 -0600
Neal Frager <neal.frager@amd.com> wrote:

> 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 <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

Thank you very much for working on a solution to this unpleasant
situation. I still would like to address it, but spare time is not
easily available... however I'm always happy to received patches for
zynqmp-pmufw-builder! ;-)
yegorslists--- via buildroot Oct. 13, 2022, 1:54 p.m. UTC | #2
Hello Luca,

> 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-fi
> rmware
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

> Thank you very much for working on a solution to this unpleasant situation. I still would like to address it, but spare time is not easily available... however I'm always happy to received patches for zynqmp-pmufw-builder! ;-)

Thank you for your understanding.  As you can see with this patch, pmufw.bin files are still accepted.  The moment zynqmp-pmufw-builder is fixed, developers can use it with buildroot again.

I understand the lack of spare time.  If I ever get some, I will take a closer look at how to patch the zynqmp-pmufw-builder microblaze compiler.

Best regards,
Neal Frager
AMD
Peter Korsgaard Oct. 15, 2022, 4:41 p.m. UTC | #3
>>>>> "Neal" == Neal Frager <neal.frager@amd.com> writes:

 > 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 <neal.frager@amd.com>
 > ---
 V1-> V2:
 >   - corrected objcopy instruction for converting elf to bin
 V2-> V3:
 >   - removed unnecessary spaces
 >   - simplified if statement to check for a pmufw.elf file
 V3-> V4:
 >   - added spaces around = sign of UBOOT_ZYNQMP_PMUFW_BASENAME definition

Committed, thanks.
Peter Korsgaard Nov. 2, 2022, 6:53 a.m. UTC | #4
>>>>> "Neal" == Neal Frager <neal.frager@amd.com> writes:

 > 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 <neal.frager@amd.com>
 > ---
 > V1-> V2:
 >   - corrected objcopy instruction for converting elf to bin
 > V2-> V3:
 >   - removed unnecessary spaces
 >   - simplified if statement to check for a pmufw.elf file
 > V3-> V4:
 >   - added spaces around = sign of UBOOT_ZYNQMP_PMUFW_BASENAME definition

Committed to 2022.08.x and 2022.02.x, thanks.
diff mbox series

Patch

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))