Commit Graph

979 Commits

Author SHA1 Message Date
Julien Olivain
248c2d045e boot/arm-trusted-firmware: add -no-pie to LDFLAGS
Arm Trusted Firmware (TF-A) v2.11 fails to build in some situations
with the error message:

    ld: build/qemu/release/bl1/bl1.elf: error: PHDR segment not covered by LOAD segment

This error can be reproduced with the commands:

    make qemu_aarch64_ebbr_defconfig
    utils/config --set-str BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE v2.11
    make olddefconfig
    make

This issue was reported in [1].

This error is coming from a check that was made more strict since
binutils ld 2.34. This error message is normally related to dynamic
linker, so it should normally not apply to a package like TF-A.

When BR2_SHARED_LIBS=y (shared libraries only) and BR2_PIC_PIE=y
(Build code with PIC/PIE), the Buildroot toolchain-wrapper will try
to enable position-independent code/executables. See [2]. This
configuration is a common default.

Arm Trusted Firmware (TF-A) build system, on its side, tries to detect
if the toolchain enables PIE automatically. It does so by checking if
--enable-default-pie is in the output of "$(CC) -v". If found, the TF-A
build system tries to disable PIE globally (it can be explicitly
enabled again with the ENABLE_PIE=1 build variable, in some specific
configurations). This detection mechanism is not working with the
Buildroot toolchain wrapper which is enabling PIE silently. See [3].

Commit 1061ed6c "boot/arm-trusted-firmware: add -fno-PIE to CFLAGS"
added the option -fno-PIE in CFLAGS for that reason. See [4].
TF-A >= v2.11 now needs the same treatment for LDFLAGS. This is
because TF-A switched the default linker from "ld" to "gcc", in
upstream commit [5]. This change makes the Buildroot toolchain wrapper
to enable PIE at link, without passing the "--no-dynamic-linker" option
that would normally avoids this ld error.

Also, even if there is no defconfigs using the
BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION config directive, it is
worth mentioning that the Buildroot TF-A "latest version" was updated
to v2.11 in commit 9c50759cd "boot/arm-trusted-firmware: bump to
v2.11". See [6]. This latest version is the default choice. So
Buildroot is subject to generate this build failure. This can be
reproduced with the commands:

    cat <<EOF >.config
    BR2_aarch64=y
    BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
    BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu"
    BR2_TOOLCHAIN_EXTERNAL=y
    EOF
    make olddefconfig
    make arm-trusted-firmware

This commit fixes the issue by adding the option "-no-pie" in LDFLAGS.
This will prevent the Buildroot toolchain wrapper to enable PIE, for
versions using "gcc" as a linker. This change should also remain
compatible with older TF-A < 2.11 using "ld" as a linker, since
"-no-pie" is also a valid ld option.

Fixes:

    ld: build/qemu/release/bl1/bl1.elf: error: PHDR segment not covered by LOAD segment

[1] https://github.com/TrustedFirmware-A/trusted-firmware-a/issues/26
[2] https://gitlab.com/buildroot.org/buildroot/-/blob/2024.08-rc3/toolchain/toolchain-wrapper.c?ref_type=tags#L403
[3] https://git.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a.git/+/refs/tags/v2.11.0/Makefile#711
[4] 1061ed6c62
[5] 2f1c5e7eb1%5E%21/
[6] 9c50759cd1

Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Tested-by: Vincent Stehlé <vincent.stehle@arm.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-09-03 23:58:40 +02:00
Thomas Petazzoni
e2f46ed03d boot/grub2: ignore CVE-2023-4001
This vulnerability is irrelevant to Buildroot, as it affects only some
downstream changes from Redhat.

See:

  https://security-tracker.debian.org/tracker/CVE-2023-4001
  https://www.openwall.com/lists/oss-security/2024/01/15/3

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-23 16:27:30 +02:00
Thomas Petazzoni
2495630383 boot/grub2: ignore CVE-2024-1048
As explained in:

  https://security-tracker.debian.org/tracker/CVE-2024-1048
  https://www.openwall.com/lists/oss-security/2024/02/06/3

