From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Jakob Kastelic <kastelic.jakob@gmail.com>
Cc: Romain Naour <romain.naour@gmail.com>,
Dick Olsson <hi@senzilla.io>,
Sergey Matyukevich <geomatsi@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3] support/testing/tests/boot/test_atf.py: test BL33
Date: Thu, 5 Feb 2026 09:04:00 +0100 [thread overview]
Message-ID: <aYROFVF83L7W63bN@windsurf> (raw)
In-Reply-To: <20260205044622.1808469-1-kastelic.jakob@gmail.com>
Hello,
Thanks for the patch!
On Wed, Feb 04, 2026 at 08:46:22PM -0800, Jakob Kastelic wrote:
> +class TestATFNoUBoot(infra.basetest.BRTest):
> + config = \
> + """
> + BR2_arm=y
> + BR2_cortex_a15=y
> + BR2_ARM_FPU_VFPV3D16=y
> + BR2_TOOLCHAIN_BUILDROOT_CXX=y
Can we use an external toolchain instead?
> + BR2_TARGET_ROOTFS_EXT2=y
> + BR2_TARGET_ROOTFS_EXT2_4=y
> + BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_18=y
> + BR2_GLOBAL_PATCH_DIR="board/qemu/patches"
> + BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
Not really useful for tests I'd say, and this would mean the test
would fail when we update qemu defconfigs as the test would no longer
be aligned with the hashes in board/qemu/patches/.
> + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> + BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/arm-vexpress-tz/post-build.sh"
> + BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
> + BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
> + BR2_LINUX_KERNEL=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.7"
> + BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
> + BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/arm-vexpress-tz/linux.fragment"
> + BR2_PACKAGE_OPENSSL=y
> + BR2_PACKAGE_OPTEE_EXAMPLES=y
> + BR2_PACKAGE_OPTEE_TEST=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.7"
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu"
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33=y
> + BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="BL32_RAM_LOCATION=tdram"
> + BR2_TARGET_OPTEE_OS=y
> + BR2_TARGET_OPTEE_OS_NEEDS_DTC=y
> + BR2_TARGET_OPTEE_OS_PLATFORM="vexpress-qemu_virt"
> + BR2_PACKAGE_HOST_QEMU=y
> + BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
> + """
> +
> + def patch_dts(self):
> + """
> + Place the rootfs into the kernel command line via the DTB.
> +
> + In qemu-system-arm, -append is only allowed with -kernel option. Since
> + we are using the -bios option to load TF-A (which in turn loads the
> + kernel), we have to manually patch the DTB to add the root option.
> + """
> + dtb = os.path.join(self.builddir, "images", "qemu.dtb")
> + rootfs = os.path.join(self.builddir, "images", "rootfs.ext4")
> + flash = os.path.join(self.builddir, "images", "flash.bin")
> + qemu = os.path.join(self.builddir, "host", "bin", "qemu-system-arm")
> + fdtput = os.path.join(self.builddir, "host", "bin", "fdtput")
> +
> + # get the DTB from Qemu
> + subprocess.run([
> + qemu, "-machine", f"virt,dumpdtb={dtb}", "-machine",
> + "secure=on", "-cpu", "cortex-a15"
> + ], check=True)
> +
> + # insert kernel command line argument into DTB
> + subprocess.run([fdtput, "-t", "s", f"{dtb}", "/chosen", "bootargs",
> + "root=/dev/vda" ], check=True)
> +
> + return dtb, rootfs, flash
> +
> + def test_run(self):
> + dtb, rootfs, flash = self.patch_dts()
> +
> + self.emulator.boot(arch="arm", options=[
> + "-machine", f"virt", "-machine",
Why f"virt" and not just "virt" ?
Otherwise, looks good to me!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-02-05 8:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 21:45 [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: optional Linux as BL33 Jakob Kastelic
2025-05-16 15:48 ` Arnout Vandecappelle via buildroot
2025-09-17 2:45 ` [Buildroot] [PATCH v2 0/2] Linux as BL33 in TF-A Jakob Kastelic
2025-09-17 2:45 ` [Buildroot] [PATCH v2 1/2] boot/arm-trusted-firmware: optional Linux as BL33 Jakob Kastelic
2026-02-03 9:10 ` Thomas Petazzoni via buildroot
2025-09-17 2:45 ` [Buildroot] [PATCH v2 2/2] configs/qemu_arm_vexpress_tz_falcon_defconfig: new Jakob Kastelic
2026-02-03 9:18 ` Thomas Petazzoni via buildroot
2026-02-05 4:50 ` [Buildroot] [PATCH v3] support/testing/tests/boot/test_atf.py: test BL33 Jakob Kastelic
2026-02-05 22:03 ` [Buildroot] [PATCH v4] " Jakob Kastelic
[not found] ` <20260205044622.1808469-1-kastelic.jakob@gmail.com>
2026-02-05 8:04 ` Thomas Petazzoni via buildroot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYROFVF83L7W63bN@windsurf \
--to=buildroot@buildroot.org \
--cc=geomatsi@gmail.com \
--cc=hi@senzilla.io \
--cc=kastelic.jakob@gmail.com \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox