Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
@ 2024-06-07  9:47 Neal Frager via buildroot
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Neal Frager via buildroot @ 2024-06-07  9:47 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier,
	thomas.petazzoni, Neal Frager, michal.simek, yann.morin.1998

This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
It requires the toolchain-bare-metal package that includes a bare-metal
binutils, gcc and newlib which can be built for the microblaze architecture.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - builds a bare-metal gcc toolchain instead of requiring an external
   microblaze toolchain
V2->V3:
 - corrected custom cflags option
 - added support for xilinx_v2022.2 version
 - added zynqmp-firmware.hash
V3->V4:
 - no changes
V4->V5:
 - reduced all lines to <80 chars
V5->V6:
 - migrated to toolchain-bare-metal-buildroot
V6->V7:
 - removed patch numbers
 - changed dependency to toolchain-bare-metal-buildroot
 - removed hash since version is configurable
V7->V9:
 - no changes
V9->V10:
 - removed patches for supporting versions older than xilinx_v2023.2
V10->V11:
 - set default BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH to
   "microblazeel-xilinx-elf" to avoid stand-alone build failure
V11->V12:
 - replace select BR2_TOOLCHAIN_BARE_METAL_BUILDROOT with depends
 - change variable name for check-package warning
---
 DEVELOPERS                              |  1 +
 boot/Config.in                          |  1 +
 boot/zynqmp-firmware/Config.in          | 25 +++++++++++++++++++
 boot/zynqmp-firmware/zynqmp-firmware.mk | 33 +++++++++++++++++++++++++
 4 files changed, 60 insertions(+)
 create mode 100644 boot/zynqmp-firmware/Config.in
 create mode 100644 boot/zynqmp-firmware/zynqmp-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index cf48e01037..f3ff2cbbd5 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2337,6 +2337,7 @@ N:	Neal Frager <neal.frager@amd.com>
 F:	board/versal/
 F:	board/zynq/
 F:	board/zynqmp/
+F:	boot/zynqmp-firmware/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc702_defconfig
 F:	configs/zynq_zc706_defconfig
diff --git a/boot/Config.in b/boot/Config.in
index 87e1b7c00e..64b1c8c420 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -23,5 +23,6 @@ source "boot/ti-k3-boot-firmware/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
+source "boot/zynqmp-firmware/Config.in"
 
 endmenu
diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
new file mode 100644
index 0000000000..478d58d552
--- /dev/null
+++ b/boot/zynqmp-firmware/Config.in
@@ -0,0 +1,25 @@
+config BR2_TARGET_ZYNQMP_FIRMWARE
+	bool "zynqmp-firmware"
+	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
+	help
+	  This package builds the PMU Firmware application required
+	  to run U-Boot and Linux in the Zynq MPSoC devices.
+
+if BR2_TARGET_ZYNQMP_FIRMWARE
+
+comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
+	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"
+
+config BR2_TARGET_ZYNQMP_FIRMWARE_VERSION
+	string "firmware version"
+	default "xilinx_v2024.1"
+	help
+	  Release version of zynqmp firmware.
+	  Only versions xilinx_v2023.2 and newer are supported.
+
+config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
+	string "custom cflags"
+	help
+	  Adds additional CFLAGS for building zynqmp firmware.
+
+endif # BR2_TARGET_ZYNQMP_FIRMWARE
diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
new file mode 100644
index 0000000000..dafb2dbe55
--- /dev/null
+++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
@@ -0,0 +1,33 @@
+################################################################################
+#
+# zynqmp-firmware
+#
+################################################################################
+
+ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
+ZYNQMP_FIRMWARE_SITE = \
+	$(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
+ZYNQMP_FIRMWARE_LICENSE = MIT
+ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
+ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
+ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
+ZYNQMP_FIRMWARE_DEPENDENCIES = toolchain-bare-metal-buildroot
+
+CUSTOM_CFLAGS = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))
+ZYNQMP_FIRMWARE_CFLAGS = "-Os -flto -ffat-lto-objects $(CUSTOM_CFLAGS)"
+
+define ZYNQMP_FIRMWARE_BUILD_CMDS
+	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
+		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
+		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
+		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
+		CFLAGS=$(ZYNQMP_FIRMWARE_CFLAGS)
+endef
+
+ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf
+
+define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0755 $(ZYNQMP_FIRMWARE) $(BINARIES_DIR)/pmufw.elf
+endef
+
+$(eval $(generic-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option
  2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
@ 2024-06-07  9:47 ` Neal Frager via buildroot
  2024-06-10 14:42   ` Brandon Maier via buildroot
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source Neal Frager via buildroot
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Neal Frager via buildroot @ 2024-06-07  9:47 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier,
	thomas.petazzoni, Neal Frager, michal.simek, yann.morin.1998

The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option will enable u-boot to
use the zynqmp-firmware 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->V2:
 - patch is now backwards compatible for users already using the
   BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw
V2->V3:
 - no changes
V3->V4:
 - BR2_TARGET_UBOOT_ZYNQMP_PMUFW removed when
   BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE selected
V4->V12:
 - no changes
---
 boot/uboot/Config.in | 19 +++++++++++++++++--
 boot/uboot/uboot.mk  |  5 +++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index d0901edc9d..f0c26af25c 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -512,11 +512,26 @@ config BR2_TARGET_UBOOT_ZYNQMP
 
 if BR2_TARGET_UBOOT_ZYNQMP
 
+config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
+	bool "Build zynqmp PMU firmware from source"
+	select BR2_TARGET_ZYNQMP_FIRMWARE
+	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+	help
+	  This option instructs u-boot to build the zynqmp pmufw using
+	  the zynqmp-firmware package.  u-boot will then include this
+	  pmufw.elf in the generated boot.bin.
+
+	  If this option is selected, the BR2_TARGET_UBOOT_ZYNQMP_PMUFW
+	  prebuilt option will be ignored.
+
+	  This feature requires U-Boot >= 2018.07.
+
 config BR2_TARGET_UBOOT_ZYNQMP_PMUFW
-	string "PMU firmware location"
+	string "Pre-built zynqmp PMU firmware location"
 	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+	depends on !BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
 	help
-	  Location of a PMU firmware binary.
+	  Location of a pre-built PMU firmware binary.
 
 	  If not empty, instructs the U-Boot build process to generate
 	  a boot.bin (to be loaded by the ZynqMP boot ROM) containing
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index b9f165f041..18c02a4430 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -436,7 +436,12 @@ endef
 
 ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
 
+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE),y)
+UBOOT_DEPENDENCIES += zynqmp-firmware
+UBOOT_ZYNQMP_PMUFW = $(BINARIES_DIR)/pmufw.elf
+else
 UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW))
