All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/3] add package/versal-firmware
@ 2022-08-19  6:37 Neal Frager
  2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Neal Frager @ 2022-08-19  6:37 UTC (permalink / raw)
  To: buildroot; +Cc: Neal Frager, michal.simek, luca.ceresoli, thomas.petazzoni

This patch adds support for downloading versal firmware binaries.
These are necessary for booting Xilinx versal devices.

Signed-off-by: Neal Frager <neal.frager@xilinx.com>
---
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/versal-firmware/Config.in          | 32 ++++++++++++++++++++++
 package/versal-firmware/versal-firmware.mk | 25 +++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 100644 package/versal-firmware/Config.in
 create mode 100644 package/versal-firmware/versal-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index d2bd0d809a..1671f782ba 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2168,6 +2168,7 @@ F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
+F:	package/versal-firmware
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
 F:	package/uacme/
diff --git a/package/Config.in b/package/Config.in
index d1c098c48f..d69c3eff9a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -440,6 +440,7 @@ menu "Firmware"
 	source "package/sunxi-boards/Config.in"
 	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
+	source "package/versal-firmware/Config.in"
 	source "package/wilc-firmware/Config.in"
 	source "package/wilink-bt-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
new file mode 100644
index 0000000000..9ca46b1d16
--- /dev/null
+++ b/package/versal-firmware/Config.in
@@ -0,0 +1,32 @@
+config BR2_PACKAGE_VERSAL_FIRMWARE
+	bool "versal-firmware"
+	depends on BR2_aarch64
+	help
+	  Versal Firmware
+
+	  Pre-built binaries of the current bootloader firmware
+
+	  https://github.com/nealfrager/versal_boot
+
+if BR2_PACKAGE_VERSAL_FIRMWARE
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
+	string "versal firmware location"
+	help
+	  Location of a versal firmware boot.bin.
+
+	  The value should be a git repository.
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
+	string "versal board name"
+	help
+	  Name of versal target board.
+
+	  Used for installing the appropriate firmware boot.bin.
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
+	string "versal firmware version"
+	help
+	  Release version of versal firmware.
+
+endif # BR2_PACKAGE_VERSAL_FIRMWARE
diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
new file mode 100644
index 0000000000..b465b2bd83
--- /dev/null
+++ b/package/versal-firmware/versal-firmware.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# versal-firmware
+#
+################################################################################
+
+VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_SITE = $(BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION)
+
+VERSAL_FIRMWARE_INSTALL_IMAGES = YES
+
+VERSAL_FIRMWARE_FILES = \
+	$(if $(BR2_PACKAGE_VERSAL_FIRMWARE), boot.bin)
+
+define VERSAL_FIRMWARE_INSTALL_BIN
+	$(foreach f,$(VERSAL_FIRMWARE_FILES), \
+		$(INSTALL) -D -m 0644 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(f) $(BINARIES_DIR)/$(f)
+	)
+endef
+
+define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(VERSAL_FIRMWARE_INSTALL_BIN)
+endef
+
+$(eval $(generic-package))
-- 
2.17.1

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

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

* [Buildroot] [PATCH v1 2/3] add board/versal
  2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
@ 2022-08-19  6:37 ` Neal Frager
  2022-08-19  6:37 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager
  2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
  2 siblings, 0 replies; 17+ messages in thread
From: Neal Frager @ 2022-08-19  6:37 UTC (permalink / raw)
  To: buildroot; +Cc: Neal Frager, michal.simek, luca.ceresoli, thomas.petazzoni

This patch adds board support for generating images for versal boards.

Signed-off-by: Neal Frager <neal.frager@xilinx.com>
---
 DEVELOPERS                 |  1 +
 board/versal/genimage.cfg  | 30 +++++++++++++++++++++
 board/versal/post-build.sh | 16 +++++++++++
 board/versal/post-image.sh | 15 +++++++++++
 board/versal/readme.txt    | 54 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 116 insertions(+)
 create mode 100644 board/versal/genimage.cfg
 create mode 100755 board/versal/post-build.sh
 create mode 100755 board/versal/post-image.sh
 create mode 100644 board/versal/readme.txt

diff --git a/DEVELOPERS b/DEVELOPERS
index 1671f782ba..315866bc8f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2164,6 +2164,7 @@ N:	Neal Frager <neal.frager@amd.com>
 F:	board/zynq/
 F:	board/zynqmp/
 F:	board/zynqmp/kria/
+F:	board/versal/
 F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
diff --git a/board/versal/genimage.cfg b/board/versal/genimage.cfg
new file mode 100644
index 0000000000..d994d3a2bf
--- /dev/null
+++ b/board/versal/genimage.cfg
@@ -0,0 +1,30 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"boot.bin",
+			"system.dtb",
+			"Image"
+		}
+		file extlinux/extlinux.conf {
+			image = extlinux.conf
+		}
+	}
+
+	size = 32M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
diff --git a/board/versal/post-build.sh b/board/versal/post-build.sh
new file mode 100755
index 0000000000..0713bd1b05
--- /dev/null
+++ b/board/versal/post-build.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# genimage will need to find the extlinux.conf
+# in the binaries directory
+
+BOARD_DIR="$(dirname $0)"
+CONSOLE=$2
+ROOT=$3
+
+mkdir -p "${BINARIES_DIR}"
+cat <<-__HEADER_EOF > "${BINARIES_DIR}/extlinux.conf"
+	label linux
+	  kernel /Image
+	  devicetree /system.dtb
+	  append console=${CONSOLE} root=/dev/${ROOT} rw rootwait
+	__HEADER_EOF
diff --git a/board/versal/post-image.sh b/board/versal/post-image.sh
new file mode 100755
index 0000000000..ed6dbe188c
--- /dev/null
+++ b/board/versal/post-image.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# By default U-Boot loads DTB from a file named "system.dtb", so
+# let's use a symlink with that name that points to the *first*
+# devicetree listed in the config.
+
+FIRST_DT=$(sed -nr \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               ${BR2_CONFIG})
+
+[ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/system.dtb
+
+BOARD_DIR="$(dirname $0)"
+
+support/scripts/genimage.sh -c $BOARD_DIR/genimage.cfg
diff --git a/board/versal/readme.txt b/board/versal/readme.txt
new file mode 100644
index 0000000000..9f234be620
--- /dev/null
+++ b/board/versal/readme.txt
@@ -0,0 +1,54 @@
+******************************************
+Xilinx VCK190 board - Versal
+******************************************
+
+This document describes the Buildroot support for the VCK190
+board by Xilinx, based on Versal.  It has been tested with the 
+VCK190 production board.
+
+Evaluation board features can be found here with the link below.
+
+VCK190:
+https://www.xilinx.com/products/boards-and-kits/vck190.html
+
+
+How to build it
+===============
+
+Configure Buildroot:
+
+    $ make versal_vck190_defconfig
+
+Compile everything and build the rootfs image:
+
+    $ make
+
+Result of the build
+-------------------
+
+After building, you should get a tree like this:
+
+    output/images/
+    +-- boot.bin
+    +-- boot.vfat
+    +-- Image
+    +-- rootfs.ext2
+    +-- rootfs.ext4 -> rootfs.ext2
+    +-- sdcard.img
+    +-- system.dtb -> versal-vck190-rev1.1.dtb
+    `-- versal-vck190-rev1.1.dtb
+
+How to write the SD card
+========================
+
+WARNING! This will destroy all the card content. Use with care!
+
+The sdcard.img file is a complete bootable image ready to be written
+on the boot medium. To install it, simply copy the image to an SD
+card:
+
+    # dd if=output/images/sdcard.img of=/dev/sdX
+
+Where 'sdX' is the device node of the SD.
+
+Eject the SD card, insert it in the board, and power it up.
-- 
2.17.1

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

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

