[Buildroot] [PATCH 1/1] configs/zynqmp_zcu10x: Bump ATF/U-Boot/Linux to Xilinx 2021.2

Neal Frager nealf at xilinx.com
Thu Feb 3 06:20:52 UTC 2022


Hi Luca,

Thank you for your positive feedback.  Below you can find my thoughts.

Neal Frager
Embedded Processor Specialist
Xilinx

neal.frager at xilinx.com
Mobile: +33.6.48.11.37.36
www.linkedin.com/in/neal-frager-0397463

-----Original Message-----
From: Luca Ceresoli <luca at lucaceresoli.net> 
Sent: Wednesday 2 February 2022 23:29
To: Neal Frager <nealf at xilinx.com>; buildroot at buildroot.org
Cc: Neal Frager <nealf at xilinx.com>
Subject: Re: [PATCH 1/1] configs/zynqmp_zcu10x: Bump ATF/U-Boot/Linux to Xilinx 2021.2

CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.


Hi Neal,

thank you for your effort and for sending a patch in the format that is the most convenient for other people to review your code.

Your work seems generally in a good shape. I have several remarks, see below, but nothing really problematic.

On 02/02/22 17:55, Neal Frager wrote:
> Signed-off-by: Neal Frager <nealf at xilinx.com>

Maybe you can add more details before the Signed-off-by line, suah as "Also add a defconfig for ZCU102", "remove U-Boot and ATF patches not upstream"...

[Neal] Could you share the proper git commands for adding comments to a patch?  I would be happy to add more comments, but I am a bit new to git, and I do not know what commands I need to use.

First issue: this defconfig does not build on my PC:

$ git clean -xdf && make zynqmp_zcu106_defconfig && verynice make
package/pkg-generic.mk:266: *** BR2_GLOBAL_PATCH_DIR contains nonexistent directory board/zynqmp/patches/.  Stop.
$

As you removed all patches (which is sooo gooood!) you now have to remove the BR2_GLOBAL_PATCH_DIR.

[Neal] I have not seen this error on my side, but to fix it, I will just remove the BR2_GLOBAL_PATCH_DIR from the defconfigs.

> ---
>  board/zynqmp/genimage.cfg                     |   1 +
>  ...-fix-Remove-GGC-ignore-Warray-bounds.patch |  68 -------  
> ...64-zynqmp-zcu106-fix-SPL-MMC-booting.patch |  52 ------  
> ...2-arm64-zynqmp-Enable-booting-to-ATF.patch | 114 ------------  
> ...ept-an-absolute-path-for-PMUFW_INIT_.patch |  68 -------  
> ...ynqmp-pass-the-PS-init-file-as-a-kco.patch | 175 ------------------
>  configs/zynqmp_zcu102_defconfig               |  35 ++++
>  configs/zynqmp_zcu106_defconfig               |  15 +-
>  8 files changed, 44 insertions(+), 484 deletions(-)  delete mode 
> 100644 
> board/zynqmp/patches/arm-trusted-firmware/0001-Coverity-fix-Remove-GGC
> -ignore-Warray-bounds.patch  delete mode 100644 
> board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-bootin
> g.patch  delete mode 100644 
> board/zynqmp/patches/uboot/0002-arm64-zynqmp-Enable-booting-to-ATF.pat
> ch  delete mode 100644 
> board/zynqmp/patches/uboot/0003-arm64-zynqmp-accept-an-absolute-path-f
> or-PMUFW_INIT_.patch  delete mode 100644 
> board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init
> -file-as-a-kco.patch  create mode 100644 
> configs/zynqmp_zcu102_defconfig
>
> diff --git a/board/zynqmp/genimage.cfg b/board/zynqmp/genimage.cfg 
> index ed202f4550..557364e124 100644
> --- a/board/zynqmp/genimage.cfg
> +++ b/board/zynqmp/genimage.cfg
> @@ -3,6 +3,7 @@ image boot.vfat {
>               files = {
>                       "boot.bin",
>                       "u-boot.bin",
> +                     "u-boot.itb",

Is u-boot.bin still needed, when we have the .itb?

[Neal] u-boot.bin is no longer needed.  I can remove it.

> diff --git a/configs/zynqmp_zcu106_defconfig 
> b/configs/zynqmp_zcu106_defconfig index bee7c1daf7..3a6947e1e8 100644
> --- a/configs/zynqmp_zcu106_defconfig
> +++ b/configs/zynqmp_zcu106_defconfig
> @@ -1,11 +1,11 @@
>  BR2_aarch64=y
>  BR2_GLOBAL_PATCH_DIR="board/zynqmp/patches/"
> -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
>  BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynqmp/post-image.sh"
>  BR2_LINUX_KERNEL=y
>  BR2_LINUX_KERNEL_CUSTOM_GIT=y
>  BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Xilinx/linux-xlnx.git"
> -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.4"
> +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xlnx_rebase_v5.10_2021.2"
>  BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynqmp"
>  BR2_LINUX_KERNEL_DTS_SUPPORT=y
>  BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/zynqmp-zcu106-revA"
> @@ -14,21 +14,22 @@ 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_GIT=y
> -BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
> -BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.5"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/Xilinx/arm-trusted-firmware.git"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="xlnx_rebase_v2.4_2021.2"

As far as I remember (but I ask the core developers to confirm or deny), from the Buildroot perspective upstream versions are generally preferred even when they lack some non-fundamental features (e.g.: some drivers are missing) that are in vendor forks.

Is there a reason for switching ATF to the Xilinx fork? In this case explain it in the commit message, otherwise stay on the upstream repo, upgrading to the latest [working] release.

A similar question applies to kernel and U-Boot: is it possible to switch to upstream releases?

[Neal] I was trying to match the Xilinx tested software release 2021.2 with these patches.  The mainline Linux kernel is still missing quite a bit of the Xilinx drivers, so if a developer uses all mainline locations, there will be things that do not work properly.  The ATF should probably be ok, as it is almost identical to the Xilinx fork, but since I was already using the Xilinx fork for the Linux kernel and U-Boot, I thought it would be better to use the Xilinx tested fork for everything to remain consistent.

>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
>  BR2_TARGET_UBOOT=y
>  BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
>  BR2_TARGET_UBOOT_CUSTOM_GIT=y
>  BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://github.com/xilinx/u-boot-xlnx.git"
> -BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="228801a215909365ae1dcdd799034195ad7264f7"
> -BR2_TARGET_UBOOT_BOARD_DEFCONFIG="xilinx_zynqmp_zcu106_revA"
> +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xlnx_rebase_v2021.01_2021.2"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="xilinx_zynqmp_virt"

The "_virt" suffix looks strange to the uninitiated. IIRC it is the main, unified defconfig for all Xilinx kernels. Please add a line in the commit message so it is clear for everybody's benefit.

[Neal] Yes, I will add a comment on this when I learn the proper git command for adding comments.

>  BR2_TARGET_UBOOT_NEEDS_DTC=y
>  BR2_TARGET_UBOOT_SPL=y
>  BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>  BR2_TARGET_UBOOT_ZYNQMP=y
> -BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/53fdb7b6c92860ceb0ec5fd14deee302f4a84269/bin/pmufw-zcu106-default-v2017.4.bin"
> +BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2021.2.bin"

Please point to a tag, not a branch, or the file could be modified in the future, resulting in a non-reproducible build. Use:
https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/v2021.2/bin/pmufw-v2021.2.bin

[Neal] Good catch.  I will update this in the defconfigs.

Ouch, now the build I had started ended with a new error:

>>> arm-trusted-firmware xlnx_rebase_v2.4_2021.2 Building
...
  AR      .../build/zynqmp/release/lib/libc.a
  LD      .../build/zynqmp/release/bl31/bl31.elf
.../aarch64-buildroot-linux-uclibc-ld:
.../build/zynqmp/release/bl31/bl31.elf section `coherent_ram' will not fit in region `RAM'
.../aarch64-buildroot-linux-uclibc-ld: BL31 image has exceeded its limit.
.../aarch64-buildroot-linux-uclibc-ld: region `RAM' overflowed by 1 byte

I have run my build on Ubuntu 18.04 with your patch applied on current master.

I assume you have built and run it successfully. Any idea on why it fails on a different host?

[Neal] I have seen the ATF build error as well.  There seems to be an issue with the default buildroot aarch64-buildroot-linux-uclibc compiler when building the ATF.  I fixed the issue on my side by going into the output/build/arm-trusted-firmware-xlnx_rebase_v2.4_2021.2 and running the build with the aarch-none-elf compiler using the build command below.  Basically, changing nothing but the compiler.  Do you have any thoughts about how to fix this?

make CROSS_COMPILE=aarch64-none-elf- PLAT=zynqmp RESET_TO_BL31=1

--
Luca


More information about the buildroot mailing list