All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neal Frager <neal.frager@xilinx.com>
To: <buildroot@buildroot.org>
Cc: Neal Frager <neal.frager@xilinx.com>,
	michal.simek@amd.com, luca.ceresoli@bootlin.com,
	thomas.petazzoni@bootlin.com
Subject: [Buildroot] [PATCH v1 2/3] add board/versal
Date: Fri, 19 Aug 2022 00:37:16 -0600	[thread overview]
Message-ID: <20220819063717.33591-2-neal.frager@xilinx.com> (raw)
In-Reply-To: <20220819063717.33591-1-neal.frager@xilinx.com>

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

  reply	other threads:[~2022-08-19  6:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
2022-08-19  6:37 ` Neal Frager [this message]
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-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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220819063717.33591-2-neal.frager@xilinx.com \
    --to=neal.frager@xilinx.com \
    --cc=buildroot@buildroot.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.