* [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig
  2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
  2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager
@ 2022-08-19  6:37 ` Neal Frager
  2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
  2 siblings, 0 replies; 17+ messages in thread
From: Neal Frager @ 2022-08-19  6:37 UTC (permalink / raw)
  To: buildroot; +Cc: Neal Frager, michal.simek, luca.ceresoli, thomas.petazzoni

This patch adds support for Xilinx Versal VCK190 evaluation board.

VCK190 features can be found here:
https://www.xilinx.com/products/boards-and-kits/vck190.html

The VCK190 is based on the Xilinx Versal family:
https://www.xilinx.com/products/silicon-devices/acap/versal.html

The VC1902 included with the VCK190 evaluation board has Xilinx
AI Engine acclerators designed for accelerating machine learning
applications.  Also included is an upgrade from prior Zynq and
ZynqMP families to ARM Cortex-A72 cores.

While the Linux kernel for Versal is quite similar to ZynqMP,
the boot process has significantly changed.

Triple-redundant MicroBlaze cores are used to boot and setup
Versal devices.  For this reason, current buildroot support
will download a boot.bin pre-built image from the petalinux
pre-built wiki page found below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842316/Linux+Prebuilt+Images

Signed-off-by: Neal Frager <neal.frager@xilinx.com>
---
 DEVELOPERS                      |  1 +
 configs/versal_vck190_defconfig | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 configs/versal_vck190_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 315866bc8f..3830200bb0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2165,6 +2165,7 @@ F:	board/zynq/
 F:	board/zynqmp/
 F:	board/zynqmp/kria/
 F:	board/versal/
+F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
diff --git a/configs/versal_vck190_defconfig b/configs/versal_vck190_defconfig
new file mode 100644
index 0000000000..d0ea4c2077
--- /dev/null
+++ b/configs/versal_vck190_defconfig
@@ -0,0 +1,22 @@
+BR2_aarch64=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/versal/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/versal/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="ttyPS0,115200 mmcblk0p2"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,linux-xlnx,xlnx_rebase_v5.15_LTS_2022.1)/xlnx_rebase_v5.15_LTS_2022.1.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="xilinx_versal"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/versal-vck190-rev1.1"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_PACKAGE_VERSAL_FIRMWARE=y
+BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION="$(call github,nealfrager,versal_boot,v2022.1)"
+BR2_PACKAGE_VERSAL_FIRMWARE_BOARD="vck190"
+BR2_PACKAGE_VERSAL_FIRMWARE_VERSION="v2022.1"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
-- 
2.17.1

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
  2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager
  2022-08-19  6:37 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager
@ 2022-08-20 15:12 ` Yann E. MORIN
  2022-08-20 17:52   ` Frager, Neal via buildroot
  2022-08-21 19:06   ` Thomas Petazzoni via buildroot
  2 siblings, 2 replies; 17+ messages in thread
From: Yann E. MORIN @ 2022-08-20 15:12 UTC (permalink / raw)
  To: Neal Frager; +Cc: luca.ceresoli, michal.simek, thomas.petazzoni, buildroot

Neal, All,

On 2022-08-19 00:37 -0600, Neal Frager spake thusly:
> This patch adds support for downloading versal firmware binaries.
> These are necessary for booting Xilinx versal devices.
[--SNIP--]
> diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
> new file mode 100644
> index 0000000000..9ca46b1d16
> --- /dev/null
> +++ b/package/versal-firmware/Config.in
> @@ -0,0 +1,32 @@
> +config BR2_PACKAGE_VERSAL_FIRMWARE
> +	bool "versal-firmware"
> +	depends on BR2_aarch64
> +	help
> +	  Versal Firmware
> +
> +	  Pre-built binaries of the current bootloader firmware
> +
> +	  https://github.com/nealfrager/versal_boot

This looks like your personal git tree, not the official one. (Yeah, I
noticed your email address, but I would still have expected something
under https://github.com/Xilinx/).

The official images are there:
    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842316/Linux+Prebuilt+Images
    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/2347204609/2022.1+Release

If one tries to download any resource from there, they are redirected
to a login screen, e.g.:
    https://login.xilinx.com/app/xilinxinc_f5awsprod_1/exknv8ms950lm0Ldh0x7/sso/saml

The licensing information is not clearly detailed in the portal, and
being low-level firmware files, I'm afraid there might be restrictions
on the redistribution og those files...

> +if BR2_PACKAGE_VERSAL_FIRMWARE
> +
> +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> +	string "versal firmware location"

The prompt should be "Custom git repository"

> +	help
> +	  Location of a versal firmware boot.bin.
> +
> +	  The value should be a git repository.

So, there is not even a default location?

> +config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
> +	string "versal board name"
> +	help
> +	  Name of versal target board.
> +
> +	  Used for installing the appropriate firmware boot.bin.
> 
> +config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
> +	string "versal firmware version"
> +	help
> +	  Release version of versal firmware.

The version entry should be just after the git tree entry.

> +endif # BR2_PACKAGE_VERSAL_FIRMWARE
> diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
> new file mode 100644
> index 0000000000..b465b2bd83
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,25 @@
> +################################################################################
> +#
> +# versal-firmware
> +#
> +################################################################################
> +
> +VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION)
> +
> +VERSAL_FIRMWARE_INSTALL_IMAGES = YES
> +
> +VERSAL_FIRMWARE_FILES = \
> +	$(if $(BR2_PACKAGE_VERSAL_FIRMWARE), boot.bin)

This does not make sense: if the versal-firmware package is not enabled,
then it will not be installed, so there is no need to condition some
variables/values to the package being enabled or not.

> +define VERSAL_FIRMWARE_INSTALL_BIN
> +	$(foreach f,$(VERSAL_FIRMWARE_FILES), \
> +		$(INSTALL) -D -m 0644 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(f) $(BINARIES_DIR)/$(f)

VERSAL_FIRMWARE_FILES is only ever one item, boot.bin, the loop will
always be on one item, so there is no need for the loop.

Also, no need for a seaprate macro; just add this code to
VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.

In the end, I don't think we should apply this package, as it looks like
it tries to circumvent the official distrobution restrictions on these
firmware files.

Regards,
Yann E. MORIN.

> +	)
> +endef
> +
> +define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(VERSAL_FIRMWARE_INSTALL_BIN)
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.17.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] 17+ messages in thread

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
@ 2022-08-20 17:52   ` Frager, Neal via buildroot
  2022-08-20 19:17     ` Yann E. MORIN
  2022-08-21 19:06   ` Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-08-20 17:52 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: luca.ceresoli, Simek, Michal, thomas.petazzoni, buildroot

Hi Yann,

> Neal, All,

> This patch adds support for downloading versal firmware binaries.
> These are necessary for booting Xilinx versal devices.
> diff --git a/package/versal-firmware/Config.in 
> b/package/versal-firmware/Config.in
> new file mode 100644
> index 0000000000..9ca46b1d16
> --- /dev/null
> +++ b/package/versal-firmware/Config.in
> @@ -0,0 +1,32 @@
> +config BR2_PACKAGE_VERSAL_FIRMWARE
> +     bool "versal-firmware"
> +     depends on BR2_aarch64
> +     help
> +       Versal Firmware
> +
> +       Pre-built binaries of the current bootloader firmware
> +
> +       https://github.com/nealfrager/versal_boot

> This looks like your personal git tree, not the official one. (Yeah, I noticed your email address, but I would still have expected something under https://github.com/Xilinx/).

> The official images are there:
>    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842316/Linux+Prebuilt+Images
>    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/2347204609/2022.1+Release

> If one tries to download any resource from there, they are redirected to a login screen, e.g.:
>    https://login.xilinx.com/app/xilinxinc_f5awsprod_1/exknv8ms950lm0Ldh0x7/sso/saml

> The licensing information is not clearly detailed in the portal, and being low-level firmware files, I'm afraid there might be restrictions on the redistribution og those files...

Yes, I agree that the boot.bin should come from a freely available official AMD/Xilinx source.

I am working on this and am using my own personal github location in the meantime to figure out how this could work with buildroot.

I understand that this patch set cannot be accepted until the boot.bin is available freely from an official source location.

> +if BR2_PACKAGE_VERSAL_FIRMWARE
> +
> +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> +     string "versal firmware location"

> The prompt should be "Custom git repository"

Could you clarify this a bit?  Are you speaking of the BR2 name or the string text when you say the prompt?

> +     help
> +       Location of a versal firmware boot.bin.
> +
> +       The value should be a git repository.

> So, there is not even a default location?

The official default solution (aside from petalinux) is to clone the embeddedsw github location and build the plm.elf and psmfw.elf from that with a microblaze compiler.
And then use bootgen to generate a boot.bin.

While I can build u-boot and atf easily with buildroot, I do not have a clean solution for building the plm and psmfw images and generating the boot.bin.
This is why I am looking for a short term solution of just downloading a prebuilt boot.bin.

At the moment, distribution of pre-built binaries requires the click-wrap downloading procedure which does not lend itself well for an automated buildroot download.

> +config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
> +     string "versal board name"
> +     help
> +       Name of versal target board.
> +
> +       Used for installing the appropriate firmware boot.bin.
>
> +config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
> +     string "versal firmware version"
> +     help
> +       Release version of versal firmware.

> The version entry should be just after the git tree entry.

Ok.  This is my first time doing this, so thank you for this feedback.

> +endif # BR2_PACKAGE_VERSAL_FIRMWARE
> diff --git a/package/versal-firmware/versal-firmware.mk 
> b/package/versal-firmware/versal-firmware.mk
> new file mode 100644
> index 0000000000..b465b2bd83
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,25 @@
> +#####################################################################
> +###########
> +#
> +# versal-firmware
> +#
> +#####################################################################
> +###########
> +
> +VERSAL_FIRMWARE_VERSION = $(call 
> +qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION)
> +
> +VERSAL_FIRMWARE_INSTALL_IMAGES = YES
> +
> +VERSAL_FIRMWARE_FILES = \
> +     $(if $(BR2_PACKAGE_VERSAL_FIRMWARE), boot.bin)

This does not make sense: if the versal-firmware package is not enabled, then it will not be installed, so there is no need to condition some variables/values to the package being enabled or not.

> +define VERSAL_FIRMWARE_INSTALL_BIN
> +     $(foreach f,$(VERSAL_FIRMWARE_FILES), \
> +             $(INSTALL) -D -m 0644 
> +$(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(f) $(BINARIES_DIR)/$(f)

> VERSAL_FIRMWARE_FILES is only ever one item, boot.bin, the loop will always be on one item, so there is no need for the loop.

> Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.

Same comment as above.  I was working from other examples of firmware downloading to create this patch set, and I appreciate your feedback for making it simpler.

> In the end, I don't think we should apply this package, as it looks like it tries to circumvent the official distrobution restrictions on these firmware files.

I understand, and I hope to be able to come up with a solution.
If you have any ideas for how buildroot might be able to generate the boot.bin, I am happy to receive any help.

> Regards,
> Yann E. MORIN.

> +     )
> +endef
> +
> +define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
> +     $(VERSAL_FIRMWARE_INSTALL_BIN)
> +endef
> +
> +$(eval $(generic-package))
> --
> 2.17.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] 17+ messages in thread

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-20 17:52   ` Frager, Neal via buildroot
@ 2022-08-20 19:17     ` Yann E. MORIN
  2022-08-21  7:27       ` Frager, Neal via buildroot
  2022-08-22 10:01       ` Frager, Neal via buildroot
  0 siblings, 2 replies; 17+ messages in thread
From: Yann E. MORIN @ 2022-08-20 19:17 UTC (permalink / raw)
  To: Frager, Neal; +Cc: Simek, Michal, luca.ceresoli, thomas.petazzoni, buildroot

Neal, All,

On 2022-08-20 17:52 +0000, Frager, Neal via buildroot spake thusly:
> > This looks like your personal git tree, not the official one. (Yeah,
> > I noticed your email address, but I would still have expected something
> > under https://github.com/Xilinx/).
> I am working on this and am using my own personal github location in
> the meantime to figure out how this could work with buildroot.

Ah, I understand now. Next time, mark your patch as RFC.

> > +if BR2_PACKAGE_VERSAL_FIRMWARE
> > +
> > +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> > +     string "versal firmware location"
> > The prompt should be "Custom git repository"
> Could you clarify this a bit?  Are you speaking of the BR2 name or the
> string text when you say the prompt?

The prompt is the ârt that is displayed to the user, i.e. the string
between quotes after the option type, in this case:  "versal firmware
location" should be replace with "Custom git repository".

And of course, the astute reader you are noticed that the option name
als needs a rename, BR2_PACKAGE_VERSAL_FIRMWARE_CUSTOM_GIT

However, this will ultimately be uneeded, because the firmware files
hould be downloadable login-less from an official location.

So, the two options that specify the git tree location adn version are
not needed. Just hard-code them in the .mk file

So, the Config.in file should only contain (skeleton with abreviations,
extend as/where appropriate):

    config BR2_PKG_VERSAL_FW
        bool "versal firmware
        help
          Firmware files the the Xilinx Versal familly of boards.

          https://official.xilinix/location/github/whatever/

    if BR2_PKG_VERSAL_FW

    choice
        bool "Versal board"

    config BR2_PKG_VERSAL_FW_VCK190
        bool "vck190

    config BR2_PKG_VERSAL_FW_SOMETHING_ELSE
        bool "something else"

    endchoice

    config BR2_PKG_VERSAL_FW_BOARD
        string
        default "vck190" if BR2_PKG_VERSAL_FW_VCK190
        default "something-else" if BR2_PKG_VERSAL_FW_SOMETHING_ELSE

    endif

and the .mk would look like:

    VERSAL_FW_VERSION = 076d4b4f02b475dd9c65ad51992bfcad8d98b002
    VERSAL_FW_SITE = $(call github,nealfrager,versal_boot,$(VERSALE_FW_VERSION))

    VERSAL_FW_INSTALL_TARGET = NO
    VERSAL_FIRMWARE_INSTALL_IMAGES = YES

    define VERSAL_FW_INSTALL_IMAGES_CMDS
        $(INSTALL) -D -m 0644 $(@D)/$(VERSAL_FW_BOARD)/boot.bin \
            $(BINARIES_DIR)/boot.bin
    endef

    $(eval $(generic-package))

> > +     help
> > +       Location of a versal firmware boot.bin.
> > +
> > +       The value should be a git repository.
> 
> > So, there is not even a default location?
> 
> The official default solution (aside from petalinux) is to clone the
> embeddedsw github location and build the plm.elf and psmfw.elf from
> that with a microblaze compiler.
> And then use bootgen to generate a boot.bin.
> While I can build u-boot and atf easily with buildroot, I do not have
> a clean solution for building the plm and psmfw images and generating
> the boot.bin.

Yeah, I can see it being quite cumbersome. But it is not unheard of in
Buildroot already. For example, we have package/arm-gnu-toolchain/
that provides a pre-built armv7 toolchain, that is used to buid the
boot/arm-trusted-firmware/ in certain conditions.

So, it would be technically possible to package a microblaze compiler
like we've done for arm-gnu-toolchain, and use it to build the plm.elf
and psmfw.elf from "the embeddedsw".

But that is a bit of a stretch to go. Unless...

> This is why I am looking for a short term solution of just downloading
> a prebuilt boot.bin.
> At the moment, distribution of pre-built binaries requires the
> click-wrap downloading procedure which does not lend itself well for
> an automated buildroot download.

Above, you seemed to imply you were looking internally to lift this
click-wrap restriction. If that is not possible, and you can't have the
pre-built blobs hosted in an official Xilinx location, then downloading
the "embeddedsw" and building them would be a fallback.

> > Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.
> Same comment as above.  I was working from other examples of firmware
> downloading to create this patch set, and I appreciate your feedback
> for making it simpler.

Looking at other examples is a good refelex! :-) But other may install
more than one file at a time, so they need this complexity of
conditional append-assignments. In your case, it is my understanding
that only one file will ever be copied.

> > In the end, I don't think we should apply this package, as it looks
> > like it tries to circumvent the official distrobution restrictions
> > on these firmware files.
> I understand, and I hope to be able to come up with a solution.

Great! In the meantime, as it is a WIP, I've marked the series as
changes-requested in patchwork. Thanks for the feedback!

> If you have any ideas for how buildroot might be able to generate the
> boot.bin, I am happy to receive any help.

I hope the lead I pointed to above will be enough as a starting point
for you. Do not hesitate to ask further if you have concerns.

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 17+ messages in thread

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-20 19:17     ` Yann E. MORIN
@ 2022-08-21  7:27       ` Frager, Neal via buildroot
  2022-08-22 10:01       ` Frager, Neal via buildroot
  1 sibling, 0 replies; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-08-21  7:27 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Simek, Michal, luca.ceresoli, thomas.petazzoni, buildroot

