Skip to contentSkip to conversation

zynq boards: use genimage and update kernel + u-boot

PATCH New Luca Ceresoli 3 participants 26 messages Dec 9, 2017 – Dec 12, 2017 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

cover zynq boards: use genimage and update kernel + u-boot

Hi,

this patchest switches the zynq-based boards to using genimage and updates U-Boot and the kernel to the latest Xilinx releases.

The first patch is a minor improvement to the genimage.sh script and is not strictly related to the rest of the series.

Luca

Luca Ceresoli (9):
support/scripts/genimage.sh: show usage when invoked incorrectly
zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)
zynq_zed: u-boot: bump to xilinx-v2017.3
zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)
zynq_microzed: u-boot: bump to xilinx-v2017.3
zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)
zynq_zc706: u-boot: bump to xilinx-v2017.3 boards/zynq: rename the DTB to be loaded by U-Boot boards/zynq: use genimage to generate a bootable SD card image

 board/zynq/genimage.cfg         | 25 +++++++++++++++++++++++++
 board/zynq/post-image.sh        | 13 +++++++++++++
 board/zynq/readme.txt           | 14 +++++++-------
 configs/zynq_microzed_defconfig |  8 +++++---
 configs/zynq_zc706_defconfig    |  8 +++++---
 configs/zynq_zed_defconfig      |  8 +++++---
 support/scripts/genimage.sh     |  6 +++++-
 7 files changed, 65 insertions(+), 17 deletions(-)
 create mode 100644 board/zynq/genimage.cfg
 create mode 100755 board/zynq/post-image.sh
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/9 support/scripts/genimage.sh: show usage when invoked incorrectly

---
 support/scripts/genimage.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
support/scripts/genimage.sh +5 -1
index 625afc108c82..5ed9f9c1ae1e 100755
@@ -1,7 +1,11 @@
 #!/usr/bin/env bash
 
 die() {
-  echo "Error: $@" >&2
+  cat <<EOF >&2
+Error: $@
+
+Usage: S{0} -c GENIMAGE_CONFIG_FILE
+EOF
   exit 1
 }
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/9 support/scripts/genimage.sh: show usage when invoked incorrectly

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

---
 support/scripts/genimage.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
support/scripts/genimage.sh +0 -0
index 625afc108c82..5ed9f9c1ae1e 100755

support/scripts/genimage.sh line 7

Quoted 8 lines
support/scripts/genimage.sh +4 -1
@@ -1,7 +1,11 @@
 #!/usr/bin/env bash
 
 die() {
-  echo "Error: $@" >&2
+  cat <<EOF >&2
+Error: $@
+
+Usage: S{0} -c GENIMAGE_CONFIG_FILE

This should presumably have been ${0}?

Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/9 zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)

In reply to Luca Ceresoli
[Run-time tested]
---
 configs/zynq_zed_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zed_defconfig +2 -2
index 5be8ecf534a2..1b03ad95a839 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/9 zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)

Quoted 2 lines · Luca Ceresoli
[Run-time tested]

Alistair

Quoted 30 lines
---
 configs/zynq_zed_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zed_defconfig +2 -3
index 5be8ecf534a2..1b03ad95a839 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#6 lore raw

PATCH 3/9 zynq_zed: u-boot: bump to xilinx-v2017.3

In reply to Luca Ceresoli
[Run-time tested]
---
 configs/zynq_zed_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zed_defconfig +1 -1
index 1b03ad95a839..cd815982f806 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_zed"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
Signature · 1 line
2.7.4
#7 lore raw

PATCH 3/9 zynq_zed: u-boot: bump to xilinx-v2017.3

Quoted 2 lines · Luca Ceresoli
[Run-time tested]

Alistair

Quoted 24 lines
---
 configs/zynq_zed_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zed_defconfig +1 -2
index 1b03ad95a839..cd815982f806 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_zed"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#9 lore raw

PATCH 4/9 zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)