CVE-2024-1048 is related to a tool called grub-set-bootflag which only
exists in the Redhat fork of Grub, and which we don't use in
Buildroot, so this CVE should be ignored.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-23 16:27:28 +02:00
Brandon Maier
db32d83e42 boot/uboot: use $(TARGET_OBJCOPY) for ZynqMP pmufw.elf
Converting the pmufw.elf to a binary works with any objcopy, regardless
if it's from the host or cross-compiler. Prefer to use the
$(TARGET_OBJCOPY) as it's always available and reproducible.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Reviewed-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-19 22:29:27 +02:00
Brandon Maier
273160552d boot/uboot: fix dependency on xilinx-prebuilt
When building with `make -j` and PER_PACKAGE_DIRECTORIES, a race
condition occurs between xilinx-prebuilt and u-boot, resulting in the
following error.

  objcopy -O binary -I elf32-little .../images/pmufw.elf .../images/pmufw.bin
  objcopy: '.../images/pmufw.elf': No such file

U-Boot registers a KCONFIG_FIXUP_CMD that uses the pmufw.elf from
xilinx-prebuilt. But KCONFIG_FIXUP_CMDS does not use the normal
DEPENDENCIES, so xilinx-prebuilt is not guaranteed to have run before
fixup.

Instead move the `objcopy` call out to a PRE_BUILD_HOOK so it will run
after xilinx-prebuilt has finished.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Tested-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-15 11:11:38 +02:00
Thomas Petazzoni
88e8f08fb6 boot/arm-trusted-firmware: also provide license info for LTS versions
This commit adds license information, and license file hashes for LTS
versions, by using per-version directories.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-07 23:56:25 +02:00
Bryan Brattlof
c48c3cf482 boot/arm-trusted-firmware: add lts-v2.10.x selection
There is a new lts-v2.10.x branch. Add it to the selection

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-07 23:47:40 +02:00
Bryan Brattlof
7f2cfcc8f4 boot/arm-trusted-firmware: bump lts-v2.8 to v2.8.20
bump the lts-v2.8.x branch to v2.8.20. Our patch still applies.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-07 23:36:15 +02:00
Bryan Brattlof
9c50759cd1 boot/arm-trusted-firmware: bump to v2.11
Update trusted-firmware-a to v2.11

The hash of the license file is updated due to this change:

    See the original `Linux MIT license`_.

+-  Some source files originating from the `Open Profile for DICE`_ project.
+   These files are licensed under the Apache License, Version 2.0, which is a
+   permissive license compatible with BSD-3-Clause. Any contributions to this
+   code must also be made under the terms of `Apache License 2.0`_.
+   These files are:
+
+   -  ``include/lib/dice/dice.h``
+
 .. _FreeBSD: http://www.freebsd.org
 .. _Linux MIT license: https://raw.githubusercontent.com/torvalds/linux/master/LICENSES/preferred/MIT
 .. _SCC: http://www.simple-cc.org/
+.. _Open Profile for DICE: https://pigweed.googlesource.com/open-dice/
+.. _Apache License 2.0: https://www.apache.org/licenses/LICENSE-2.0.txt
+

As we only document the main license of TF-A, BSD-3-Clause, this
change has no impact for us.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-07 23:34:16 +02:00
Bryan Brattlof
e1aacc3049 boot/arm-trusted-firmware: move to official source for tf-a
ARM_TRUSTED_FIRMWARE_SITE is currently pointing to the deprecated
ARM-software github read-only mirror[0] which is no longer publishing
new tags. They do have a newer github mirror under the TrustedFirmware-A
organization[1] which continues to receive tag updates we could use
however because of the way github generates tarballs changing the SITE
to point to TrustedFormware-A changes the pre-calculated hash values
for every version for everyone.