Hi Yann,

> Le 20 août 2022 à 21:17, Yann E. MORIN <yann.morin.1998@free.fr> a écrit :
> 
> Neal, All,
> 
> On 2022-08-20 17:52 +0000, Frager, Neal via buildroot spake thusly:
>>> This looks like your personal git tree, not the official one. (Yeah,
>>> I noticed your email address, but I would still have expected something
>>> under https://github.com/Xilinx/).
>> I am working on this and am using my own personal github location in
>> the meantime to figure out how this could work with buildroot.
> 
> Ah, I understand now. Next time, mark your patch as RFC.
> 
>>> +if BR2_PACKAGE_VERSAL_FIRMWARE
>>> +
>>> +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
>>> +     string "versal firmware location"
>>> The prompt should be "Custom git repository"
>> Could you clarify this a bit?  Are you speaking of the BR2 name or the
>> string text when you say the prompt?
> 
> The prompt is the ârt that is displayed to the user, i.e. the string
> between quotes after the option type, in this case:  "versal firmware
> location" should be replace with "Custom git repository".
> 
> And of course, the astute reader you are noticed that the option name
> als needs a rename, BR2_PACKAGE_VERSAL_FIRMWARE_CUSTOM_GIT
> 
> However, this will ultimately be uneeded, because the firmware files
> hould be downloadable login-less from an official location.
> 
> So, the two options that specify the git tree location adn version are
> not needed. Just hard-code them in the .mk file
> 

I will hard-code the location because you are right that selecting it is not necessary.

However, I would like to keep version and board name configurable in the defconfig file.

This way, users can select whichever version of boot firmware they wish to use for the target board they wish to use.


> So, the Config.in file should only contain (skeleton with abreviations,
> extend as/where appropriate):
> 
>    config BR2_PKG_VERSAL_FW
>        bool "versal firmware
>        help
>          Firmware files the the Xilinx Versal familly of boards.
> 
>          https://official.xilinix/location/github/whatever/
> 
>    if BR2_PKG_VERSAL_FW
> 
>    choice
>        bool "Versal board"
> 
>    config BR2_PKG_VERSAL_FW_VCK190
>        bool "vck190
> 
>    config BR2_PKG_VERSAL_FW_SOMETHING_ELSE
>        bool "something else"
> 
>    endchoice
> 
>    config BR2_PKG_VERSAL_FW_BOARD
>        string
>        default "vck190" if BR2_PKG_VERSAL_FW_VCK190
>        default "something-else" if BR2_PKG_VERSAL_FW_SOMETHING_ELSE
> 
>    endif
> 
> and the .mk would look like:
> 
>    VERSAL_FW_VERSION = 076d4b4f02b475dd9c65ad51992bfcad8d98b002
>    VERSAL_FW_SITE = $(call github,nealfrager,versal_boot,$(VERSALE_FW_VERSION))
> 
>    VERSAL_FW_INSTALL_TARGET = NO
>    VERSAL_FIRMWARE_INSTALL_IMAGES = YES
> 
>    define VERSAL_FW_INSTALL_IMAGES_CMDS
>        $(INSTALL) -D -m 0644 $(@D)/$(VERSAL_FW_BOARD)/boot.bin \
>            $(BINARIES_DIR)/boot.bin
>    endef
> 
>    $(eval $(generic-package))
> 

Thanks for this.

>>> +     help
>>> +       Location of a versal firmware boot.bin.
>>> +
>>> +       The value should be a git repository.
>> 
>>> So, there is not even a default location?
>> 
>> The official default solution (aside from petalinux) is to clone the
>> embeddedsw github location and build the plm.elf and psmfw.elf from
>> that with a microblaze compiler.
>> And then use bootgen to generate a boot.bin.
>> While I can build u-boot and atf easily with buildroot, I do not have
>> a clean solution for building the plm and psmfw images and generating
>> the boot.bin.
> 
> Yeah, I can see it being quite cumbersome. But it is not unheard of in
> Buildroot already. For example, we have package/arm-gnu-toolchain/
> that provides a pre-built armv7 toolchain, that is used to buid the
> boot/arm-trusted-firmware/ in certain conditions.
> 
> So, it would be technically possible to package a microblaze compiler
> like we've done for arm-gnu-toolchain, and use it to build the plm.elf
> and psmfw.elf from "the embeddedsw".
> 
> But that is a bit of a stretch to go. Unless...
> 

I will save this for a later version as the effort to make this work properly is significantly greater.

>> This is why I am looking for a short term solution of just downloading
>> a prebuilt boot.bin.
>> At the moment, distribution of pre-built binaries requires the
>> click-wrap downloading procedure which does not lend itself well for
>> an automated buildroot download.
> 
> Above, you seemed to imply you were looking internally to lift this
> click-wrap restriction. If that is not possible, and you can't have the
> pre-built blobs hosted in an official Xilinx location, then downloading
> the "embeddedsw" and building them would be a fallback.
> 

I still have hope for a shorter term solution, but yes, we agree.

>>> Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.
>> Same comment as above.  I was working from other examples of firmware
>> downloading to create this patch set, and I appreciate your feedback
>> for making it simpler.
> 
> Looking at other examples is a good refelex! :-) But other may install
> more than one file at a time, so they need this complexity of
> conditional append-assignments. In your case, it is my understanding
> that only one file will ever be copied.
> 
>>> In the end, I don't think we should apply this package, as it looks
>>> like it tries to circumvent the official distrobution restrictions
>>> on these firmware files.
>> I understand, and I hope to be able to come up with a solution.
> 
> Great! In the meantime, as it is a WIP, I've marked the series as
> changes-requested in patchwork. Thanks for the feedback!
> 