+endif #BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
 
 ifneq ($(findstring ://,$(UBOOT_ZYNQMP_PMUFW)),)
 UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW)
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source
  2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2024-06-07  9:47 ` Neal Frager via buildroot
  2024-06-10 14:44   ` Brandon Maier via buildroot
  2024-06-07 10:04 ` [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Frager, Neal via buildroot
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Neal Frager via buildroot @ 2024-06-07  9:47 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier,
	thomas.petazzoni, Neal Frager, michal.simek, yann.morin.1998

This patch migrates the zynqmp config files to use the new
zynqmp-firmware package for building the zynqmp pmufw from source.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V4->V7:
 - no changes
V7->V8:
 - bump to xilinx_v2023.2
V8->V9:
 - add the new zynqmp defconfigs
 - add BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH definition
V9->V10:
 - no changes
V10->V11:
 - BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH is set by zynqmp-firmware
V11->V12:
 - BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH is set in each defconfig
---
 configs/zynqmp_kria_kr260_defconfig | 6 +++++-
 configs/zynqmp_kria_kv260_defconfig | 6 +++++-
 configs/zynqmp_zcu102_defconfig     | 5 ++++-
 configs/zynqmp_zcu104_defconfig     | 5 ++++-
 configs/zynqmp_zcu106_defconfig     | 5 ++++-
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/configs/zynqmp_kria_kr260_defconfig b/configs/zynqmp_kria_kr260_defconfig
index 3bf269ab6b..3f475af882 100644
--- a/configs/zynqmp_kria_kr260_defconfig
+++ b/configs/zynqmp_kria_kr260_defconfig
@@ -31,10 +31,14 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/kr260-kria/pmufw.elf"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/kria/kr260/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
+BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS="-DK26_SOM"
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/zynqmp_kria_kv260_defconfig b/configs/zynqmp_kria_kv260_defconfig
index 7b402e032c..313b324a13 100644
--- a/configs/zynqmp_kria_kv260_defconfig
+++ b/configs/zynqmp_kria_kv260_defconfig
@@ -31,10 +31,14 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/kv260-kria/pmufw.elf"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/kria/kv260/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
+BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS="-DK26_SOM"
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/zynqmp_zcu102_defconfig b/configs/zynqmp_zcu102_defconfig
index f40002f6d9..302ad1394e 100644
--- a/configs/zynqmp_zcu102_defconfig
+++ b/configs/zynqmp_zcu102_defconfig
@@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu102-zynqmp/pmufw.elf"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu102/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/zynqmp_zcu104_defconfig b/configs/zynqmp_zcu104_defconfig
index ef9c9bad49..059858fff6 100644
--- a/configs/zynqmp_zcu104_defconfig
+++ b/configs/zynqmp_zcu104_defconfig
@@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu104-zynqmp/pmufw.elf"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu104/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/zynqmp_zcu106_defconfig b/configs/zynqmp_zcu106_defconfig
index 07c595436f..39dd5c8ab3 100644
--- a/configs/zynqmp_zcu106_defconfig
+++ b/configs/zynqmp_zcu106_defconfig
@@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu106-zynqmp/pmufw.elf"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu106/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
+BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
  2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source Neal Frager via buildroot
@ 2024-06-07 10:04 ` Frager, Neal via buildroot
  2024-06-07 11:22 ` Yann E. MORIN
  2024-06-10 13:12 ` Brandon Maier via buildroot
  4 siblings, 0 replies; 10+ messages in thread
From: Frager, Neal via buildroot @ 2024-06-07 10:04 UTC (permalink / raw)
  To: yann.morin.1998@free.fr
  Cc: Erkiaga Elorza, Ibai, luca.ceresoli@bootlin.com,
	brandon.maier@collins.com, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org, Simek, Michal

Hi Yann, et all,

> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.

> Signed-off-by: Neal Frager <neal.frager@amd.com>
[--SNIP--]

> V11->V12:
>  - replace select BR2_TOOLCHAIN_BARE_METAL_BUILDROOT with depends
>  - change variable name for check-package warning

I implemented the changes you requested and submitted a new v12 version.

I left out the following things from this patch set.

1. No forced hashing for zynqmp:
As we have not resolved how we will handle the hash for files downloaded with
EXTRA_DOWNLOADS, I left the force hashing out of this patch set.

2. No versal-firmware patches:
Since BR2_DOWNLOAD_FORCE_CHECK_HASHES is already included in the
versal_vck190_defconfig, the new versal-firmware will fail because it uses
EXTRA_DOWNLOADS to download a PDI file which has no version in the filename.

3. zynqmp_kd240_defconfig:
I did not update this defconfig since it has not yet been bumped to 2024.1.

Please let me know if you think this zynqmp-firmware is ready to be applied,
and if you have any additional feedback.

[--SNIP--]

> +++ b/boot/zynqmp-firmware/Config.in
> @@ -0,0 +1,25 @@
> +config BR2_TARGET_ZYNQMP_FIRMWARE
> +	bool "zynqmp-firmware"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  This package builds the PMU Firmware application required
> +	  to run U-Boot and Linux in the Zynq MPSoC devices.
> +
> +if BR2_TARGET_ZYNQMP_FIRMWARE
> +
> +comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"

Resolves issue of a user building a bare-metal toolchain for another tuple.

[--SNIP--]

> +ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf
> +
> +define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(ZYNQMP_FIRMWARE) $(BINARIES_DIR)/pmufw.elf

Changed variable name to resolve check-package warning.

[--SNIP--]

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
  2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
                   ` (2 preceding siblings ...)
  2024-06-07 10:04 ` [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Frager, Neal via buildroot
@ 2024-06-07 11:22 ` Yann E. MORIN
  2024-06-07 11:41   ` Frager, Neal via buildroot
  2024-06-10 13:12 ` Brandon Maier via buildroot
  4 siblings, 1 reply; 10+ messages in thread
From: Yann E. MORIN @ 2024-06-07 11:22 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier,
	thomas.petazzoni, buildroot, michal.simek

Neal, All,

On 2024-06-07 10:47 +0100, Neal Frager via buildroot spake thusly:
> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
[--SNIP--]
> diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
> new file mode 100644
> index 0000000000..478d58d552
> --- /dev/null
> +++ b/boot/zynqmp-firmware/Config.in
> @@ -0,0 +1,25 @@
> +config BR2_TARGET_ZYNQMP_FIRMWARE
> +	bool "zynqmp-firmware"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  This package builds the PMU Firmware application required
> +	  to run U-Boot and Linux in the Zynq MPSoC devices.
> +
> +if BR2_TARGET_ZYNQMP_FIRMWARE
> +
> +comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"

The comment is in the if-endif block, so it will only show when
BR2_TARGET_ZYNQMP_FIRMWARE, but the conditions to show the comment are
the opposite of those to show BR2_TARGET_ZYNQMP_FIRMWARE in the first
place, so the comment will not be visible when BR2_TARGET_ZYNQMP_FIRMWARE
is not already available.

So the comment will never be visible.

So, either place it before the main symnbol, or after the if-endif block
(but not in-between the two).

No need to respin just for that, it can be fixed when applying.

> +config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
> +	string "custom cflags"
> +	help
> +	  Adds additional CFLAGS for building zynqmp firmware.

What kind of specific CFLAGS would one have to pass?

I see in patch 3 that you are passing -DK26_SOM, so presumably that's
about the CPU or board variant. Shouldn't we have a choice for that:

In the Config.in:

    choice
        bool "Board/CPU variant"

    config BR2_TARGET_ZYNQMP_FIRMWARE_DEFAULT
        bool "default"

    config BR2_TARGET_ZYNQMP_FIRMWARE_K26_SOM
        bool "K26 SOM"

    endchoice

    config BR2_TARGET_ZYNQMP_FIRMWARE_VARIANT
        string
        default "K26_SOM"   if BR2_TARGET_ZYNQMP_FIRMWARE_K26_SOM

In the .mk:

    ZYNQMP_FIRMWARE_VARIANT = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VARIANT))
    ifneq ($(ZYNQMP_FIRMWARE_VARIANT),)
    ZYNQMP_FIRMWARE_CFLAGS += -D$(ZYNQMP_FIRMWARE_VARIANT)
    endif

> +endif # BR2_TARGET_ZYNQMP_FIRMWARE
> diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
> new file mode 100644
> index 0000000000..dafb2dbe55
> --- /dev/null
> +++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# zynqmp-firmware
> +#
> +################################################################################
> +
> +ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_SITE = \
> +	$(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_LICENSE = MIT
> +ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
> +ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
> +ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
> +ZYNQMP_FIRMWARE_DEPENDENCIES = toolchain-bare-metal-buildroot
> +
> +CUSTOM_CFLAGS = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))

All variables must be scopped in the current package "namespace" [0]:

    ZYNQMP_FIRMWARE_CUSTOM_CFLAGS = ...

No need to respin just for that, it can be fixed when applying...

> +ZYNQMP_FIRMWARE_CFLAGS = "-Os -flto -ffat-lto-objects $(CUSTOM_CFLAGS)"
> +
> +define ZYNQMP_FIRMWARE_BUILD_CMDS
> +	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(ZYNQMP_FIRMWARE_CFLAGS)
> +endef
> +
> +ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf

Ah, I see that the check-package hint is not very explicit. All it says
is that the variable is not properly scopped, and what it reports is
the prefix all variables should have:

    ZYNQMP_FIRMWARE_PMUFW = ...

ZYNQMP_FIRMWARE is the stem all variables should have. Sorry, it was not
clear enough in my previous reply, and the check-package hint is a bit
misleading... I'll send a patch to make it clearer.

[0] https://buildroot.org/downloads/manual/manual.html#_tips_and_tricks

Since ZYNQMP_FIRMWARE_PMUFW is used only once, is there really a need
for an intermediate variable to begin with?

No need to respin just for that, it can be fixed when applying...

Regards,
Yann E. MORIN.

> +define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(ZYNQMP_FIRMWARE) $(BINARIES_DIR)/pmufw.elf
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
  2024-06-07 11:22 ` Yann E. MORIN
@ 2024-06-07 11:41   ` Frager, Neal via buildroot
  0 siblings, 0 replies; 10+ messages in thread
From: Frager, Neal via buildroot @ 2024-06-07 11:41 UTC (permalink / raw)
  To: Yann E. MORIN
  Cc: Erkiaga Elorza, Ibai, luca.ceresoli@bootlin.com,
	brandon.maier@collins.com, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org, Simek, Michal

Yann, all,

> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> [--SNIP--]
> diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
> new file mode 100644
> index 0000000000..478d58d552
> --- /dev/null
> +++ b/boot/zynqmp-firmware/Config.in
> @@ -0,0 +1,25 @@
> +config BR2_TARGET_ZYNQMP_FIRMWARE
> +	bool "zynqmp-firmware"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  This package builds the PMU Firmware application required
> +	  to run U-Boot and Linux in the Zynq MPSoC devices.
> +
> +if BR2_TARGET_ZYNQMP_FIRMWARE
> +
> +comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"

> The comment is in the if-endif block, so it will only show when
> BR2_TARGET_ZYNQMP_FIRMWARE, but the conditions to show the comment are
> the opposite of those to show BR2_TARGET_ZYNQMP_FIRMWARE in the first
> place, so the comment will not be visible when BR2_TARGET_ZYNQMP_FIRMWARE
> is not already available.

> So the comment will never be visible.

> So, either place it before the main symnbol, or after the if-endif block
> (but not in-between the two).

> No need to respin just for that, it can be fixed when applying.

Ok, thank you.

> +config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
> +	string "custom cflags"
> +	help
> +	  Adds additional CFLAGS for building zynqmp firmware.

> What kind of specific CFLAGS would one have to pass?

> I see in patch 3 that you are passing -DK26_SOM, so presumably that's
> about the CPU or board variant. Shouldn't we have a choice for that:

> In the Config.in:

>    choice
>        bool "Board/CPU variant"

>    config BR2_TARGET_ZYNQMP_FIRMWARE_DEFAULT
>        bool "default"

>    config BR2_TARGET_ZYNQMP_FIRMWARE_K26_SOM
>        bool "K26 SOM"

>    endchoice

>    config BR2_TARGET_ZYNQMP_FIRMWARE_VARIANT
>        string
>        default "K26_SOM"   if BR2_TARGET_ZYNQMP_FIRMWARE_K26_SOM

> In the .mk:

>    ZYNQMP_FIRMWARE_VARIANT = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VARIANT))
>    ifneq ($(ZYNQMP_FIRMWARE_VARIANT),)
>    ZYNQMP_FIRMWARE_CFLAGS += -D$(ZYNQMP_FIRMWARE_VARIANT)
>    endif

I don't really like changing this to a CPU variant because it is not an
accurate portrayal of what we are doing here.  All of the zynqmp devices can
run with a default build of the pmufw, regardless of device variant.  This is
why the zcu102, zcu104 and zcu106 all use the default build, even though they
do not have the same variant of the zynqmp on each board.  For example, the
zcu102 has a zu9 and the zcu106 has a zu7.

However, there are a ton of configuration defines that users can configure to
customize their build options which are defined in the xpfw_config.h header
file.  This is what we are exposing by allowing users to enter their own
CFLAGS to configure these options.

https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h

The Kria SOMs are a special case as we enabled some of these specific defines
which are needed for all Kria SOM based products.  If you look at the v11
version of this patch set, you will see a long string of config defines.

Since these defines are needed for all Kria SOMs, I upstreamed a solution
within AMD, so that users only need to define K26_SOM or K24_SOM, in case
they are working with a Kria SOM, and they will get all of the defines that
are required.  This is newly included with the 2024.1 release.

By having a CFLAGS option, users can then add additional configs regardless
of whether they are using a standard zynqmp or a Kria SOM.  It would work
the same in either case.

> +endif # BR2_TARGET_ZYNQMP_FIRMWARE
> diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
> new file mode 100644
> index 0000000000..dafb2dbe55
> --- /dev/null
> +++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# zynqmp-firmware
> +#
> +################################################################################
> +
> +ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_SITE = \
> +	$(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_LICENSE = MIT
> +ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
> +ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
> +ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
> +ZYNQMP_FIRMWARE_DEPENDENCIES = toolchain-bare-metal-buildroot
> +
> +CUSTOM_CFLAGS = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))

> All variables must be scopped in the current package "namespace" [0]:

>    ZYNQMP_FIRMWARE_CUSTOM_CFLAGS = ...

> No need to respin just for that, it can be fixed when applying...

Ok, thanks.

> +ZYNQMP_FIRMWARE_CFLAGS = "-Os -flto -ffat-lto-objects $(CUSTOM_CFLAGS)"
> +
> +define ZYNQMP_FIRMWARE_BUILD_CMDS
> +	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(ZYNQMP_FIRMWARE_CFLAGS)
> +endef
> +
> +ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf

> Ah, I see that the check-package hint is not very explicit. All it says
> is that the variable is not properly scopped, and what it reports is
> the prefix all variables should have:

>    ZYNQMP_FIRMWARE_PMUFW = ...

> ZYNQMP_FIRMWARE is the stem all variables should have. Sorry, it was not
> clear enough in my previous reply, and the check-package hint is a bit
> misleading... I'll send a patch to make it clearer.

> [0] https://buildroot.org/downloads/manual/manual.html#_tips_and_tricks

> Since ZYNQMP_FIRMWARE_PMUFW is used only once, is there really a need
> for an intermediate variable to begin with?

> No need to respin just for that, it can be fixed when applying...

You are right that the variable is not really needed.  I did it originally
just to keep within the 80 character line budget and look nice.

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
  2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
                   ` (3 preceding siblings ...)
  2024-06-07 11:22 ` Yann E. MORIN
@ 2024-06-10 13:12 ` Brandon Maier via buildroot
  2024-06-11  4:25   ` Frager, Neal via buildroot
  4 siblings, 1 reply; 10+ messages in thread
From: Brandon Maier via buildroot @ 2024-06-10 13:12 UTC (permalink / raw)
  To: Neal Frager via buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek, yann.morin.1998

Hi Neal,

On Fri, Jun 07, 2024 at 10:47:03AM +0100, Neal Frager via buildroot wrote:
> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
>  - builds a bare-metal gcc toolchain instead of requiring an external
>    microblaze toolchain
> V2->V3:
>  - corrected custom cflags option
>  - added support for xilinx_v2022.2 version
>  - added zynqmp-firmware.hash
> V3->V4:
>  - no changes
> V4->V5:
>  - reduced all lines to <80 chars
> V5->V6:
>  - migrated to toolchain-bare-metal-buildroot
> V6->V7:
>  - removed patch numbers
>  - changed dependency to toolchain-bare-metal-buildroot
>  - removed hash since version is configurable
> V7->V9:
>  - no changes
> V9->V10:
>  - removed patches for supporting versions older than xilinx_v2023.2
> V10->V11:
>  - set default BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH to
>    "microblazeel-xilinx-elf" to avoid stand-alone build failure
> V11->V12:
>  - replace select BR2_TOOLCHAIN_BARE_METAL_BUILDROOT with depends
>  - change variable name for check-package warning
> ---
>  DEVELOPERS                              |  1 +
>  boot/Config.in                          |  1 +
>  boot/zynqmp-firmware/Config.in          | 25 +++++++++++++++++++
>  boot/zynqmp-firmware/zynqmp-firmware.mk | 33 +++++++++++++++++++++++++
>  4 files changed, 60 insertions(+)
>  create mode 100644 boot/zynqmp-firmware/Config.in
>  create mode 100644 boot/zynqmp-firmware/zynqmp-firmware.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index cf48e01037..f3ff2cbbd5 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2337,6 +2337,7 @@ N:	Neal Frager <neal.frager@amd.com>
>  F:	board/versal/
>  F:	board/zynq/
>  F:	board/zynqmp/
> +F:	boot/zynqmp-firmware/
>  F:	configs/versal_vck190_defconfig
>  F:	configs/zynq_zc702_defconfig
>  F:	configs/zynq_zc706_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index 87e1b7c00e..64b1c8c420 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -23,5 +23,6 @@ source "boot/ti-k3-boot-firmware/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
> +source "boot/zynqmp-firmware/Config.in"
>  
>  endmenu
> diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
> new file mode 100644
> index 0000000000..478d58d552
> --- /dev/null
> +++ b/boot/zynqmp-firmware/Config.in
> @@ -0,0 +1,25 @@
> +config BR2_TARGET_ZYNQMP_FIRMWARE
> +	bool "zynqmp-firmware"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  This package builds the PMU Firmware application required
> +	  to run U-Boot and Linux in the Zynq MPSoC devices.
> +
> +if BR2_TARGET_ZYNQMP_FIRMWARE
> +
> +comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"
> +
> +config BR2_TARGET_ZYNQMP_FIRMWARE_VERSION
> +	string "firmware version"
> +	default "xilinx_v2024.1"
> +	help
> +	  Release version of zynqmp firmware.
> +	  Only versions xilinx_v2023.2 and newer are supported.
> +
> +config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
> +	string "custom cflags"
> +	help
> +	  Adds additional CFLAGS for building zynqmp firmware.
> +
> +endif # BR2_TARGET_ZYNQMP_FIRMWARE
> diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
> new file mode 100644
> index 0000000000..dafb2dbe55
> --- /dev/null
> +++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# zynqmp-firmware
> +#
> +################################################################################
> +
> +ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_SITE = \
> +	$(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_LICENSE = MIT

In the license.txt there are other SPDX licenses types.

  $ grep SPDX license.txt | awk '{print $1 " " $2}' | sort | uniq
  SPDX-License-Identifier: BSD-2-Clause
  SPDX-License-Identifier: BSD-3-Clause
  SPDX-License-Identifier: GPL-2.0
  SPDX-License-Identifier: MIT

Should these be added?

From https://github.com/Xilinx/embeddedsw/blob/master/license.txt

> +ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
> +ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
> +ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
> +ZYNQMP_FIRMWARE_DEPENDENCIES = toolchain-bare-metal-buildroot
> +
> +CUSTOM_CFLAGS = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))
> +ZYNQMP_FIRMWARE_CFLAGS = "-Os -flto -ffat-lto-objects $(CUSTOM_CFLAGS)"
> +
> +define ZYNQMP_FIRMWARE_BUILD_CMDS
> +	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(ZYNQMP_FIRMWARE_CFLAGS)
> +endef
> +
> +ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf
> +
> +define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(ZYNQMP_FIRMWARE) $(BINARIES_DIR)/pmufw.elf
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 

Thanks,
Brandon Maier
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2024-06-10 14:42   ` Brandon Maier via buildroot
  0 siblings, 0 replies; 10+ messages in thread
From: Brandon Maier via buildroot @ 2024-06-10 14:42 UTC (permalink / raw)
  To: Neal Frager via buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek, yann.morin.1998

Hi Neal,

On Fri, Jun 07, 2024 at 10:47:04AM +0100, Neal Frager via buildroot wrote:
> The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option will enable u-boot to
> use the zynqmp-firmware 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->V2:
>  - patch is now backwards compatible for users already using the
>    BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw
> V2->V3:
>  - no changes
> V3->V4:
>  - BR2_TARGET_UBOOT_ZYNQMP_PMUFW removed when
>    BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE selected
> V4->V12:
>  - no changes
> ---
>  boot/uboot/Config.in | 19 +++++++++++++++++--
>  boot/uboot/uboot.mk  |  5 +++++
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index d0901edc9d..f0c26af25c 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -512,11 +512,26 @@ config BR2_TARGET_UBOOT_ZYNQMP
>  
>  if BR2_TARGET_UBOOT_ZYNQMP
>  
> +config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
> +	bool "Build zynqmp PMU firmware from source"
> +	select BR2_TARGET_ZYNQMP_FIRMWARE
> +	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
> +	help
> +	  This option instructs u-boot to build the zynqmp pmufw using
> +	  the zynqmp-firmware package.  u-boot will then include this
> +	  pmufw.elf in the generated boot.bin.
> +
> +	  If this option is selected, the BR2_TARGET_UBOOT_ZYNQMP_PMUFW
> +	  prebuilt option will be ignored.
> +
> +	  This feature requires U-Boot >= 2018.07.
> +
>  config BR2_TARGET_UBOOT_ZYNQMP_PMUFW
> -	string "PMU firmware location"
> +	string "Pre-built zynqmp PMU firmware location"
>  	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
> +	depends on !BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
>  	help
> -	  Location of a PMU firmware binary.
> +	  Location of a pre-built PMU firmware binary.
>  
>  	  If not empty, instructs the U-Boot build process to generate
>  	  a boot.bin (to be loaded by the ZynqMP boot ROM) containing
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index b9f165f041..18c02a4430 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -436,7 +436,12 @@ endef
>  
>  ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
>  
> +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE),y)
> +UBOOT_DEPENDENCIES += zynqmp-firmware
> +UBOOT_ZYNQMP_PMUFW = $(BINARIES_DIR)/pmufw.elf
> +else
>  UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW))
> +endif #BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
>  
>  ifneq ($(findstring ://,$(UBOOT_ZYNQMP_PMUFW)),)
>  UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW)
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

Looks good, given Yann's fixups

Reviewed-by: Brandon Maier <brandon.maier@collins.com>

Thanks,
Brandon Maier
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source
  2024-06-07  9:47 ` [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source Neal Frager via buildroot
@ 2024-06-10 14:44   ` Brandon Maier via buildroot
  0 siblings, 0 replies; 10+ messages in thread
From: Brandon Maier via buildroot @ 2024-06-10 14:44 UTC (permalink / raw)
  To: Neal Frager via buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek, yann.morin.1998

Hi Neal,

On Fri, Jun 07, 2024 at 10:47:05AM +0100, Neal Frager via buildroot wrote:
> This patch migrates the zynqmp config files to use the new
> zynqmp-firmware package for building the zynqmp pmufw from source.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V4->V7:
>  - no changes
> V7->V8:
>  - bump to xilinx_v2023.2
> V8->V9:
>  - add the new zynqmp defconfigs
>  - add BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH definition
> V9->V10:
>  - no changes
> V10->V11:
>  - BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH is set by zynqmp-firmware
> V11->V12:
>  - BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH is set in each defconfig
> ---
>  configs/zynqmp_kria_kr260_defconfig | 6 +++++-
>  configs/zynqmp_kria_kv260_defconfig | 6 +++++-
>  configs/zynqmp_zcu102_defconfig     | 5 ++++-
>  configs/zynqmp_zcu104_defconfig     | 5 ++++-
>  configs/zynqmp_zcu106_defconfig     | 5 ++++-
>  5 files changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/configs/zynqmp_kria_kr260_defconfig b/configs/zynqmp_kria_kr260_defconfig
> index 3bf269ab6b..3f475af882 100644
> --- a/configs/zynqmp_kria_kr260_defconfig
> +++ b/configs/zynqmp_kria_kr260_defconfig
> @@ -31,10 +31,14 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/kr260-kria/pmufw.elf"
>  BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/kria/kr260/pm_cfg_obj.c"
>  BR2_TARGET_UBOOT_FORMAT_ITB=y
>  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
> +BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
> +BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS="-DK26_SOM"
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> diff --git a/configs/zynqmp_kria_kv260_defconfig b/configs/zynqmp_kria_kv260_defconfig
> index 7b402e032c..313b324a13 100644
> --- a/configs/zynqmp_kria_kv260_defconfig
> +++ b/configs/zynqmp_kria_kv260_defconfig
> @@ -31,10 +31,14 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/kv260-kria/pmufw.elf"
>  BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/kria/kv260/pm_cfg_obj.c"
>  BR2_TARGET_UBOOT_FORMAT_ITB=y
>  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
> +BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
> +BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS="-DK26_SOM"
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> diff --git a/configs/zynqmp_zcu102_defconfig b/configs/zynqmp_zcu102_defconfig
> index f40002f6d9..302ad1394e 100644
> --- a/configs/zynqmp_zcu102_defconfig
> +++ b/configs/zynqmp_zcu102_defconfig
> @@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu102-zynqmp/pmufw.elf"
>  BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu102/pm_cfg_obj.c"
>  BR2_TARGET_UBOOT_FORMAT_ITB=y
>  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
> +BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> diff --git a/configs/zynqmp_zcu104_defconfig b/configs/zynqmp_zcu104_defconfig
> index ef9c9bad49..059858fff6 100644
> --- a/configs/zynqmp_zcu104_defconfig
> +++ b/configs/zynqmp_zcu104_defconfig
> @@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu104-zynqmp/pmufw.elf"
>  BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu104/pm_cfg_obj.c"
>  BR2_TARGET_UBOOT_FORMAT_ITB=y
>  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
> +BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> diff --git a/configs/zynqmp_zcu106_defconfig b/configs/zynqmp_zcu106_defconfig
> index 07c595436f..39dd5c8ab3 100644
> --- a/configs/zynqmp_zcu106_defconfig
> +++ b/configs/zynqmp_zcu106_defconfig
> @@ -30,10 +30,13 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2024.1/zcu106-zynqmp/pmufw.elf"
>  BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu106/pm_cfg_obj.c"
>  BR2_TARGET_UBOOT_FORMAT_ITB=y
>  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
> +BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2024.1"
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT=y
> +BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH="microblazeel-xilinx-elf"
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 

Reviewed-by: Brandon Maier <brandon.maier@collins.com>

Thanks,
Brandon Maier
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware
  2024-06-10 13:12 ` Brandon Maier via buildroot
@ 2024-06-11  4:25   ` Frager, Neal via buildroot
  0 siblings, 0 replies; 10+ messages in thread
From: Frager, Neal via buildroot @ 2024-06-11  4:25 UTC (permalink / raw)
  To: Brandon Maier, Neal Frager via buildroot
  Cc: Simek, Michal, luca.ceresoli@bootlin.com, yann.morin.1998@free.fr,
	thomas.petazzoni@bootlin.com, Erkiaga Elorza, Ibai

Hi Brandon,

> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
>  - builds a bare-metal gcc toolchain instead of requiring an external
>    microblaze toolchain
> V2->V3:
>  - corrected custom cflags option
>  - added support for xilinx_v2022.2 version
>  - added zynqmp-firmware.hash
> V3->V4:
>  - no changes
> V4->V5:
>  - reduced all lines to <80 chars
> V5->V6:
>  - migrated to toolchain-bare-metal-buildroot
> V6->V7:
>  - removed patch numbers
>  - changed dependency to toolchain-bare-metal-buildroot
>  - removed hash since version is configurable
> V7->V9:
>  - no changes
> V9->V10:
>  - removed patches for supporting versions older than xilinx_v2023.2
> V10->V11:
>  - set default BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH to
>    "microblazeel-xilinx-elf" to avoid stand-alone build failure
> V11->V12:
>  - replace select BR2_TOOLCHAIN_BARE_METAL_BUILDROOT with depends
>  - change variable name for check-package warning
> ---
>  DEVELOPERS                              |  1 +
>  boot/Config.in                          |  1 +
>  boot/zynqmp-firmware/Config.in          | 25 +++++++++++++++++++
>  boot/zynqmp-firmware/zynqmp-firmware.mk | 33 +++++++++++++++++++++++++
>  4 files changed, 60 insertions(+)
>  create mode 100644 boot/zynqmp-firmware/Config.in
>  create mode 100644 boot/zynqmp-firmware/zynqmp-firmware.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index cf48e01037..f3ff2cbbd5 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2337,6 +2337,7 @@ N:	Neal Frager <neal.frager@amd.com>
>  F:	board/versal/
>  F:	board/zynq/
>  F:	board/zynqmp/
> +F:	boot/zynqmp-firmware/
>  F:	configs/versal_vck190_defconfig
>  F:	configs/zynq_zc702_defconfig
>  F:	configs/zynq_zc706_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index 87e1b7c00e..64b1c8c420 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -23,5 +23,6 @@ source "boot/ti-k3-boot-firmware/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
> +source "boot/zynqmp-firmware/Config.in"
>  
>  endmenu
> diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
> new file mode 100644
> index 0000000000..478d58d552
> --- /dev/null
> +++ b/boot/zynqmp-firmware/Config.in
> @@ -0,0 +1,25 @@
> +config BR2_TARGET_ZYNQMP_FIRMWARE
> +	bool "zynqmp-firmware"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  This package builds the PMU Firmware application required
> +	  to run U-Boot and Linux in the Zynq MPSoC devices.
> +
> +if BR2_TARGET_ZYNQMP_FIRMWARE
> +
> +comment "zynqmp-firmware needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"
> +
> +config BR2_TARGET_ZYNQMP_FIRMWARE_VERSION
> +	string "firmware version"
> +	default "xilinx_v2024.1"
> +	help
> +	  Release version of zynqmp firmware.
> +	  Only versions xilinx_v2023.2 and newer are supported.
> +
> +config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
> +	string "custom cflags"
> +	help
> +	  Adds additional CFLAGS for building zynqmp firmware.
> +
> +endif # BR2_TARGET_ZYNQMP_FIRMWARE
> diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
> new file mode 100644
> index 0000000000..dafb2dbe55
> --- /dev/null
> +++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# zynqmp-firmware
> +#
> +################################################################################
> +
> +ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_SITE = \
> +	$(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
> +ZYNQMP_FIRMWARE_LICENSE = MIT

> In the license.txt there are other SPDX licenses types.

>  $ grep SPDX license.txt | awk '{print $1 " " $2}' | sort | uniq
>  SPDX-License-Identifier: BSD-2-Clause
>  SPDX-License-Identifier: BSD-3-Clause
>  SPDX-License-Identifier: GPL-2.0
>  SPDX-License-Identifier: MIT

> Should these be added?

> From https://github.com/Xilinx/embeddedsw/blob/master/license.txt

I am not sure.  While the Xilinx/embeddedsw repo contains code under all of
these licenses, all of the code used by the zynqmp_pmufw application is under
MIT license.  Do we need to include the other licenses because we are
downloading software covered by these licenses even if we are not actually
using it?

Perhaps someone more knowledgable about software licensing can advise?

> +ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
> +ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
> +ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
> +ZYNQMP_FIRMWARE_DEPENDENCIES = toolchain-bare-metal-buildroot
> +
> +CUSTOM_CFLAGS = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))
> +ZYNQMP_FIRMWARE_CFLAGS = "-Os -flto -ffat-lto-objects $(CUSTOM_CFLAGS)"
> +
> +define ZYNQMP_FIRMWARE_BUILD_CMDS
> +	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(ZYNQMP_FIRMWARE_CFLAGS)
> +endef
> +
> +ZYNQMP_FIRMWARE = $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf
> +
> +define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(ZYNQMP_FIRMWARE) $(BINARIES_DIR)/pmufw.elf
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-06-11  4:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07  9:47 [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
2024-06-07  9:47 ` [Buildroot] [PATCH v12 2/3] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2024-06-10 14:42   ` Brandon Maier via buildroot
2024-06-07  9:47 ` [Buildroot] [PATCH v12 3/3] configs/zynqmp*: build pmufw source Neal Frager via buildroot
2024-06-10 14:44   ` Brandon Maier via buildroot
2024-06-07 10:04 ` [Buildroot] [PATCH v12 1/3] boot/zynqmp-firmware: new boot firmware Frager, Neal via buildroot
2024-06-07 11:22 ` Yann E. MORIN
2024-06-07 11:41   ` Frager, Neal via buildroot
2024-06-10 13:12 ` Brandon Maier via buildroot
2024-06-11  4:25   ` Frager, Neal via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox