zynq boards: use genimage and update kernel + u-boot
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
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
@@ -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
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:
Signed-off-by Luca Ceresoli <[email protected]>--- support/scripts/genimage.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)support/scripts/genimage.sh +0
-0
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
PATCH 2/9 zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca Ceresoli--- configs/zynq_zed_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zed_defconfig +2 -2
@@ -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
PATCH 2/9 zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)
Quoted 2 lines · Luca Ceresoli
[Run-time tested]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 30 lines
--- configs/zynq_zed_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)configs/zynq_zed_defconfig +2
-3@@ -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
PATCH 2/9 zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Run-time tested]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/9 zynq_zed: u-boot: bump to xilinx-v2017.3
In reply to Luca Ceresoli--- configs/zynq_zed_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zed_defconfig +1 -1
@@ -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
PATCH 3/9 zynq_zed: u-boot: bump to xilinx-v2017.3
Quoted 2 lines · Luca Ceresoli
[Run-time tested]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 24 lines
--- configs/zynq_zed_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/zynq_zed_defconfig +1
-2@@ -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
PATCH 3/9 zynq_zed: u-boot: bump to xilinx-v2017.3
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Run-time tested]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 4/9 zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca Ceresoli--- configs/zynq_microzed_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_microzed_defconfig +2 -2
@@ -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
PATCH 4/9 zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)
Quoted 2 lines · Luca Ceresoli
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 30 lines
--- configs/zynq_microzed_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)configs/zynq_microzed_defconfig +2
-3@@ -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
PATCH 4/9 zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 5/9 zynq_microzed: u-boot: bump to xilinx-v2017.3
In reply to Luca Ceresoli--- configs/zynq_microzed_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_microzed_defconfig +1 -1
@@ -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
PATCH 5/9 zynq_microzed: u-boot: bump to xilinx-v2017.3
Quoted 2 lines · Luca Ceresoli
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 24 lines
--- configs/zynq_microzed_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/zynq_microzed_defconfig +1
-2@@ -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
PATCH 5/9 zynq_microzed: u-boot: bump to xilinx-v2017.3
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 6/9 zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca Ceresoli--- configs/zynq_zc706_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
configs/zynq_zc706_defconfig +2 -2
@@ -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
PATCH 6/9 zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)
Quoted 2 lines · Luca Ceresoli
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 30 lines
--- configs/zynq_zc706_defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)configs/zynq_zc706_defconfig +2
-3@@ -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
PATCH 6/9 zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9)
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 7/9 zynq_zc706: u-boot: bump to xilinx-v2017.3
In reply to Luca Ceresoli--- configs/zynq_zc706_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/zynq_zc706_defconfig +1 -1
@@ -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
PATCH 7/9 zynq_zc706: u-boot: bump to xilinx-v2017.3
Quoted 2 lines · Luca Ceresoli
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Alistair
Quoted 24 lines
--- configs/zynq_zc706_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/zynq_zc706_defconfig +1
-2@@ -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
PATCH 7/9 zynq_zc706: u-boot: bump to xilinx-v2017.3
In reply to Luca CeresoliQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
[Build-tested only]Signed-off-by Luca Ceresoli <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 8/9 boards/zynq: rename the DTB to be loaded by U-Boot
In reply to Luca CeresoliWe 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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Signed-off-by Luca Ceresoli <[email protected]>--- 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.shboard/zynq/post-image.sh new file +1
-0@@ -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
PATCH 9/9 boards/zynq: use genimage to generate a bootable SD card image
In reply to Luca Ceresoli--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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]Signed-off-by Luca Ceresoli <[email protected]>--- 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.cfgboard/zynq/genimage.cfg new file +25
-0@@ -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@@ -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.cfgboard/zynq/readme.txt +7
-7@@ -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.txtconfigs/zynq_microzed_defconfig +0
-0
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
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@@ -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=yWe also need
Quoted 5 lines
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=yFor 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