From: Bernhard Beschow <shentey@gmail.com>
To: Gaurav Sharma <gaurav.sharma_7@nxp.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"peter.maydell@linaro.org" <peter.maydell@linaro.org>
Subject: RE: [EXT] Re: [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation
Date: Wed, 12 Nov 2025 21:46:30 +0000 [thread overview]
Message-ID: <D361607E-6F67-4FEC-BC68-A71BB1823B9C@gmail.com> (raw)
In-Reply-To: <AM9PR04MB8487096A518874924AC17DEB87CCA@AM9PR04MB8487.eurprd04.prod.outlook.com>
Am 12. November 2025 11:02:13 UTC schrieb Gaurav Sharma <gaurav.sharma_7@nxp.com>:
>@'Bernhard Beschow' looks like I was referring to the hex dump of a different Debian disk image. I have got the offset for iMX8MM now. I have tested it as well. The console looks good. Now the only question remains:- shall we continue using offset based method to extract dtb or download it from the cloud instead?
Nice! I'd slightly prefer extracring the DTB from the image for consistency and to have only one URL that could break in the future. Does this work for you?
>
>-----Original Message-----
>From: Gaurav Sharma
>Sent: 12 November 2025 12:35
>To: 'Bernhard Beschow' <shentey@gmail.com>; 'qemu-devel@nongnu.org' <qemu-devel@nongnu.org>
>Cc: 'pbonzini@redhat.com' <pbonzini@redhat.com>; 'peter.maydell@linaro.org' <peter.maydell@linaro.org>
>Subject: RE: [EXT] Re: [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation
>
>Sorry The correct xxd dump for dtb offset 0x64F51000:- xxd -s 0x64F51000 -l 4 disk.raw
>64f51000: e103 16aa ....
>
>
>-----Original Message-----
>From: Gaurav Sharma
>Sent: 12 November 2025 12:28
>To: 'Bernhard Beschow' <shentey@gmail.com>; qemu-devel@nongnu.org
>Cc: pbonzini@redhat.com; peter.maydell@linaro.org
>Subject: RE: [EXT] Re: [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation
>
>Thank you for reviewing Bernhard. Yes, iMX8MM is very close to iMX8MP that's why I chose to stick to that structure.
>
>" Looks like these lists are sorted alphabetically. Shall we preserve that?"
>
>-- yes "tests_aarch64_system_thorough" should be sorted alphabetically preserving the original order - - will modify it in v2 patch
>
>"This DTB offset is the one for the imx8mp-evk, and in fact the console log confirms it. Both machines seem to be so similar that the test passes anyway"
>
>-- yes, I just found out in the console log. The test was giving a false positive. Thank you for the heads up! I have now modified it to fetch the dtb from the Debian stable repository. Verified it's working correctly via console log
>
>What you need is the offset in the "disk.raw" image that gets extracted from above file. Open "disk.raw" in a hex editor and search for "imx8mm-evk", then determine the offset of the preceeding "d00df00d" DTB magic. That is your offset.
>
>-- do you mean the DTB magic "d00dfeed" instead of "d00df00d"? Also, while I was analysing the DTB offset of the mainlined imx8mp functional testing 'disk.raw' which has debian-12-generic-arm64-20231210-1590. The script mentions the DTB_OFFSET at 0x64F51000. Dumping this offset using xxd[also verified it via hex editor]:- # xxd -s 0x51000000 -l 4 disk.raw
>51000000: 6cff 0060
>It doesn't mention the DTB magic number at this offset. Please let me know if I am missing anything here .
>Can we choose not to rely on the hardcoded offset and instead download the dtb from the Debian stable repository itself? This way the same functional test can be used easily for the future imx board porting as well.
>Looking forward to your guidance.
>
>
>
>-----Original Message-----
>From: Bernhard Beschow <shentey@gmail.com>
>Sent: 12 November 2025 04:51
>To: qemu-devel@nongnu.org; Gaurav Sharma <gaurav.sharma_7@nxp.com>
>Cc: pbonzini@redhat.com; peter.maydell@linaro.org
>Subject: [EXT] Re: [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation
>
>[You don't often get email from shentey@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
>Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
>
>
>Am 10. November 2025 11:22:57 UTC schrieb Gaurav Sharma <gaurav.sharma_7@nxp.com>:
>>Added script that would validate the iMX8MM emulation by checking the
>>linux console log. If it succeeds, it will return:-
>>
>>ok 1 test_imx8mm_evk.Imx8mmEvkMachine.test_aarch64_imx8mm_evk_usdhc
>>
>>Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
>
>>Hi Gaurav!
>
>>Nice to see another imx8 machine being contributed! I'm impressed how close you stick to the imx8mp, both in terms of structuring this series as well as the code.
>
>>I've built your series and ran the functional test. Comments below.
>
>
>
>
>--
>
>>---
>> tests/functional/aarch64/meson.build | 2 +
>> tests/functional/aarch64/test_imx8mm_evk.py | 67 +++++++++++++++++++++
>> 2 files changed, 69 insertions(+)
>> create mode 100755 tests/functional/aarch64/test_imx8mm_evk.py
>>
>>diff --git a/tests/functional/aarch64/meson.build
>>b/tests/functional/aarch64/meson.build
>>index 5ad52f93e1..31ecedbf6f 100644
>>--- a/tests/functional/aarch64/meson.build
>>+++ b/tests/functional/aarch64/meson.build
>>@@ -5,6 +5,7 @@ test_aarch64_timeouts = {
>> 'aspeed_ast2700fc' : 600,
>> 'device_passthrough' : 720,
>> 'imx8mp_evk' : 240,
>>+ 'imx8mm_evk' : 240,
>> 'raspi4' : 480,
>> 'reverse_debug' : 180,
>> 'rme_virt' : 1200,
>>@@ -28,6 +29,7 @@ tests_aarch64_system_thorough = [
>> 'device_passthrough',
>> 'hotplug_pci',
>> 'imx8mp_evk',
>>+ 'imx8mm_evk',
>
>Looks like these lists are sorted alphabetically. Shall we preserve that?
>
>> 'kvm',
>> 'multiprocess',
>> 'raspi3',
>>diff --git a/tests/functional/aarch64/test_imx8mm_evk.py
>>b/tests/functional/aarch64/test_imx8mm_evk.py
>>new file mode 100755
>>index 0000000000..d5eb43afc6
>>--- /dev/null
>>+++ b/tests/functional/aarch64/test_imx8mm_evk.py
>>@@ -0,0 +1,67 @@
>>+#!/usr/bin/env python3
>>+#
>>+# Functional test that boots a Linux kernel and checks the console # #
>>+SPDX-License-Identifier: GPL-2.0-or-later
>>+
>>+from qemu_test import LinuxKernelTest, Asset
>>+
>>+class Imx8mmEvkMachine(LinuxKernelTest):
>>+
>>+ ASSET_IMAGE = Asset(
>>+ ('https://cloud.debian.org/images/cloud/bookworm/20231210-1590/'
>>+ 'debian-12-generic-arm64-20231210-1590.tar.xz'),
>>+
>>+ '7ebf1577b32d5af6204df74b54ca2e4675de9b5a9fa14f3ff70b88eeb7b3b359')
>>+
>>+ KERNEL_OFFSET = 0x51000000
>>+ KERNEL_SIZE = 32622528
>>+ INITRD_OFFSET = 0x76000000
>>+ INITRD_SIZE = 30987766
>>+ DTB_OFFSET = 0x64F51000
>
>This DTB offset is the one for the imx8mp-evk, and in fact the console log confirms it. Both machines seem to be so similar that the test passes anyway.
>
>What you need is the offset in the "disk.raw" image that gets extracted from above file. Open "disk.raw" in a hex editor and search for "imx8mm-evk", then determine the offset of the preceeding "d00df00d" DTB magic. That is your offset.
>
>Best regards,
>Bernhard
>
>>+ DTB_SIZE = 45 * 1024
>>+
>>+ def extract(self, in_path, out_path, offset, size):
>>+ try:
>>+ with open(in_path, "rb") as source:
>>+ source.seek(offset)
>>+ data = source.read(size)
>>+ with open(out_path, "wb") as target:
>>+ target.write(data)
>>+ except (IOError, ValueError) as e:
>>+ self.log.error(f"Failed to extract {out_path}: {e}")
>>+ raise
>>+
>>+ def setUp(self):
>>+ super().setUp()
>>+
>>+ self.image_path = self.scratch_file("disk.raw")
>>+ self.kernel_path = self.scratch_file("linux")
>>+ self.initrd_path = self.scratch_file("initrd.zstd")
>>+ self.dtb_path = self.scratch_file("imx8mm-evk.dtb")
>>+
>>+ self.archive_extract(self.ASSET_IMAGE)
>>+ self.extract(self.image_path, self.kernel_path,
>>+ self.KERNEL_OFFSET, self.KERNEL_SIZE)
>>+ self.extract(self.image_path, self.initrd_path,
>>+ self.INITRD_OFFSET, self.INITRD_SIZE)
>>+ self.extract(self.image_path, self.dtb_path,
>>+ self.DTB_OFFSET, self.DTB_SIZE)
>>+
>>+ def test_aarch64_imx8mm_evk_usdhc(self):
>>+ self.require_accelerator("tcg")
>>+ self.set_machine('imx8mm-evk')
>>+ self.vm.set_console(console_index=1)
>>+ self.vm.add_args('-m', '2G',
>>+ '-smp', '4',
>>+ '-kernel', self.kernel_path,
>>+ '-initrd', self.initrd_path,
>>+ '-dtb', self.dtb_path,
>>+ '-append', 'root=/dev/mmcblk2p1',
>>+ '-drive', f'file={self.image_path},if=sd,bus=2,'
>>+
>>+ 'format=raw,id=mmcblk2,snapshot=on')
>>+
>>+ self.vm.launch()
>>+ self.wait_for_console_pattern('Welcome to ')
>>+
>>+if __name__ == '__main__':
>>+ LinuxKernelTest.main()
next prev parent reply other threads:[~2025-11-12 22:08 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 11:22 [PATCH 00/13] Adding comprehensive support for i.MX8MM EVK board Gaurav Sharma
2025-11-10 11:22 ` [PATCH 01/13] hw/arm: Add the i.MX 8MM EVK(Evaluation Kit) board Gaurav Sharma
2025-11-11 23:44 ` Bernhard Beschow
2025-11-13 10:52 ` [EXT] " Gaurav Sharma
2025-11-17 13:14 ` Bernhard Beschow
2025-11-18 5:26 ` Gaurav Sharma
2025-11-18 9:46 ` Bernhard Beschow
2025-11-10 11:22 ` [PATCH 02/13] hw/arm/fsl-imx8mm: Implemented CCM(Clock Control Module) and Analog IP Gaurav Sharma
2025-11-10 11:22 ` [PATCH 03/13] hw/arm/fsl-imx8mm: Implemented support for SNVS Gaurav Sharma
2025-11-10 11:22 ` [PATCH 04/13] hw/arm/fsl-imx8mm: Adding support for USDHC storage controllers Gaurav Sharma
2025-11-10 15:05 ` Philippe Mathieu-Daudé
2025-11-11 6:09 ` [EXT] " Gaurav Sharma
2025-11-10 11:22 ` [PATCH 05/13] hw/arm/fsl-imx8mm: Add PCIe support Gaurav Sharma
2025-11-10 15:00 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 06/13] hw/arm/fsl-imx8mm: Add GPIO controllers Gaurav Sharma
2025-11-10 15:02 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 07/13] hw/arm/fsl-imx8mm: Adding support for I2C emulation Gaurav Sharma
2025-11-10 15:07 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 08/13] hw/arm/fsl-imx8mm: Adding support for SPI controller Gaurav Sharma
2025-11-10 15:08 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 09/13] hw/arm/fsl-imx8mm: Adding support for Watchdog Timers Gaurav Sharma
2025-11-10 15:12 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 10/13] hw/arm/fsl-imx8mm: Adding support for General Purpose Timers Gaurav Sharma
2025-11-10 11:22 ` [PATCH 11/13] hw/arm/fsl-imx8mm: Adding support for ENET ethernet controller Gaurav Sharma
2025-11-10 11:22 ` [PATCH 12/13] hw/arm/fsl-imx8mm: Adding support for USB controller Gaurav Sharma
2025-11-10 15:10 ` Philippe Mathieu-Daudé
2025-11-10 11:22 ` [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation Gaurav Sharma
2025-11-11 23:21 ` Bernhard Beschow
2025-11-12 6:58 ` [EXT] " Gaurav Sharma
2025-11-12 7:05 ` Gaurav Sharma
2025-11-12 11:02 ` Gaurav Sharma
2025-11-12 21:46 ` Bernhard Beschow [this message]
2025-11-13 3:03 ` Gaurav Sharma
2025-11-10 14:38 ` [PATCH v2 00/13] Adding comprehensive support for i.MX8MM EVK board Philippe Mathieu-Daudé
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=D361607E-6F67-4FEC-BC68-A71BB1823B9C@gmail.com \
--to=shentey@gmail.com \
--cc=gaurav.sharma_7@nxp.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).