All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/3] add package/versal-firmware
@ 2022-10-24 14:22 Neal Frager via buildroot
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager via buildroot
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ 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] 13+ messages in thread

* [Buildroot] [PATCH v1 2/3] add board/versal
  2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
@ 2022-10-24 14:22 ` Neal Frager via buildroot
  2022-11-02 16:38   ` Thomas Petazzoni via buildroot
  2022-11-03  8:14   ` Luca Ceresoli via buildroot
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager via buildroot
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ 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 board support for generating images for versal boards.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 DEVELOPERS                         |  1 +
 board/versal/genimage.cfg          | 30 +++++++++++++++++
 board/versal/post-build.sh         | 16 +++++++++
 board/versal/post-image.sh         | 35 +++++++++++++++++++
 board/versal/readme.txt            | 54 ++++++++++++++++++++++++++++++
 board/versal/vck190/uboot.fragment |  1 +
 6 files changed, 137 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
 create mode 100644 board/versal/vck190/uboot.fragment

diff --git a/DEVELOPERS b/DEVELOPERS
index ed696f4cd0..08095c9702 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2168,6 +2168,7 @@ F:	package/pkg-qmake.mk
 F:	package/qt5/qt5opcua/
 
 N:	Neal Frager <neal.frager@amd.com>
+F:	board/versal/
 F:	board/zynq/
 F:	board/zynqmp/
 F:	board/zynqmp/kria/
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..aad6813052
--- /dev/null
+++ b/board/versal/post-image.sh
@@ -0,0 +1,35 @@
+#!/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)"
+BOARD_NAME=$4
+
+mkdir -p "${BINARIES_DIR}"
+cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
+	the_ROM_image:
+	{
+	image {
+		{ type=bootimage, file=${BINARIES_DIR}/${BOARD_NAME}_vpl_gen_fixed.pdi }
+		{ type=bootloader, file=${BINARIES_DIR}/${BOARD_NAME}_plm.elf }
+		{ core=psm, file=${BINARIES_DIR}/${BOARD_NAME}_psmfw.elf }
+	}
+	image {
+		id = 0x1c000000, name=apu_subsystem 
+		{ type=raw, load=0x00001000, file=${BINARIES_DIR}/system.dtb }
+		{ core=a72-0, exception_level=el-3, trustzone, file=${BINARIES_DIR}/bl31.elf }
+		{ core=a72-0, exception_level=el-2, file=${BINARIES_DIR}/u-boot }
+	}
+	}
+	__HEADER_EOF
+
+${HOST_DIR}/bin/bootgen -arch versal -image ${BINARIES_DIR}/bootgen.bif -o ${BINARIES_DIR}/boot.bin -w on
+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.
diff --git a/board/versal/vck190/uboot.fragment b/board/versal/vck190/uboot.fragment
new file mode 100644
index 0000000000..961c4239bd
--- /dev/null
+++ b/board/versal/vck190/uboot.fragment
@@ -0,0 +1 @@
+CONFIG_DEFAULT_DEVICE_TREE="versal-vck190-rev1.1"
-- 
2.17.1

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

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

* [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig
  2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager via buildroot
@ 2022-10-24 14:22 ` Neal Frager via buildroot
  2022-11-02 16:11 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Frager, Neal via buildroot
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ 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 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 pre-built firmware images and use Xilinx bootgen
to generate the boot.bin for the vck190.

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

diff --git a/DEVELOPERS b/DEVELOPERS
index 08095c9702..4634a957ae 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2172,6 +2172,7 @@ F:	board/versal/
 F:	board/zynq/
 F:	board/zynqmp/
 F:	board/zynqmp/kria/