In reply to Luca Ceresoli
[Build-tested only]
---
 configs/zynq_microzed_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_microzed_defconfig +2 -2
index f6e1599930f1..a3c25f9a0e7c 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
Signature · 1 line
2.7.4
#10 lore raw

PATCH 4/9 zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)

Quoted 2 lines · Luca Ceresoli
[Build-tested only]

Alistair

Quoted 30 lines
---
 configs/zynq_microzed_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_microzed_defconfig +2 -3
index f6e1599930f1..a3c25f9a0e7c 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#12 lore raw

PATCH 5/9 zynq_microzed: u-boot: bump to xilinx-v2017.3

In reply to Luca Ceresoli
[Build-tested only]
---
 configs/zynq_microzed_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_microzed_defconfig +1 -1
index a3c25f9a0e7c..acd2da584f32 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_microzed"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
Signature · 1 line
2.7.4
#13 lore raw

PATCH 5/9 zynq_microzed: u-boot: bump to xilinx-v2017.3

Quoted 2 lines · Luca Ceresoli
[Build-tested only]

Alistair

Quoted 24 lines
---
 configs/zynq_microzed_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_microzed_defconfig +1 -2
index a3c25f9a0e7c..acd2da584f32 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_microzed"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#15 lore raw

PATCH 6/9 zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)

In reply to Luca Ceresoli
[Build-tested only]
---
 configs/zynq_zc706_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zc706_defconfig +2 -2
index 86dea63e8356..378d19b2ac5f 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
Signature · 1 line
2.7.4
#16 lore raw

PATCH 6/9 zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)

Quoted 2 lines · Luca Ceresoli
[Build-tested only]

Alistair

Quoted 30 lines
---
 configs/zynq_zc706_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zc706_defconfig +2 -3
index 86dea63e8356..378d19b2ac5f 100644
@@ -2,12 +2,12 @@ BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2016.2"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#18 lore raw

PATCH 7/9 zynq_zc706: u-boot: bump to xilinx-v2017.3

In reply to Luca Ceresoli
[Build-tested only]
---
 configs/zynq_zc706_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zc706_defconfig +1 -1
index 378d19b2ac5f..1dcccd5635ac 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_zc706"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
Signature · 1 line
2.7.4
#19 lore raw

PATCH 7/9 zynq_zc706: u-boot: bump to xilinx-v2017.3

Quoted 2 lines · Luca Ceresoli
[Build-tested only]

Alistair

Quoted 24 lines
---
 configs/zynq_zc706_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zc706_defconfig +1 -2
index 378d19b2ac5f..1dcccd5635ac 100644
@@ -20,7 +20,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.1"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2017.3"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_zc706"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#21 lore raw

PATCH 8/9 boards/zynq: rename the DTB to be loaded by U-Boot

In reply to Luca Ceresoli

We are about to introduce genimage support for the Zynq boards. For all of them U-Boot loads the DTB from a file named "devicetree.dtb" so we need to rename it on the SD card image.

We could use genimage itself to rename files while creating the image. But this would require a different genimage.cfg for each board, leading to duplicate code.

Instead let's create a "devicetree.dtb" symlink pointing to the dtb listed in the configuration. Currently all the Zynq-based boards have only one DTS configured, but if one had two or more of them, the symlink would point to the first one.

---
 board/zynq/post-image.sh        | 11 +++++++++++
 configs/zynq_microzed_defconfig |  1 +
 configs/zynq_zc706_defconfig    |  1 +
 configs/zynq_zed_defconfig      |  1 +
 4 files changed, 14 insertions(+)
 create mode 100755 board/zynq/post-image.sh
board/zynq/post-image.sh new file +11 -0
new file mode 100755
index 000000000000..449f4a23725a
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# By default U-Boot loads DTB from a file named "devicetree.dtb", so
+# let's use a symlink with that name that points to the *first*
+# devicetree listed in the config.
+
+FIRST_DT=$(sed -n \
+           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
+           ${BR2_CONFIG})
+
+ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb
configs/zynq_microzed_defconfig +1 -0
index acd2da584f32..c6685a4bc189 100644
@@ -4,6 +4,7 @@ BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynq/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
configs/zynq_zc706_defconfig +1 -0
index 1dcccd5635ac..0bb8e3ba3d89 100644
@@ -4,6 +4,7 @@ BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynq/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
configs/zynq_zed_defconfig +1 -0
index cd815982f806..cfcfdff11c90 100644
@@ -4,6 +4,7 @@ BR2_ARM_ENABLE_NEON=y
 BR2_ARM_ENABLE_VFP=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynq/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
Signature · 1 line
2.7.4
#22 lore raw

PATCH 8/9 boards/zynq: rename the DTB to be loaded by U-Boot

Quoted 31 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

We are about to introduce genimage support for the Zynq boards. For all of them U-Boot loads the DTB from a file named "devicetree.dtb" so we need to rename it on the SD card image.

We could use genimage itself to rename files while creating the image. But this would require a different genimage.cfg for each board, leading to duplicate code.

Instead let's create a "devicetree.dtb" symlink pointing to the dtb listed in the configuration. Currently all the Zynq-based boards have only one DTS configured, but if one had two or more of them, the symlink would point to the first one.

---
 board/zynq/post-image.sh        | 11 +++++++++++
 configs/zynq_microzed_defconfig |  1 +
 configs/zynq_zc706_defconfig    |  1 +
 configs/zynq_zed_defconfig      |  1 +
 4 files changed, 14 insertions(+)
 create mode 100755 board/zynq/post-image.sh
board/zynq/post-image.sh new file +1 -0
new file mode 100755
index 000000000000..449f4a23725a
@@ -0,0 +1,11 @@
+#!/bin/sh

board/zynq/post-image.sh line 11

Quoted 10 lines
board/zynq/post-image.sh new file +10 -0
+
+# By default U-Boot loads DTB from a file named "devicetree.dtb", so
+# let's use a symlink with that name that points to the *first*
+# devicetree listed in the config.
+
+FIRST_DT=$(sed -n \
+           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
+           ${BR2_CONFIG})
+
+ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb

I've added a check for the empty string (E.G. in case you are not building a kernel / using this option) and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#23 lore raw

PATCH 9/9 boards/zynq: use genimage to generate a bootable SD card image

In reply to Luca Ceresoli
[Run-time tested on ZedBoard, build-tested on the other boards]
---
 board/zynq/genimage.cfg         | 25 +++++++++++++++++++++++++
 board/zynq/post-image.sh        |  2 ++
 board/zynq/readme.txt           | 14 +++++++-------
 configs/zynq_microzed_defconfig |  1 +
 configs/zynq_zc706_defconfig    |  1 +
 configs/zynq_zed_defconfig      |  1 +
 6 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 board/zynq/genimage.cfg
board/zynq/genimage.cfg new file +25 -0
new file mode 100644
index 000000000000..76e61c3a0987
@@ -0,0 +1,25 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"boot.bin",
+			"u-boot.img",
+			"devicetree.dtb",
+			"uImage"
+		}
+		file uramdisk.image.gz {
+			image = "rootfs.cpio.uboot"
+		}
+	}
+	size = 32M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+}
board/zynq/post-image.sh +2 -0
index 449f4a23725a..d7dde97b72ce 100755
@@ -9,3 +9,5 @@ FIRST_DT=$(sed -n \
            ${BR2_CONFIG})
 
 ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb
+
+support/scripts/genimage.sh -c board/zynq/genimage.cfg
board/zynq/readme.txt +7 -7
index c5506fe9668c..162734963a27 100644
@@ -14,13 +14,13 @@ Steps to create a working system for a Zynq board:
     make zynq_microzed_defconfig  (MicroZed)
 2) make
 3) All needed files will be available in the output/images directory.
-   Create a FAT32 partition at the beginning of your SD Card and copy files:
-     - boot.bin
-     - u-boot.img
-     - uImage
-     - uramdisk.image.gz (should be renamed from rootfs.cpio.uboot)
-     - devicetree.dtb (should be renamed from zynq-***.dtb)
-   into your SD card
+   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 uSD.
 4) boot your board
 
 You can alter the booting procedure by creating a file uEnv.txt
configs/zynq_microzed_defconfig +1 -0
index c6685a4bc189..98879cada04d 100644
@@ -28,3 +28,4 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y
configs/zynq_zc706_defconfig +1 -0
index 0bb8e3ba3d89..ffd5bce748d5 100644
@@ -28,3 +28,4 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y
configs/zynq_zed_defconfig +1 -0
index cfcfdff11c90..62525f7db8b1 100644
@@ -28,3 +28,4 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
2.7.4
#24 lore raw

PATCH 9/9 boards/zynq: use genimage to generate a bootable SD card image

Quoted 85 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

[Run-time tested on ZedBoard, build-tested on the other boards]
---
 board/zynq/genimage.cfg         | 25 +++++++++++++++++++++++++
 board/zynq/post-image.sh        |  2 ++
 board/zynq/readme.txt           | 14 +++++++-------
 configs/zynq_microzed_defconfig |  1 +
 configs/zynq_zc706_defconfig    |  1 +
 configs/zynq_zed_defconfig      |  1 +
 6 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 board/zynq/genimage.cfg
board/zynq/genimage.cfg new file +25 -0
new file mode 100644
index 000000000000..76e61c3a0987
@@ -0,0 +1,25 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"boot.bin",
+			"u-boot.img",
+			"devicetree.dtb",
+			"uImage"
+		}
+		file uramdisk.image.gz {
+			image = "rootfs.cpio.uboot"
+		}
+	}
+	size = 32M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+}
board/zynq/post-image.sh +2 -0
index 449f4a23725a..d7dde97b72ce 100755
@@ -9,3 +9,5 @@ FIRST_DT=$(sed -n \
            ${BR2_CONFIG})
 
 ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb
+
+support/scripts/genimage.sh -c board/zynq/genimage.cfg
board/zynq/readme.txt +7 -7
index c5506fe9668c..162734963a27 100644
@@ -14,13 +14,13 @@ Steps to create a working system for a Zynq board:
     make zynq_microzed_defconfig  (MicroZed)
 2) make
 3) All needed files will be available in the output/images directory.
-   Create a FAT32 partition at the beginning of your SD Card and copy files:
-     - boot.bin
-     - u-boot.img
-     - uImage
-     - uramdisk.image.gz (should be renamed from rootfs.cpio.uboot)
-     - devicetree.dtb (should be renamed from zynq-***.dtb)
-   into your SD card
+   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 uSD.
 4) boot your board
 
 You can alter the booting procedure by creating a file uEnv.txt
configs/zynq_microzed_defconfig +0 -0
index c6685a4bc189..98879cada04d 100644

configs/zynq_microzed_defconfig BR2_TARGET_UBOOT_NEEDS_OPENSSL=y · line 31

Quoted 4 lines
configs/zynq_microzed_defconfig +1 -0
@@ -28,3 +28,4 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y

We also need

BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y

For creating / populating the vfat image. Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#25 lore raw

PATCH 9/9 boards/zynq: use genimage to generate a bootable SD card image

Hi Peter,

Quoted 1 line · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

[...]

Quoted 12 lines

configs/zynq_microzed_defconfig BR2_TARGET_UBOOT_NEEDS_OPENSSL=y · line 31

Quoted 9 lines
configs/zynq_microzed_defconfig +1 -0
index c6685a4bc189..98879cada04d 100644
@@ -28,3 +28,4 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y

We also need

Quoted 5 lines

BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y

For creating / populating the vfat image. Committed with that fixed, thanks.

You're obviously right, sorry.

BTW, genimage is becoming quite an official tool in Buildroot. Shouldn't it be mentioned in the manual, along with the dosfstools and mtools dependencies?

Thanks,

Signature · 1 line
Luca