Without much way around changing all hash values if we want these latest
tags, lets drop the github mirrors and move to the official git
source[2] so we can download real tarballs which shouldn't change even
if the ARM_TRUSTED_FIRMWARE_SITE moves again and hopefully preventing
this from ever happening again.

[2] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/
[1] https://github.com/TrustedFirmware-A/trusted-firmware-a
[0] https://github.com/ARM-software/arm-trusted-firmware

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-07 23:10:17 +02:00
Neal Frager
549e4d8d9e boot/xilinx-prebuilt: support future AMD Vivado versions
When creating a hardware platform for AMD Versal devices with the AMD Vivado
Design Suite, the resulting XSA file has a file named "psm_fw.elf" included.
This does not match the "psmfw.elf" filename that users will get when building
the boot firmware from the Xilinx GIT repository.

A change request has been submitted to resolve this issue, so that future
AMD Vivado Design Suite versions will generate XSA files including the boot
firmware file named "psmfw.elf" to match the filename that is generated when
building the firmware.

In order to support both current and future versions of AMD Vivado Design
Suite, this patch changes the xilinx-prebuilt package to use the filename
"psm*fw.elf" when obtaining the Versal boot firmware images from a user
generated XSA file.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-29 19:43:16 +02:00
Bryan Brattlof
e30d507cbb boot/optee-os: bump to 4.3.0
Update OP-TEE to its latest tag

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-23 10:50:55 +02:00
Brandon Maier
4c4afb4157 boot/uboot: fix Kconfig warning for DEFAULT_ENV_FILE
The following warning occurs from commit "boot/uboot: allow taking the
entire default environment from a text file".

  boot/uboot/Config.in:141:warning: config symbol
  'BR2_TARGET_UBOOT_DEFAULT_ENV_FILE' uses select, but is not bool or
  tristate

Add a hidden 'bool' config so we can enable dependencies.

In addition, the DEFAULT_ENV_FILE works by setting Kconfig options,
therefore we also need to depend on
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-22 18:29:14 +02:00
Luca Ceresoli
9ba1fa13e4 boot/uboot: allow taking the entire default environment from a text file
By default U-Boot builds a default environment from its own configuration
and a board-specific set of variables. However it also allows to bypass
this entirely and define the entire default environment from a text file.

Expose this feature to Buildroot. This allows to have a file e.g. in
board/.../uboot.env which contains an easy to maintain text file with the
wanted default environment, without patching the U-Boot source code.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-07-15 16:46:05 +02:00
Kory Maincent
664f02a60c boot/optee-os: Add support to build with host-cmake
Some specific versions of OP-TEE need cmake on the host to build the scmi
firmware, like the newly release STMicroelectronics 3.19.0-stm32mp-r2
version.

To allow building such OP-TEE OS versions, this commit adds the option
BR2_TARGET_OPTEE_OS_NEEDS_CMAKE which when enabled ensures that host-cmake
is built before OP-TEE OS.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
[Arnout: use BR2_CMAKE_HOST_DEPENDENCY]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-07-15 16:34:23 +02:00
Dario Binacchi
84fc147309 boot/uboot: bump to version 2024.07
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-14 17:09:11 +02:00
Brandon Maier
1dcb311afe boot/xilinx-prebuilt: support custom boards using XSA
The xilinx-prebuilt package only supports development boards that Xilinx
has published firmware for. Custom designs based on the Xilinx platform
must generate their own firmware using the AMD Vivado Design Suite.

Vivado produces an XSA file, which is a Zip file containing all the
firmware needed by xilinx-prebuilt. We extend xilinx-prebuilt to
download custom XSA files and extract their contents.

Reviewed-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
[Romain: add a comment about the custom PSMFW file name.]
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-07-13 21:50:16 +02:00
Romain Naour
a226f9a9ca boot/beaglev-ddrinit: remove package
The beaglev-ddrinit was meant for the BeagleV-Starlight
board (beaglev_defconfig) but the support was removed.