I will send a simpler version 2 of this WIP patch set tomorrow for your review.  Thank you for your help!

>> If you have any ideas for how buildroot might be able to generate the
>> boot.bin, I am happy to receive any help.
> 
> I hope the lead I pointed to above will be enough as a starting point
> for you. Do not hesitate to ask further if you have concerns.
> 

Any leads are useful at the moment.  Thank you!

> Thanks!
> 
> Regards,
> Yann E. MORIN.
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  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.  |
> '------------------------------^-------^------------------^--------------------'

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
  2022-08-20 17:52   ` Frager, Neal via buildroot
@ 2022-08-21 19:06   ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 17+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-21 19:06 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Neal Frager, luca.ceresoli, michal.simek, buildroot

Hello,

On Sat, 20 Aug 2022 17:12:43 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> > +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> > +	string "versal firmware location"  
> 
> The prompt should be "Custom git repository"
> 
> > +	help
> > +	  Location of a versal firmware boot.bin.
> > +
> > +	  The value should be a git repository.  
> 
> So, there is not even a default location?

For Custom Git repository options, we do not want to have a default
location. We just removed such a default location in the Xenomai
package, see e4040d0d8e1d3d3b77de582b8354eca641a0613d.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-20 19:17     ` Yann E. MORIN
  2022-08-21  7:27       ` Frager, Neal via buildroot
@ 2022-08-22 10:01       ` Frager, Neal via buildroot
  2022-08-23 19:49         ` Arnout Vandecappelle
  1 sibling, 1 reply; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-08-22 10:01 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Simek, Michal, luca.ceresoli, thomas.petazzoni, buildroot

Hi Yann,

> > This looks like your personal git tree, not the official one. (Yeah, 
> > I noticed your email address, but I would still have expected 
> > something under https://github.com/Xilinx/).
> I am working on this and am using my own personal github location in 
> the meantime to figure out how this could work with buildroot.

> Ah, I understand now. Next time, mark your patch as RFC.

I just submitted v2 of the patch set and will mark the patch set as RFC.

> > +if BR2_PACKAGE_VERSAL_FIRMWARE
> > +
> > +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> > +     string "versal firmware location"
> > The prompt should be "Custom git repository"
> Could you clarify this a bit?  Are you speaking of the BR2 name or the 
> string text when you say the prompt?

> The prompt is the ârt that is displayed to the user, i.e. the string between quotes after the option type, in this case:  "versal firmware location" should be replace with "Custom git repository".

> And of course, the astute reader you are noticed that the option name als needs a rename, BR2_PACKAGE_VERSAL_FIRMWARE_CUSTOM_GIT

> However, this will ultimately be uneeded, because the firmware files hould be downloadable login-less from an official location.

> So, the two options that specify the git tree location adn version are not needed. Just hard-code them in the .mk file

> So, the Config.in file should only contain (skeleton with abreviations, extend as/where appropriate):

>    config BR2_PKG_VERSAL_FW
>        bool "versal firmware
>        help
>          Firmware files the the Xilinx Versal familly of boards.

>         https://official.xilinix/location/github/whatever/

>    if BR2_PKG_VERSAL_FW

>    choice
>        bool "Versal board"

>    config BR2_PKG_VERSAL_FW_VCK190
>        bool "vck190

>    config BR2_PKG_VERSAL_FW_SOMETHING_ELSE
>        bool "something else"

>    endchoice

I have chosen not to use boolean choices for the board name.  When adding support for new boards,
I think it will be nicer to just add a new defconfig file for the new board without having to touch the
Config.in or versal-firmware.mk files again with each new board.

Plus, users can then select which board they want with the defconfig file as well without needing to go further.

>    config BR2_PKG_VERSAL_FW_BOARD
>        string
>        default "vck190" if BR2_PKG_VERSAL_FW_VCK190
>        default "something-else" if BR2_PKG_VERSAL_FW_SOMETHING_ELSE

>    endif

> and the .mk would look like:

>    VERSAL_FW_VERSION = 076d4b4f02b475dd9c65ad51992bfcad8d98b002
>    VERSAL_FW_SITE = $(call github,nealfrager,versal_boot,$(VERSALE_FW_VERSION))

>    VERSAL_FW_INSTALL_TARGET = NO
>    VERSAL_FIRMWARE_INSTALL_IMAGES = YES

>    define VERSAL_FW_INSTALL_IMAGES_CMDS
>        $(INSTALL) -D -m 0644 $(@D)/$(VERSAL_FW_BOARD)/boot.bin \
>            $(BINARIES_DIR)/boot.bin
>     endef

>    $(eval $(generic-package))

I have also chosen to keep the version configurable.  I think it is better for users to be able 
to choose their firmware version from the defconfig file.

> > +     help
> > +       Location of a versal firmware boot.bin.
> > +
> > +       The value should be a git repository.
> 
> > So, there is not even a default location?
> 
> The official default solution (aside from petalinux) is to clone the 
> embeddedsw github location and build the plm.elf and psmfw.elf from 
> that with a microblaze compiler.
> And then use bootgen to generate a boot.bin.
> While I can build u-boot and atf easily with buildroot, I do not have 
> a clean solution for building the plm and psmfw images and generating 
> the boot.bin.

> Yeah, I can see it being quite cumbersome. But it is not unheard of in Buildroot already. For example, we have package/arm-gnu-toolchain/ that provides a pre-built armv7 toolchain, that is used to buid the boot/arm-trusted-firmware/ in certain conditions.

> So, it would be technically possible to package a microblaze compiler like we've done for arm-gnu-toolchain, and use it to build the plm.elf and psmfw.elf from "the embeddedsw".

> But that is a bit of a stretch to go. Unless...

> This is why I am looking for a short term solution of just downloading 
> a prebuilt boot.bin.
> At the moment, distribution of pre-built binaries requires the 
> click-wrap downloading procedure which does not lend itself well for 
> an automated buildroot download.

> Above, you seemed to imply you were looking internally to lift this click-wrap restriction. If that is not possible, and you can't have the pre-built blobs hosted in an official Xilinx location, then downloading the "embeddedsw" and building them would be a fallback.

I believe lifting the click-wrap restriction should be possible.  I am working on getting my github officially supported like the ubuntu-firmware github below.

https://github.com/Xilinx/ubuntu-firmware/

My goal is to create a github like the following including the LICENSE file with the release location:

https://github.com/Xilinx/buildroot-firmware/

There is zero difference in the firmware files I plan to release for buildroot and the ones AMD has released for ubuntu, so it should be possible.

Stay tuned as I work on this...

> > Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.
> Same comment as above.  I was working from other examples of firmware 
> downloading to create this patch set, and I appreciate your feedback 
> for making it simpler.

> Looking at other examples is a good refelex! :-) But other may install more than one file at a time, so they need this complexity of conditional append-assignments. In your case, it is my understanding that only one file will ever be copied.

> > In the end, I don't think we should apply this package, as it looks 
> > like it tries to circumvent the official distrobution restrictions 
> > on these firmware files.
> I understand, and I hope to be able to come up with a solution.

> Great! In the meantime, as it is a WIP, I've marked the series as changes-requested in patchwork. Thanks for the feedback!

> If you have any ideas for how buildroot might be able to generate the 
> boot.bin, I am happy to receive any help.

> I hope the lead I pointed to above will be enough as a starting point for you. Do not hesitate to ask further if you have concerns.

> Thanks!

> Regards,
> Yann E. MORIN.

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-22 10:01       ` Frager, Neal via buildroot
@ 2022-08-23 19:49         ` Arnout Vandecappelle
  2022-08-24  6:43           ` Frager, Neal via buildroot
  0 siblings, 1 reply; 17+ messages in thread