+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..d80dac8f4f
--- /dev/null
+++ b/configs/versal_vck190_defconfig
@@ -0,0 +1,37 @@
+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 vck190"
+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.2)/xlnx_rebase_v5.15_LTS_2022.2.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_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,arm-trusted-firmware,xlnx_rebase_v2.6_2022.2)/xlnx_rebase_v2.6_2022.2.tar.gz"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="versal"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,u-boot-xlnx,xlnx_rebase_v2022.01_2022.2)/xlnx_rebase_v2022.01_2022.2.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="xilinx_versal_virt"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/versal/vck190/uboot.fragment"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_PACKAGE_VERSAL_FIRMWARE=y
+BR2_PACKAGE_VERSAL_FIRMWARE_VERSION="v2022.2"
+BR2_PACKAGE_VERSAL_FIRMWARE_BOARD="vck190"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_BOOTGEN=y
-- 
2.17.1

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

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager via buildroot
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig 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
  4 siblings, 0 replies; 13+ 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] 13+ messages in thread

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

Hello Neal,

Please note that this is not a full review. Just some comments.

This PATCH 2/3 should be squashed with PATCH 3/3 into a single patch,
whose commit title should be:

	configs/versal_vck190: new defconfig

More comments below.

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


> 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

Meeh, I don't know if I like being that smart. What about having an
extlinux.conf file per board, and simplify this? Sometimes dumb is
better than smart/complicated.


> diff --git a/board/versal/vck190/uboot.fragment b/board/versal/vck190/uboot.fragment
> new file mode 100644
> index 0000000000..961c4239bd
> --- /dev/null
> +++ b/board/versal/vck190/uboot.fragment
> @@ -0,0 +1 @@
> +CONFIG_DEFAULT_DEVICE_TREE="versal-vck190-rev1.1"

This can be removed in favor of passing DEVICE_TREE=... in
BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS.

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

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
                   ` (2 preceding siblings ...)
  2022-11-02 16:11 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware 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
  4 siblings, 1 reply; 13+ 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] 13+ messages in thread

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

Hello Thomas,

> Please note that this is not a full review. Just some comments.

> This PATCH 2/3 should be squashed with PATCH 3/3 into a single patch, whose commit title should be:

>	configs/versal_vck190: new defconfig

Ok, no problem.

> More comments below.


> 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

> Meeh, I don't know if I like being that smart. What about having an extlinux.conf file per board, and simplify this? Sometimes dumb is better than smart/complicated.

I understand, and usually agree. This post_build.sh actually already exists in buildroot in the board/zynqmp directory.
The reason why it was done this way was because the kria kv260 uses a different serial port and sd card device than the zynqmp zcu boards.
We could be super smart and have versal use the same board/zynqmp/post-build.sh, but mixing zynqmp and versal is probably not so clean.
I could also revert to dumb and easy, but that creates additional extlinux.conf files everywhere.

As I will be maintaining these zynqmp and versal board files, my preference is to keep both the same style.  
Either both dumb with an extlinux.conf file per board or both smart/complicated.

With this in mind, what is your preference?

> diff --git a/board/versal/vck190/uboot.fragment 
> b/board/versal/vck190/uboot.fragment
> new file mode 100644
> index 0000000000..961c4239bd
> --- /dev/null
> +++ b/board/versal/vck190/uboot.fragment
> @@ -0,0 +1 @@
> +CONFIG_DEFAULT_DEVICE_TREE="versal-vck190-rev1.1"

> This can be removed in favor of passing DEVICE_TREE=... in BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS.

Ok, should I update all of the zynq, zynqmp and kria defconfigs as well?

Thanks for your review!

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

^ permalink raw reply	[flat|nested] 13+ 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; 13+ 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] 13+ messages in thread

* Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
  2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
                   ` (3 preceding siblings ...)
  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
  4 siblings, 1 reply; 13+ 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] 13+ messages in thread