Remove beaglev-ddrinit too.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-13 16:53:04 +02:00
Romain Naour
eba5339c12 boot/beaglev-secondboot: remove package
The beaglev-secondboot was meant for the BeagleV-Starlight
board (beaglev_defconfig) but the support was removed.

Remove beaglev-secondboot too.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-13 16:52:59 +02:00
Yann E. MORIN
4cb762efa4 boot/ti-k3-r5-loader: share download files with uboot
ti-k3-r5-loader is just a U-Boot SPL running on the R5 core on TI's K3
processors, so it makes sense to just share the downloads with U-Boot.

With commit ebe238f2b5 (package/pkg-download: use _DL_SUBDIR as root
dir of generated archives), the root of the generated archive will also
be based on _DL_SUBDIR, but the name of the archive, _SOURCE, is still
based on the current package unless explicitly set. For ti-k3-r5-loader,
that would create an archive which fiename does not match its root
directory; although Buildroot does not care (we --strip-components=1
when extracting), this would be a bit surprising to anyone manually
extrating the archive, as it diverges from the usual expectations.

Do like we do for linux-headers, and force the ti-k3-r4-loader archive
filename to be u-boot-VERSION.tar.gz

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Anand Gadiyar <gadiyar@ti.com>
Cc: Bryan Brattlof <bb@ti.com>
Cc: Xuanhao Shi <X15000177@gmail.com>
Cc: Paresh Bhagat <p-bhagat@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-07-12 17:18:48 +02:00
Lance Fredrickson
3b9d62dac5 boot/syslinux: fix building with GCC 14.x
Add missing stdio.h include. Without this includes, the build fails
with the following error under GCC 14.x:

../../../com32/lib/syslinux/debug.c: In function ‘syslinux_debug’:
../../../com32/lib/syslinux/debug.c:91:5: error: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   91 |     printf("Dynamic debug unavailable\n");

Signed-off-by: Lance Fredrickson <lancethepants@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-10 22:20:25 +02:00
Neal Frager
cef0948f82 boot/xilinx-prebuilt: fix comment typo
Correct the spelling of the word 'there' in the comment.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-06-30 16:57:10 +02:00
Neal Frager
525695a445 boot/xilinx-prebuilt/xilinx-prebuilt.mk: simplify variables
This patch reduces the xilinx-prebuilt package to a single install variable
that changes depending on device family variant.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-06-30 16:36:12 +02:00
Dario Binacchi
d2c26c125e boot/syslinux: update the patches to be applied with fuzz 0
This commit allows the syslinux patches to be applied with fuzz factor 0.
The fuzz factor specifies how many lines of the patch can be inexactly
matched, so the value 0 requires all lines to be exactly matched.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-06-24 21:29:50 +02:00
Neal Frager
1fbeeb23c8 package/versal-firmware: remove package
This patch removes the package/versal-firmware as this package is replaced
by the boot/xilinx-prebuilt target boot firmware package.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Brandon Maier <brandon.maier@collins.com>
[yann.morin.1998@free.fr: handle legacy]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-06-15 23:16:54 +02:00
Neal Frager
35a4ec0553 boot/uboot.mk: new zynqmp pmufw prebuilt option
The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT option will enable u-boot to
use the xilinx-prebuilt package for downloading a pmufw.elf that gets included
in the generated boot.bin.