From: Arnout Vandecappelle @ 2022-08-23 19:49 UTC (permalink / raw)
  To: Frager, Neal, Yann E. MORIN
  Cc: luca.ceresoli, Simek, Michal, thomas.petazzoni, buildroot



On 22/08/2022 12:01, Frager, Neal via buildroot wrote:
> Hi Yann,
> 
[snip]
>> The official default solution (aside from petalinux) is to clone the
>> embeddedsw github location and build the plm.elf and psmfw.elf from
>> that with a microblaze compiler.
>> And then use bootgen to generate a boot.bin.
>> While I can build u-boot and atf easily with buildroot, I do not have
>> a clean solution for building the plm and psmfw images and generating
>> the boot.bin.

  I don't know what the license is of embeddedsw, but if it allows 
redistribution of binaries, it's actually fine to host those binaries in your 
own repository. Just make sure that the repository contains a README explaining 
the situation (including the steps needed to rebuild the binaries), and the 
license files of all the sources that are used.


>> Yeah, I can see it being quite cumbersome. But it is not unheard of in Buildroot already. For example, we have package/arm-gnu-toolchain/ that provides a pre-built armv7 toolchain, that is used to buid the boot/arm-trusted-firmware/ in certain conditions.
> 
>> So, it would be technically possible to package a microblaze compiler like we've done for arm-gnu-toolchain, and use it to build the plm.elf and psmfw.elf from "the embeddedsw".
> 
>> But that is a bit of a stretch to go. Unless...
> 
>> This is why I am looking for a short term solution of just downloading
>> a prebuilt boot.bin.
>> At the moment, distribution of pre-built binaries requires the
>> click-wrap downloading procedure which does not lend itself well for
>> an automated buildroot download.
> 
>> Above, you seemed to imply you were looking internally to lift this click-wrap restriction. If that is not possible, and you can't have the pre-built blobs hosted in an official Xilinx location, then downloading the "embeddedsw" and building them would be a fallback.
> 
> I believe lifting the click-wrap restriction should be possible.  I am working on getting my github officially supported like the ubuntu-firmware github below.
> 
> https://github.com/Xilinx/ubuntu-firmware/
> 
> My goal is to create a github like the following including the LICENSE file with the release location:
> 
> https://github.com/Xilinx/buildroot-firmware/
> 
> There is zero difference in the firmware files I plan to release for buildroot and the ones AMD has released for ubuntu, so it should be possible.

  If there is no difference, why can't you just use the ones from ubuntu-firmware?

  Or does "zero difference" refer to how they are created, rather than the 
binaries themselves?


  Regards,
  Arnout