* Re: [Buildroot] [PATCH v1 2/3] add board/versal
  2022-10-24 14:22 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager via buildroot
  2022-11-02 16:38   ` Thomas Petazzoni via buildroot
@ 2022-11-03  8:14   ` Luca Ceresoli via buildroot
  2022-11-03  9:03     ` Frager, Neal via buildroot
  1 sibling, 1 reply; 13+ messages in thread
From: Luca Ceresoli via buildroot @ 2022-11-03  8:14 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:15 -0600
Neal Frager <neal.frager@amd.com> wrote:

> --- /dev/null
> +++ b/board/versal/genimage.cfg
> @@ -0,0 +1,30 @@
> +image boot.vfat {
> +	vfat {
> +		files = {
> +			"boot.bin",
> +			"system.dtb",

system.dtb is stored in the FAT partition...

> --- /dev/null
> +++ b/board/versal/post-image.sh
> @@ -0,0 +1,35 @@
> +#!/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)"
> +BOARD_NAME=$4
> +
> +mkdir -p "${BINARIES_DIR}"
> +cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
> +	the_ROM_image:
> +	{
> +	image {
> +		{ type=bootimage, file=${BINARIES_DIR}/${BOARD_NAME}_vpl_gen_fixed.pdi }
> +		{ type=bootloader, file=${BINARIES_DIR}/${BOARD_NAME}_plm.elf }
> +		{ core=psm, file=${BINARIES_DIR}/${BOARD_NAME}_psmfw.elf }
> +	}
> +	image {
> +		id = 0x1c000000, name=apu_subsystem 
> +		{ type=raw, load=0x00001000, file=${BINARIES_DIR}/system.dtb }

...and also in boot.bin. What's the reason for this? One copy is for
U-Boot and the other for the kernel?

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

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

Hi Luca,

> --- /dev/null
> +++ b/board/versal/genimage.cfg
> @@ -0,0 +1,30 @@
> +image boot.vfat {
> +	vfat {
> +		files = {
> +			"boot.bin",
> +			"system.dtb",

> system.dtb is stored in the FAT partition...

The system.dtb in the FAT partition is for the Linux kernel.

> --- /dev/null
> +++ b/board/versal/post-image.sh
> @@ -0,0 +1,35 @@
> +#!/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)"
> +BOARD_NAME=$4
> +
> +mkdir -p "${BINARIES_DIR}"
> +cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
> +	the_ROM_image:
> +	{
> +	image {
> +		{ type=bootimage, file=${BINARIES_DIR}/${BOARD_NAME}_vpl_gen_fixed.pdi }
> +		{ type=bootloader, file=${BINARIES_DIR}/${BOARD_NAME}_plm.elf }
> +		{ core=psm, file=${BINARIES_DIR}/${BOARD_NAME}_psmfw.elf }
> +	}
> +	image {
> +		id = 0x1c000000, name=apu_subsystem 
> +		{ type=raw, load=0x00001000, file=${BINARIES_DIR}/system.dtb }

> ...and also in boot.bin. What's the reason for this? One copy is for U-Boot and the other for the kernel?

Yes, the system.dtb packaged inside the boot.bin is for u-boot.  

For versal products, the bootloader is the plm (platform loader and manager) which runs on a triple-redundant microblaze.
The plm does what the fsbl/spl does for zynq and zynqmp products.  It parses the images in the boot.bin and boots tf-a and u-boot.

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

^ permalink raw reply	[flat|nested] 13+ 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; 13+ 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] 13+ messages in thread

* [Buildroot] [PATCH v1 2/3] add board/versal
  2022-08-19  6:37 Neal Frager
@ 2022-08-19  6:37 ` Neal Frager
  0 siblings, 0 replies; 13+ 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] 13+ messages in thread

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 14:22 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager via buildroot
2022-10-24 14:22 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager via buildroot
2022-11-02 16:38   ` Thomas Petazzoni via buildroot
2022-11-02 16:56     ` Frager, Neal via buildroot
2022-11-03  8:14   ` Luca Ceresoli via buildroot
2022-11-03  9:03     ` Frager, Neal via buildroot
2022-10-24 14:22 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager via buildroot
2022-11-02 16:11 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware 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
  -- strict thread matches above, loose matches on Subject: below --
2022-08-19  6:37 Neal Frager
2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager

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.