If the BR2_TARGET_UBOOT_ZYNQMP_PMUFW_PREBUILT option is enabled, then the
BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw will
be ignored.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Brandon Maier <brandon.maier@collins.com>
[yann.morin.1998@free.fr:
  - add 'custom' to prompt for BR2_TARGET_UBOOT_ZYNQMP_PMUFW
  - fix checkpackage
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-06-15 23:09:35 +02:00
Neal Frager
a6648ad8da boot/xilinx-prebuilt: new boot package
This patch add a new boot package for downloading prebuilt firmware for Xilinx
versal and zynqmp evaluation boards.

It solves the problem of being able to verify the hash when downloading a
prebuilt zynqmp pmufw.elf binary.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Brandon Maier <brandon.maier@collins.com>
[yann.morin.1998@free.fr:
  - move the hash file to the package dir, not the board dir
  - move board name after familly choice
  - add default board name for each family
  - qstrip the Kconfig strings before use
  - introduce XILINX_PREBUILT_BOARD_DIR to simplify paths
  - explain the *.pdi glob
  - simplify non-versal install
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-06-15 23:09:31 +02:00
Peter Korsgaard
08bd2bc482 boot/at91dataflashboot: remove package
At91dataflashboot is an ancient (2006) fork of at91bootstrap1 specifically
for the Atmel/Microchip AT45 series (dataflash) of serial flashes.

The package hasn't seen any meaningful updates since, is not used by any
defconfigs and at91bootstrap3 nowadays has AT45 support - So remove the
package.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[yann.morin.1998@free.fr: update .checkpackageignore]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-06-03 22:53:30 +02:00
Peter Korsgaard
d9d4be3ca5 boot/at91bootstrap: remove package
The upstream is no longer available, no defconfigs use it and the package
has been replaced 12 years ago with at91bootstrap3 with commit ca0d69c61c
(at91bootstrap3: new package), so remove it.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[yann.morin.1998@free.fr: update .checkpackageignore]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-06-03 22:53:18 +02:00
Yann E. MORIN
de5ed80212 {boot, package}: update hashes for generated archives
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-05-09 22:45:11 +02:00
Yann E. MORIN
d8000791e3 {boot, package}: update hashes of git, svn, go, and cargo archives
Replace all git and svn packages archive names in hash files:

    $ sed -r -i -e 's/-br2/-git3/; s/-br3/-svn4/' $(
        git grep -l -E -- '-br2|-br3' '*.hash'
    )

    $ sed -r -i -e 's/(\.tar\.gz)$/-go1\1/' $(
        git grep -l -E '\$\(eval \$\((host-)?golang-package\)\)' '*.mk' \
        |sed -r -e 's/\.mk$/.hash/' \
        |sort -u
    )

    $ sed -r -i -e 's/(\.tar\.gz)$/-cargo1\1/' $(
        git grep -l -E '\$\(eval \$\((host-)?cargo-package\)\)' '*.mk' \
        |sed -r -e 's/\.mk$/.hash/' \
        |sort -u
    )

Then a bit of make source (based on: git diff --name-only), a lot of
sweat, and carefully checking the new archives to verify that only
modes have changed...

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-05-09 22:45:02 +02:00
Yann E. MORIN
32dcc92655 *: update filename for git-download packages
The version suffix for the git-generated archives has changed, so update
the filenames accordingly in the hash files. The content of the archives
has not changed, though.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-05-09 22:44:55 +02:00
Bryan Brattlof
ae6d1f7375 boot/ti-k3-boot-firmware: bump to version 09.02.00.009
The 09.02.00.009 release of ti-linux-firmware has the latest updates to
TI's TIFS, DM and DMSC firmware needed for the K3 generation of
processors. Update to pull in these latest updates.

Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-06 22:04:51 +02:00
Bryan Brattlof
7ff2c03287 boot/ti-k3-r5-loader: bump to version v2024.04
The ti-k3-r5-loader is just U-Boot with a different defconfig compiled
for the 32b MCU cores needed for TI's K3 generation of SoCs. Update to
match the U-Boot version

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-06 22:04:37 +02:00
Bryan Brattlof
b95b775293 boot/uboot: bump to version v2024.04
Update to the latest tagged release of U-Boot

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-06 22:04:02 +02:00
Bryan Brattlof
314e9549a4 boot/optee-os: bump to release v4.2.0
Bump OP-TEE to the latest tagged release

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-06 22:03:21 +02:00
Peter Seiderer
e86aec1663 boot/barebox/Config.in: source argument needs quotation marks
Fixes the following error/warnings with kconfig from linux-6.9-rc5:

  boot/barebox/Config.in:79: syntax error
  boot/barebox/Config.in:79:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:79:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:79:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:79:warning: ignoring unsupported character '.'
  boot/barebox/Config.in:79: invalid statement
  boot/barebox/Config.in:93: syntax error
  boot/barebox/Config.in:93:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:93:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:93:warning: ignoring unsupported character '/'
  boot/barebox/Config.in:93:warning: ignoring unsupported character '.'
  boot/barebox/Config.in:93: invalid statement

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-06 20:59:26 +02:00
Romain Naour
91b1de167e boot/{uboot, ti-k3-r5-loader}: remove unneeded python-jsonschema dependency
Commits 8a4c3c91e7 ("boot/ti-k3-r5-loader: add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option")
and 1aec483412 ("boot/uboot: add BR2_TARGET_UBOOT_USE_BINMAN option")
added the python-jsonschema (target variant) dependency to the binman
option while only host-python-jsonschema is required.

http://lists.busybox.net/pipermail/buildroot/2024-April/689291.html

Reported-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-05-06 12:50:02 +02:00
Romain Naour
e4d07f8d81 boot/uboot: remove BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
As suggested by Arnout during the review [1], we can assume that U-Boot
needs ti-k3-boot-firmware when it is selected (likely by
ti-k3-r5-loader).

We can remove BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE without
legacy handling since this option is not part of any Buildroot
release.

[1] http://lists.busybox.net/pipermail/buildroot/2024-April/689263.html

Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-05-06 12:49:29 +02:00
Brandon Maier
a8c7a53985 boot/arm-trusted-firmware: enable verbose output
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-05-05 15:38:41 +02:00
Gero Schwäricke
e4981d6756 ti-k3-r5-loader: support devicetree customization
This is duplicated from the U-Boot makefile & Kconfig.

Similarly to U-Boot custom boards sometimes need to adjust the U-Boot
devicetree. For example, the AM64x SDRAM controller supports inline ECC
which needs to be enabled in the R5 loader devicetree.

Please note that some versions of U-Boot have broken external devicetree
support and may require manual patching to build. See commit [1]
in the U-Boot tree.

[1] 3609e1dc5f

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Signed-off-by: Gero Schwäricke <gero.schwaericke@grandcentrix.net>
[Romain: add gitlab URL]
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-05-01 23:50:26 +02:00
Heiko Thiery
3dbbc0ae9f uboot/uboot: add new dependency to yamllint
Since U-Boot 2024.04 [1] binman also uses yamllint as dependency [2].

[1] https://source.denx.de/u-boot/u-boot/-/commit/10fee88d42f
[2] https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt?ref_type=tags#L3

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-04-12 17:48:54 +02:00
Heiko Thiery
9cda68a7ee boot/ti-k3-r5-loader: add dependency to yamllint
Since U-Boot 2024.04 [1] binman also uses yamllint as dependency [2].

[1] https://source.denx.de/u-boot/u-boot/-/commit/10fee88d42f
[2] https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt?ref_type=tags#L3

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2024-04-12 17:48:50 +02:00
Romain Naour
e5d8cd5173 boot/ti-k3-r5-loader: remove BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN
Since all AM62 and AM64 defconfig has been updated to use binman
and ti-k3-image-gen has been removed, binman is now mandatory
for all TI K3 SoC. So remove BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN
option since since it can't be disabled anymore.

We can remove BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN without
legacy handling since this option is not part of any Buildroot
release.

While at it, add one more like to binman dependencies in comments.

Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-04-09 14:12:09 +02:00
Romain Naour
1e6f6252fd boot/ti-k3-image-gen: remove package
ti-k3-image-gen tool is deprecated an replaced by binman [1].

All defconfig that was using it have been updated to use U-boot
binman tool instead.

So, we can safely remove ti-k3-image-gen package.

[1] https://git.yoctoproject.org/meta-ti/commit/?id=835811cf8586926cf78a961d090f4e6150432235

Cc: Anand Gadiyar <gadiyar@ti.com>
Cc: Xuanhao Shi <X15000177@gmail.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-04-09 14:12:09 +02:00
Romain Naour
364e153e6a boot/uboot: remove BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
Previoulsy (without binman), when a TI K3 SoC using Combined binary
with a split firmware boot method was used (am62ax or am62x) [1], the
user had to select BR2_TARGET_UBOOT_NEEDS_TI_K3_DM in the defconfig
to provide Device Manager firmware provided by ti-k3-boot-firmware.

With binman, this option is no longer necessary since
ti-k3-boot-firmware package is already in the u-boot dependency and the
path to DM and SYSFW binaries are provided by BINMAN_INDIRS.

We are going to remove ti-k3-image-gen, so binman is now mandatory on
all TI K3 SoCs.

[1] 52ce606c05

Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-04-09 14:12:08 +02:00
Dario Binacchi
6439a10e98 boot/ti-k3-r5-loader: install tiboot3.bin and sysfw.itb to BINARIES_DIR
With binman support enabled, u-boot for k3 r5 core (ti-k3-r5-loader)
install different target image (tiboot3*.bin) depending on the K3
SoC boot ROM:

- General Purpose devices (gp)
- High Security - Field Securable devices (hs-fs)
- High Security - Security Enforcing devices (hs)

An additional firmware binary is required on certain TI K3 devices such
as AM65 and J721e due to the "Split binary" boot flow [1]:

- Split binary with a combined firmware: (eg: AM65)
- Combined binary with a combined firmware: (eg: AM64)
- Split binary with a split firmware: (eg: J721E)
- Combined binary with a split firmware: (eg: AM62)

K3 SoC using Split Binary Boot Flow also requires sysfw-*.itb file
to boot (eg: am65, j721e). Only tiboot3*.bin is needed for other
boot flow.

From [1]:
"It's important to rename the generated tiboot3.bin and sysfw.itb
to match exactly tiboot3.bin and sysfw.itb as ROM and the wakeup
UBoot SPL will only look for and load the files with these names."

See the (not exhaustive) list of all tiboot3*.bin and sysfw*.itb file
variant found in meta-ti:

  meta-ti-bsp/conf/machine/beaglebone-ai64-k3r5.conf:UBOOT_IMAGE = "tiboot3-${MAINMACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
  meta-ti-bsp/conf/machine/beaglebone-ai64-k3r5.conf:UBOOT_SYMLINK = "tiboot3-${MAINMACHINE}.${UBOOT_SUFFIX}"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62pxx.inc:IMAGE_BOOT_FILES += "tiboot3-am62px-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "tiboot3-am65x_sr2-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "tiboot3-am65x_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e_sr1_1-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721s2.inc:IMAGE_BOOT_FILES += "tiboot3-j721s2-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j721s2.inc:IMAGE_BOOT_FILES += "tiboot3-j721s2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j722s.inc:IMAGE_BOOT_FILES += "tiboot3-j722s-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j784s4.inc:IMAGE_BOOT_FILES += "tiboot3-j784s4-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j784s4.inc:IMAGE_BOOT_FILES += "tiboot3-j784s4-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/k3r5.inc:SPL_BINARY = "tiboot3-${SYSFW_SOC}-${SYSFW_SUFFIX}-${SYSFW_CONFIG}.${SPL_SUFFIX}"

  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw.itb"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw-am65x_sr2-gp-evm.itb"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw-am65x_sr2-hs-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e-gp-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e_sr2-hs-fs-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e_sr1_1-hs-evm.itb"

This firmware list can also be verified with the firmware name used in
the u-boot devicetree k3-*-binman.dtsi files.

On the SK-AM62B-P1, three tiboot3 binaries are built, one for each boot
ROM variant:

  tiboot3-am62x-gp-evm.bin
  tiboot3-am62x-hs-evm.bin
  tiboot3-am62x-hs-fs-evm.bin

A tiboot3.bin symlink is provided as default choice:

  tiboot3.bin -> tiboot3-am62x-hs-fs-evm.bin

On this board, the tiboot3.bin symlink links to the hs-fs variant
but it not always de case for all TI K3 devices.
(ex: J721e use gp variant by default).

The tiboot3.bin symlink links the -gp, -hs-fs, -hs tiboot3 binary
according to where "symlink = "tiboot3.bin";" line is located in
k3-*binman.dtsi.

As reported by Michael Walle [2], such firmware name can also be
customized by a SBC vendor [3], so we can't always be sure which
firmware to use.

If required, let the user provide a custom tiboot3 or sysfw firmware
name from the defconfig. Otherwise use the default firmware choice
by copying tiboot3.bin and sysfw.itb symlinks.

[1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/doc/board/ti/k3.rst
[2] http://lists.busybox.net/pipermail/buildroot/2024-April/688943.html
[3] https://elixir.bootlin.com/u-boot/v2024.04/source/arch/arm/dts/k3-am625-phycore-som-binman.dtsi#L14

Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2024-04-09 13:59:22 +02:00
Dario Binacchi
1aec483412 boot/uboot: add BR2_TARGET_UBOOT_USE_BINMAN option
Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts.

This tool uses additional host python modules that must be provided by
Buildroot. So introduce a new option BR2_TARGET_UBOOT_USE_BINMAN to
add additional host packages in U-Boot build dependency to use binman.

The binman requirement is directly included in buildman dependency
(tools/buildman/requirements.txt) since within U-Boot, binman is
invoked by the build system, here buildman [1].

[1] https://docs.u-boot.org/en/v2024.01/develop/package/binman.html#invoking-binman-within-u-boot

Co-developed-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-04-07 22:26:07 +02:00
Dario Binacchi
8a4c3c91e7 boot/ti-k3-r5-loader: add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts.

This tool uses additional host python modules that must be provided by
Buildroot. So introduce a new option
BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN to add additional host packages
in U-Boot build dependency to use binman.

When BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is set, BINMAN_INDIRS
environment variable to provide the directory to search for binary
blobs and select the packages required by binman. Make sure that
ti-k3-boot-firmware package has been installed before building
ti-k3-r5-loader in order to provide such firmwares.

The BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option is currently needed
since we are in the middle of the process to switch TI AM62 and AM64
board defconfig to binman. Keep BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN
disabled for them until the u-boot/ti-k3-r5-loader version bump to
2024.01.

The dependency of binman is not really easy to follow. First we have
the packages list from binman.rst [1] then we have to install
additional python modules [2]. Maybe in the future it will be
necessary to add host-lzma and host-lz4 in the dependencies list.

[1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/binman/binman.rst?plain=1#L377
[2] https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/buildman/requirements.txt

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-04-07 22:01:45 +02:00
Romain Naour
182756a032 boot/uboot: rename TI_K3_DM option to cover further TI K3 SoCs support
BR2_TARGET_UBOOT_NEEDS_TI_K3_DM option has been introduced initially to
support certain TI K3 devices such as AM62x and AM62Ax that require a
Device Manager (DM) firmware.

This option needs to be renamed to use a more generic name in order
to cover further TI K3 SoCs support along with the new u-boot binman
tool that will be added in followup patch. With binman enabled in
u-boot on TI K3 SoC, ti-k3-boot-firmware is needed at buildtime to
provide ti-sysfw (System Firmware) for all TI K3 SoC along with Device
Manager (DM) firmware for AM62x and AM62Ax devices.

With binman support enabled, we don't need to provide the path of the
Device Manager firmware anymore (see [2]).
We can remove DM="<DM firmware>.xer5f" from UBOOT_MAKE_OPTS.
It also means that we can also remove BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
used to define DM path.

  DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f

For now, keep BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME and DM only when
ti-k3-image-gen is used. We need to update ti_am62x_sk_defconfig
to use binman before removing them along with ti-k3-image-gen.

[1] 52ce606c05
[2] https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-04-07 21:52:06 +02:00