> 
> Stay tuned as I work on this...
> 
>>> Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.
>> Same comment as above.  I was working from other examples of firmware
>> downloading to create this patch set, and I appreciate your feedback
>> for making it simpler.
> 
>> Looking at other examples is a good refelex! :-) But other may install more than one file at a time, so they need this complexity of conditional append-assignments. In your case, it is my understanding that only one file will ever be copied.
> 
>>> In the end, I don't think we should apply this package, as it looks
>>> like it tries to circumvent the official distrobution restrictions
>>> on these firmware files.
>> I understand, and I hope to be able to come up with a solution.
> 
>> Great! In the meantime, as it is a WIP, I've marked the series as changes-requested in patchwork. Thanks for the feedback!
> 
>> If you have any ideas for how buildroot might be able to generate the
>> boot.bin, I am happy to receive any help.
> 
>> I hope the lead I pointed to above will be enough as a starting point for you. Do not hesitate to ask further if you have concerns.
> 
>> Thanks!
> 
>> Regards,
>> Yann E. MORIN.
> 
> Best regards,
> Neal Frager
> AMD
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-08-23 19:49         ` Arnout Vandecappelle
@ 2022-08-24  6:43           ` Frager, Neal via buildroot
  0 siblings, 0 replies; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-08-24  6:43 UTC (permalink / raw)
  To: Arnout Vandecappelle, Yann E. MORIN
  Cc: luca.ceresoli, Simek, Michal, thomas.petazzoni, buildroot

Hi Arnout,

> Hi Yann,
> 
> [snip]
>> The official default solution (aside from petalinux) is to clone the 
>> embeddedsw github location and build the plm.elf and psmfw.elf from 
>> that with a microblaze compiler.
>> And then use bootgen to generate a boot.bin.
>> While I can build u-boot and atf easily with buildroot, I do not have 
>> a clean solution for building the plm and psmfw images and generating 
>> the boot.bin.

>  I don't know what the license is of embeddedsw, but if it allows redistribution of binaries, it's actually fine to host those binaries in your own repository. Just make sure that the repository contains a README explaining the situation (including the steps needed to rebuild the binaries), and the license files of all the sources that are used.

You can find the licensing terms for the various files included with the Xilinx embeddedsw github below.

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

Basically, redistribution is indeed allowed.  And all files needed to build the versal boot.bin either came from Xilinx/embeddedsw, u-boot or atf github repos.

>> Yeah, I can see it being quite cumbersome. But it is not unheard of in Buildroot already. For example, we have package/arm-gnu-toolchain/ that provides a pre-built armv7 toolchain, that is used to buid the boot/arm-trusted-firmware/ in certain conditions.
> 
>> So, it would be technically possible to package a microblaze compiler like we've done for arm-gnu-toolchain, and use it to build the plm.elf and psmfw.elf from "the embeddedsw".
> 
>> But that is a bit of a stretch to go. Unless...
> 
>> This is why I am looking for a short term solution of just 
>> downloading a prebuilt boot.bin.
>> At the moment, distribution of pre-built binaries requires the 
>> click-wrap downloading procedure which does not lend itself well for 
>> an automated buildroot download.
> 
>> Above, you seemed to imply you were looking internally to lift this click-wrap restriction. If that is not possible, and you can't have the pre-built blobs hosted in an official Xilinx location, then downloading the "embeddedsw" and building them would be a fallback.
> 
> I believe lifting the click-wrap restriction should be possible.  I am working on getting my github officially supported like the ubuntu-firmware github below.
> 
> https://github.com/Xilinx/ubuntu-firmware/
> 
> My goal is to create a github like the following including the LICENSE file with the release location:
> 
> https://github.com/Xilinx/buildroot-firmware/
> 
> There is zero difference in the firmware files I plan to release for buildroot and the ones AMD has released for ubuntu, so it should be possible.

>  If there is no difference, why can't you just use the ones from ubuntu-firmware?

>  Or does "zero difference" refer to how they are created, rather than the binaries themselves?

There is a difference, actually.  When I refer to "zero" difference, I meant that all the binaries on the ubuntu-firmware github were built using the same source repos as what I wish to distribute.

However, the actual files I wish to distribute are not the same.  The versal boot.bin and zynqmp pmufw.bin files are not on the ubuntu-firmware repo at the moment.

For now, the ubuntu-firmware is only covering zynqmp products and not versal.  And since it uses bootgen for generating the boot.bin images, they distribute files in .elf format instead of .bin.
So for each zynqmp target, there is a pmufw.elf.

I have created a repo mirroring the ubuntu-firmware repo which uses the exact same LICENSE file.  
All I am missing is adding build instructions to my README.md file, and I should meet the requirements you have laid out.

https://github.com/nealfrager/buildroot-firmware

For the zynqmp pmufw.bin files, the steps are quite simple.  Download the pmufw.elf from the ubuntu-firmware repo and run the following:

mb-objcopy -O binary pmufw.elf pmufw.bin

For the versal boot.bin, I need to add a bit more instructions.

In any case, AMD is working on a new firmware repository to include all of our firmware release needs.  I am part of this internal discussion, and my vision is to get all these binaries on the official AMD firmware repository.

My question to all of you is then this:

If I update the README.md to include the build instructions for the various files, would you like to use my current repository as a short term solution?

Or would you prefer to wait until I am able to get all of these binaries part of an official AMD firmware repository?

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-11-03  7:46 ` Luca Ceresoli via buildroot
@ 2022-11-03  9:08   ` Frager, Neal via buildroot
  0 siblings, 0 replies; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-11-03  9:08 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: O'Neal, Terry, Chaplin, Kris, thomas.petazzoni, buildroot,
	Simek, Michal

Hi Luca,

> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,24 @@
> +#####################################################################
> +###########
> +#
> +# versal-firmware
> +#
> +#####################################################################
> +###########
> +
> +VERSAL_FIRMWARE_VERSION = $(call 
> +qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(call 
> +github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VE
> +RSION)) VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only 
> +VERSAL_FIRMWARE_LICENSE_FILES = LICENSE

> The LICENSE file appears like a "Xilinx-Binary-Only or
> GPL-2.0-or-later": https://github.com/nealfrager/buildroot-firmware/blob/main/LICENSE

Yes, you are right.  I will change it to the following:

VERSAL_FIRMWARE_LICENSE = "Xilinx-Binary-Only or GPL-2.0-or-later"

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 Neal Frager via buildroot
  2022-11-02 16:11 ` Frager, Neal via buildroot
  2022-11-02 16:44 ` Thomas Petazzoni via buildroot
@ 2022-11-03  7:46 ` Luca Ceresoli via buildroot
  2022-11-03  9:08   ` Frager, Neal via buildroot
  2 siblings, 1 reply; 17+ messages in thread
From: Luca Ceresoli via buildroot @ 2022-11-03  7:46 UTC (permalink / raw)
  To: Neal Frager
  Cc: terry.oneal, kris.chaplin, thomas.petazzoni, buildroot, michal.simek

Hi Neal,

On Mon, 24 Oct 2022 08:22:14 -0600
Neal Frager <neal.frager@amd.com> wrote:
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,24 @@
> +################################################################################
> +#
> +# versal-firmware
> +#
> +################################################################################
> +
> +VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(call github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only
> +VERSAL_FIRMWARE_LICENSE_FILES = LICENSE

The LICENSE file appears like a "Xilinx-Binary-Only or
GPL-2.0-or-later": https://github.com/nealfrager/buildroot-firmware/blob/main/LICENSE

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-11-02 16:44 ` Thomas Petazzoni via buildroot
@ 2022-11-02 17:10   ` Frager, Neal via buildroot
  0 siblings, 0 replies; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-11-02 17:10 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: O'Neal, Terry, luca.ceresoli, Chaplin, Kris, buildroot,
	Simek, Michal

Hi Thomas,

> Commit title should be:

> 	package/versal-firmware: new package

Ok.  No problem.

> diff --git a/DEVELOPERS b/DEVELOPERS
> index c8183b2290..ed696f4cd0 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2176,6 +2176,7 @@ F:	configs/zynqmp_zcu102_defconfig
>  F:	configs/zynqmp_zcu106_defconfig
>  F:	configs/zynqmp_kria_kv260_defconfig
>  F:	package/bootgen
> +F:	package/versal-firmware

> Final / needed here.

I saw this as well, and have fixed it for v2.

> diff --git a/package/versal-firmware/Config.in 
> b/package/versal-firmware/Config.in
> new file mode 100644
> index 0000000000..e184ba1925
> --- /dev/null
> +++ b/package/versal-firmware/Config.in
> @@ -0,0 +1,22 @@
> +config BR2_PACKAGE_VERSAL_FIRMWARE
> +	bool "versal-firmware"
> +	depends on BR2_aarch64
> +	help
> +	  Pre-built firmware files for Xilinx Versal boards.
> +
> +	  https://github.com/nealfrager/buildroot-firmware
> +
> +if BR2_PACKAGE_VERSAL_FIRMWARE
> +
> +config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
> +	string "versal firmware version"
> +	help
> +	  Release version of Versal firmware.

> Does it make sense to have the version configurable? If the version is configurable, then probably the location (Git repository) should also be configurable.

I can imagine users may not want to always update the boot firmware version.  
While I plan to keep the versal defconfig examples on the latest version available, I expect many users may want to build with older versions available on the repo.

We could make the repo location configurable as well, but normally, it should be coming from the Xilinx official github source which will be available soon.
My plan is to migrate this package to the Xilinx firmware repo as soon as it is available.

> How do we expect this to be used by people who design their own boards based on this SoC? Will they fork this repository? Do they have the source code to create their own firmware?

> Should the version have a default value?

> +config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
> +	string "versal board name"

> Should the board have a default value?

Yes, this is probably a good idea to make sure something gets picked up in case not specified.
For now, I will set the default to vck190 in the next update.

> Think of what happens when people just enable this package, without using a specific Buildroot defconfig. In particular, our autobuilders generate random Buildroot configurations, so they should build.

Ok.  Clear point.  I will set vck190 to the default, so that it always builds even if not specified.

> +	help
> +	  Name of Versal target board.
> +	  Used for installing the appropriate firmware boot.bin.
> +
> +endif # BR2_PACKAGE_VERSAL_FIRMWARE
> diff --git a/package/versal-firmware/versal-firmware.hash 
> b/package/versal-firmware/versal-firmware.hash
> new file mode 100644
> index 0000000000..7a8ea04c91
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256  
> +14c505cac0216637ab2d08590acffb4861446e480bdbf7417e699816048ab39b  
> +versal-firmware-v2022.2.tar.gz

> Having this hash value is a bit useless when the version is configurable.

Ok, I will remove the hash file, since the version is configurable.
I will also set the default version to latest available.

> +sha256  
> +f9796efcd98f47fb3e1d5d4c23e224613e91c70207b759a2087de368be50c315  
> +LICENSE
> diff --git a/package/versal-firmware/versal-firmware.mk 
> b/package/versal-firmware/versal-firmware.mk
> new file mode 100644
> index 0000000000..35dfbaa512
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,24 @@
> +#####################################################################
> +###########
> +#
> +# versal-firmware
> +#
> +#####################################################################
> +###########
> +
> +VERSAL_FIRMWARE_VERSION = $(call 
> +qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(call 
> +github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VE
> +RSION)) VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only 
> +VERSAL_FIRMWARE_LICENSE_FILES = LICENSE
> +
> +VERSAL_FIRMWARE_INSTALL_TARGET = NO
> +VERSAL_FIRMWARE_INSTALL_IMAGES = YES
> +
> +define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf \
> +	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf \
> +	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi \
> +	
> +$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pd
> +i

> Please indent the continuation line. But maybe this could be handle in a slightly better way:

>	$(foreach f,plm.elf psmfw.elf vpl_gen_fixed.pdi,\
> 		$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_$(f) \
>			$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_$(f)
>	)

Cool.  Thank you for this!  Looks much nicer this way.

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 Neal Frager via buildroot
  2022-11-02 16:11 ` Frager, Neal via buildroot
@ 2022-11-02 16:44 ` Thomas Petazzoni via buildroot
  2022-11-02 17:10   ` Frager, Neal via buildroot
  2022-11-03  7:46 ` Luca Ceresoli via buildroot
  2 siblings, 1 reply; 17+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-02 16:44 UTC (permalink / raw)
  To: Neal Frager
  Cc: terry.oneal, luca.ceresoli, kris.chaplin, buildroot, michal.simek

Hello,

Commit title should be:

	package/versal-firmware: new package

On Mon, 24 Oct 2022 08:22:14 -0600
Neal Frager <neal.frager@amd.com> wrote:


> diff --git a/DEVELOPERS b/DEVELOPERS
> index c8183b2290..ed696f4cd0 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2176,6 +2176,7 @@ F:	configs/zynqmp_zcu102_defconfig
>  F:	configs/zynqmp_zcu106_defconfig
>  F:	configs/zynqmp_kria_kv260_defconfig
>  F:	package/bootgen
> +F:	package/versal-firmware

Final / needed here.

> diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
> new file mode 100644
> index 0000000000..e184ba1925
> --- /dev/null
> +++ b/package/versal-firmware/Config.in
> @@ -0,0 +1,22 @@
> +config BR2_PACKAGE_VERSAL_FIRMWARE
> +	bool "versal-firmware"
> +	depends on BR2_aarch64
> +	help
> +	  Pre-built firmware files for Xilinx Versal boards.
> +
> +	  https://github.com/nealfrager/buildroot-firmware
> +
> +if BR2_PACKAGE_VERSAL_FIRMWARE
> +
> +config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
> +	string "versal firmware version"
> +	help
> +	  Release version of Versal firmware.

Does it make sense to have the version configurable? If the version is
configurable, then probably the location (Git repository) should also
be configurable.

How do we expect this to be used by people who design their own boards
based on this SoC? Will they fork this repository? Do they have the
source code to create their own firmware?

Should the version have a default value?

> +config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
> +	string "versal board name"

Should the board have a default value?

Think of what happens when people just enable this package, without
using a specific Buildroot defconfig. In particular, our autobuilders
generate random Buildroot configurations, so they should build.



> +	help
> +	  Name of Versal target board.
> +	  Used for installing the appropriate firmware boot.bin.
> +
> +endif # BR2_PACKAGE_VERSAL_FIRMWARE
> diff --git a/package/versal-firmware/versal-firmware.hash b/package/versal-firmware/versal-firmware.hash
> new file mode 100644
> index 0000000000..7a8ea04c91
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256  14c505cac0216637ab2d08590acffb4861446e480bdbf7417e699816048ab39b  versal-firmware-v2022.2.tar.gz

Having this hash value is a bit useless when the version is
configurable.

> +sha256  f9796efcd98f47fb3e1d5d4c23e224613e91c70207b759a2087de368be50c315  LICENSE
> diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
> new file mode 100644
> index 0000000000..35dfbaa512
> --- /dev/null
> +++ b/package/versal-firmware/versal-firmware.mk
> @@ -0,0 +1,24 @@
> +################################################################################
> +#
> +# versal-firmware
> +#
> +################################################################################
> +
> +VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_SITE = $(call github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
> +VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only
> +VERSAL_FIRMWARE_LICENSE_FILES = LICENSE
> +
> +VERSAL_FIRMWARE_INSTALL_TARGET = NO
> +VERSAL_FIRMWARE_INSTALL_IMAGES = YES
> +
> +define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf \
> +	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf \
> +	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf
> +	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi \
> +	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi

Please indent the continuation line. But maybe this could be handle in
a slightly better way:

	$(foreach f,plm.elf psmfw.elf vpl_gen_fixed.pdi,\
		$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_$(f) \
			$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_$(f)
	)

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 Neal Frager via buildroot
@ 2022-11-02 16:11 ` Frager, Neal via buildroot
  2022-11-02 16:44 ` Thomas Petazzoni via buildroot
  2022-11-03  7:46 ` Luca Ceresoli via buildroot
  2 siblings, 0 replies; 17+ messages in thread
From: Frager, Neal via buildroot @ 2022-11-02 16:11 UTC (permalink / raw)
  To: buildroot
  Cc: O'Neal, Terry, luca.ceresoli, Chaplin, Kris,
	thomas.petazzoni, Simek, Michal

Hello everyone,

Just a friendly reminder for feedback regarding the versal patch set.  Thank you!

---
This patch adds support for downloading versal microblaze firmware binaries.
These are necessary for booting Xilinx versal devices.

The location of these binaries is temporary, and will soon be added to the Xilinx firmware repository.  The temporary location is using the same free distribution license as the Xilinx firmware repository.

Once these files are available on the Xilinx repository, this package will be updated to the new location.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 DEVELOPERS                                   |  1 +
 package/Config.in                            |  1 +
 package/versal-firmware/Config.in            | 22 ++++++++++++++++++
 package/versal-firmware/versal-firmware.hash |  3 +++
 package/versal-firmware/versal-firmware.mk   | 24 ++++++++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 package/versal-firmware/Config.in  create mode 100644 package/versal-firmware/versal-firmware.hash
 create mode 100644 package/versal-firmware/versal-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index c8183b2290..ed696f4cd0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2176,6 +2176,7 @@ F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
 F:	package/bootgen
+F:	package/versal-firmware
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
 F:	package/uacme/
diff --git a/package/Config.in b/package/Config.in index e3a34d6e97..0abf233940 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -441,6 +441,7 @@ menu "Firmware"
 	source "package/sunxi-boards/Config.in"
 	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
+	source "package/versal-firmware/Config.in"
 	source "package/wilc-firmware/Config.in"
 	source "package/wilink-bt-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
new file mode 100644
index 0000000000..e184ba1925
--- /dev/null
+++ b/package/versal-firmware/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_VERSAL_FIRMWARE
+	bool "versal-firmware"
+	depends on BR2_aarch64
+	help
+	  Pre-built firmware files for Xilinx Versal boards.
+
+	  https://github.com/nealfrager/buildroot-firmware
+
+if BR2_PACKAGE_VERSAL_FIRMWARE
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
+	string "versal firmware version"
+	help
+	  Release version of Versal firmware.
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
+	string "versal board name"
+	help
+	  Name of Versal target board.
+	  Used for installing the appropriate firmware boot.bin.
+
+endif # BR2_PACKAGE_VERSAL_FIRMWARE
diff --git a/package/versal-firmware/versal-firmware.hash b/package/versal-firmware/versal-firmware.hash
new file mode 100644
index 0000000000..7a8ea04c91
--- /dev/null
+++ b/package/versal-firmware/versal-firmware.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  
+14c505cac0216637ab2d08590acffb4861446e480bdbf7417e699816048ab39b  
+versal-firmware-v2022.2.tar.gz
+sha256  
+f9796efcd98f47fb3e1d5d4c23e224613e91c70207b759a2087de368be50c315  
+LICENSE
diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
new file mode 100644
index 0000000000..35dfbaa512
--- /dev/null
+++ b/package/versal-firmware/versal-firmware.mk
@@ -0,0 +1,24 @@
+#######################################################################
+#########
+#
+# versal-firmware
+#
+#######################################################################
+#########
+
+VERSAL_FIRMWARE_VERSION = $(call 
+qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_SITE = $(call 
+github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERS
+ION)) VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only 
+VERSAL_FIRMWARE_LICENSE_FILES = LICENSE
+
+VERSAL_FIRMWARE_INSTALL_TARGET = NO
+VERSAL_FIRMWARE_INSTALL_IMAGES = YES
+
+define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi
+endef
+
+$(eval $(generic-package))
--
2.17.1

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

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

* [Buildroot] [PATCH v1 1/3] add package/versal-firmware
@ 2022-10-24 14:22 Neal Frager via buildroot
  2022-11-02 16:11 ` Frager, Neal via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Neal Frager via buildroot @ 2022-10-24 14:22 UTC (permalink / raw)
  To: buildroot
  Cc: terry.oneal, luca.ceresoli, kris.chaplin, thomas.petazzoni,
	Neal Frager, michal.simek

This patch adds support for downloading versal microblaze firmware binaries.
These are necessary for booting Xilinx versal devices.

The location of these binaries is temporary, and will soon be added to the
Xilinx firmware repository.  The temporary location is using the same free
distribution license as the Xilinx firmware repository.

Once these files are available on the Xilinx repository, this package will
be updated to the new location.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 DEVELOPERS                                   |  1 +
 package/Config.in                            |  1 +
 package/versal-firmware/Config.in            | 22 ++++++++++++++++++
 package/versal-firmware/versal-firmware.hash |  3 +++
 package/versal-firmware/versal-firmware.mk   | 24 ++++++++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 package/versal-firmware/Config.in
 create mode 100644 package/versal-firmware/versal-firmware.hash
 create mode 100644 package/versal-firmware/versal-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index c8183b2290..ed696f4cd0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2176,6 +2176,7 @@ F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
 F:	package/bootgen
+F:	package/versal-firmware
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
 F:	package/uacme/
diff --git a/package/Config.in b/package/Config.in
index e3a34d6e97..0abf233940 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -441,6 +441,7 @@ menu "Firmware"
 	source "package/sunxi-boards/Config.in"
 	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
+	source "package/versal-firmware/Config.in"
 	source "package/wilc-firmware/Config.in"
 	source "package/wilink-bt-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
new file mode 100644
index 0000000000..e184ba1925
--- /dev/null
+++ b/package/versal-firmware/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_VERSAL_FIRMWARE
+	bool "versal-firmware"
+	depends on BR2_aarch64
+	help
+	  Pre-built firmware files for Xilinx Versal boards.
+
+	  https://github.com/nealfrager/buildroot-firmware
+
+if BR2_PACKAGE_VERSAL_FIRMWARE
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
+	string "versal firmware version"
+	help
+	  Release version of Versal firmware.
+
+config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
+	string "versal board name"
+	help
+	  Name of Versal target board.
+	  Used for installing the appropriate firmware boot.bin.
+
+endif # BR2_PACKAGE_VERSAL_FIRMWARE
diff --git a/package/versal-firmware/versal-firmware.hash b/package/versal-firmware/versal-firmware.hash
new file mode 100644
index 0000000000..7a8ea04c91
--- /dev/null
+++ b/package/versal-firmware/versal-firmware.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  14c505cac0216637ab2d08590acffb4861446e480bdbf7417e699816048ab39b  versal-firmware-v2022.2.tar.gz
+sha256  f9796efcd98f47fb3e1d5d4c23e224613e91c70207b759a2087de368be50c315  LICENSE
diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
new file mode 100644
index 0000000000..35dfbaa512
--- /dev/null
+++ b/package/versal-firmware/versal-firmware.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# versal-firmware
+#
+################################################################################
+
+VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_SITE = $(call github,nealfrager,buildroot-firmware,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_LICENSE = Xilinx-Binary-Only
+VERSAL_FIRMWARE_LICENSE_FILES = LICENSE
+
+VERSAL_FIRMWARE_INSTALL_TARGET = NO
+VERSAL_FIRMWARE_INSTALL_IMAGES = YES
+
+define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_plm.elf
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_psmfw.elf
+	$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi \
+	$(BINARIES_DIR)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)_vpl_gen_fixed.pdi
+endef
+
+$(eval $(generic-package))
-- 
2.17.1

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

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

end of thread, other threads:[~2022-11-03  9:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager
2022-08-19  6:37 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager
2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
2022-08-20 17:52   ` Frager, Neal via buildroot
2022-08-20 19:17     ` Yann E. MORIN
2022-08-21  7:27       ` Frager, Neal via buildroot
2022-08-22 10:01       ` Frager, Neal via buildroot
2022-08-23 19:49         ` Arnout Vandecappelle
2022-08-24  6:43           ` Frager, Neal via buildroot
2022-08-21 19:06   ` Thomas Petazzoni via buildroot
2022-10-24 14:22 Neal Frager via buildroot
2022-11-02 16:11 ` Frager, Neal via buildroot
2022-11-02 16:44 ` Thomas Petazzoni via buildroot
2022-11-02 17:10   ` Frager, Neal via buildroot
2022-11-03  7:46 ` Luca Ceresoli via buildroot
2022-11-03  9:08   ` Frager, Neal via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.