* [PATCH-for-10.0 0/3] More imx8mp-evk improvements
@ 2025-04-05 21:48 Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage Bernhard Beschow
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-05 21:48 UTC (permalink / raw)
To: qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Bernhard Beschow, Peter Maydell,
Thomas Huth
This series adds a functional test for the imx8mp-evk board with USDHC
coverage. Thanks to Guenter Roeck the usage of the board gets simplified by not
asking the user to remove the cpu-idle-states properties from the devicetree
since that is now done automatically. Likewise, a stack trace during boot is
resolved by also automatically removing an offending device node.
Supersedes: 20250330094139.11948-1-shentey@gmail.com
Bernhard Beschow (1):
tests/functional: Add test for imx8mp-evk board with USDHC coverage
Guenter Roeck (2):
hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties
from devicetree
hw/arm/imx8mp-evk: Remove unimplemented nxp,imx8mp-fspi node from
devicetree
MAINTAINERS | 1 +
docs/system/arm/imx8mp-evk.rst | 12 +---
hw/arm/imx8mp-evk.c | 29 +++++++++
tests/functional/meson.build | 1 +
tests/functional/test_aarch64_imx8mp_evk.py | 69 +++++++++++++++++++++
5 files changed, 102 insertions(+), 10 deletions(-)
create mode 100644 tests/functional/test_aarch64_imx8mp_evk.py
--
2.49.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage
2025-04-05 21:48 [PATCH-for-10.0 0/3] More imx8mp-evk improvements Bernhard Beschow
@ 2025-04-05 21:48 ` Bernhard Beschow
2025-04-07 5:38 ` Thomas Huth
2025-04-05 21:48 ` [PATCH-for-10.0 2/3] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree Bernhard Beschow
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-05 21:48 UTC (permalink / raw)
To: qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Bernhard Beschow, Peter Maydell,
Thomas Huth
Introduce a functional test which boots Debian 12 on the imx8mp-evk board. Since
the root filesystem resides on an SD card, the test also verifies the basic
operation of the USDHC.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
MAINTAINERS | 1 +
tests/functional/meson.build | 1 +
tests/functional/test_aarch64_imx8mp_evk.py | 69 +++++++++++++++++++++
3 files changed, 71 insertions(+)
create mode 100644 tests/functional/test_aarch64_imx8mp_evk.py
diff --git a/MAINTAINERS b/MAINTAINERS
index d54b5578f8..4ceffa89dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -833,6 +833,7 @@ F: include/hw/arm/fsl-imx8mp.h
F: include/hw/misc/imx8mp_*.h
F: include/hw/pci-host/fsl_imx8m_phy.h
F: docs/system/arm/imx8mp-evk.rst
+F: tests/functional/test_aarch64_imx8mp_evk.py
F: tests/qtest/rs5c372-test.c
MPS2 / MPS3
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 0f8be30fe2..aaaf3472f1 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -75,6 +75,7 @@ tests_aarch64_system_quick = [
tests_aarch64_system_thorough = [
'aarch64_aspeed',
+ 'aarch64_imx8mp_evk',
'aarch64_raspi3',
'aarch64_raspi4',
'aarch64_replay',
diff --git a/tests/functional/test_aarch64_imx8mp_evk.py b/tests/functional/test_aarch64_imx8mp_evk.py
new file mode 100644
index 0000000000..5419d3c525
--- /dev/null
+++ b/tests/functional/test_aarch64_imx8mp_evk.py
@@ -0,0 +1,69 @@
+#!/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 Imx8mpEvkMachine(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
+ 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.ASSET_IMAGE.fetch()
+ self.archive_extract(self.ASSET_IMAGE)
+
+ 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("imx8mp-evk.dtb")
+
+ 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_imx8mp_evk_usdhc(self):
+ self.set_machine('imx8mp-evk')
+ self.vm.set_console(console_index=1)
+ self.vm.add_args('-m', '2G',
+ '-smp', '4',
+ '-accel', 'tcg',
+ '-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')
+
+ self.vm.launch()
+ self.wait_for_console_pattern('Welcome to ')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.49.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH-for-10.0 2/3] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree
2025-04-05 21:48 [PATCH-for-10.0 0/3] More imx8mp-evk improvements Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage Bernhard Beschow
@ 2025-04-05 21:48 ` Bernhard Beschow
2025-04-05 21:49 ` [PATCH-for-10.0 3/3] hw/arm/imx8mp-evk: Remove unimplemented nxp, imx8mp-fspi node " Bernhard Beschow
2025-04-08 18:57 ` [PATCH-for-10.0 0/3] More imx8mp-evk improvements Philippe Mathieu-Daudé
3 siblings, 0 replies; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-05 21:48 UTC (permalink / raw)
To: qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Bernhard Beschow, Peter Maydell,
Thomas Huth
From: Guenter Roeck <linux@roeck-us.net>
The cpu-idle-states property causes a hard boot hang. Rather than documenting
the workaround, perform the removal from the devicetree automatically.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
[Bernhard: split patch, update documentation, adapt commit message]
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
docs/system/arm/imx8mp-evk.rst | 12 ++----------
hw/arm/imx8mp-evk.c | 14 ++++++++++++++
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/docs/system/arm/imx8mp-evk.rst b/docs/system/arm/imx8mp-evk.rst
index 00527b0cbe..b2f7d29ade 100644
--- a/docs/system/arm/imx8mp-evk.rst
+++ b/docs/system/arm/imx8mp-evk.rst
@@ -35,7 +35,7 @@ Direct Linux Kernel Boot
Probably the easiest way to get started with a whole Linux system on the machine
is to generate an image with Buildroot. Version 2024.11.1 is tested at the time
-of writing and involves three steps. First run the following commands in the
+of writing and involves two steps. First run the following commands in the
toplevel directory of the Buildroot source tree:
.. code-block:: bash
@@ -50,14 +50,6 @@ it and resize the SD card image to a power of two:
$ qemu-img resize sdcard.img 256M
-Finally, the device tree needs to be patched with the following commands which
-will remove the ``cpu-idle-states`` properties from CPU nodes:
-
-.. code-block:: bash
-
- $ dtc imx8mp-evk.dtb | sed '/cpu-idle-states/d' > imx8mp-evk-patched.dts
- $ dtc imx8mp-evk-patched.dts -o imx8mp-evk-patched.dtb
-
Now that everything is prepared the machine can be started as follows:
.. code-block:: bash
@@ -65,6 +57,6 @@ Now that everything is prepared the machine can be started as follows:
$ qemu-system-aarch64 -M imx8mp-evk -smp 4 -m 3G \
-display none -serial null -serial stdio \
-kernel Image \
- -dtb imx8mp-evk-patched.dtb \
+ -dtb imx8mp-evk.dtb \
-append "root=/dev/mmcblk2p2" \
-drive file=sdcard.img,if=sd,bus=2,format=raw,id=mmcblk2
diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
index f17d5db466..3bbf2bfbea 100644
--- a/hw/arm/imx8mp-evk.c
+++ b/hw/arm/imx8mp-evk.c
@@ -15,6 +15,19 @@
#include "system/qtest.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include <libfdt.h>
+
+static void imx8mp_evk_modify_dtb(const struct arm_boot_info *info, void *fdt)
+{
+ int offset;
+
+ /* Remove cpu-idle-states property from CPU nodes */
+ offset = fdt_node_offset_by_compatible(fdt, -1, "arm,cortex-a53");
+ while (offset >= 0) {
+ fdt_nop_property(fdt, offset, "cpu-idle-states");
+ offset = fdt_node_offset_by_compatible(fdt, offset, "arm,cortex-a53");
+ }
+}
static void imx8mp_evk_init(MachineState *machine)
{
@@ -32,6 +45,7 @@ static void imx8mp_evk_init(MachineState *machine)
.board_id = -1,
.ram_size = machine->ram_size,
.psci_conduit = QEMU_PSCI_CONDUIT_SMC,
+ .modify_dtb = imx8mp_evk_modify_dtb,
};
s = FSL_IMX8MP(object_new(TYPE_FSL_IMX8MP));
--
2.49.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH-for-10.0 3/3] hw/arm/imx8mp-evk: Remove unimplemented nxp, imx8mp-fspi node from devicetree
2025-04-05 21:48 [PATCH-for-10.0 0/3] More imx8mp-evk improvements Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 2/3] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree Bernhard Beschow
@ 2025-04-05 21:49 ` Bernhard Beschow
2025-04-08 18:57 ` [PATCH-for-10.0 0/3] More imx8mp-evk improvements Philippe Mathieu-Daudé
3 siblings, 0 replies; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-05 21:49 UTC (permalink / raw)
To: qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Bernhard Beschow, Peter Maydell,
Thomas Huth
From: Guenter Roeck <linux@roeck-us.net>
The nxp,imx8mp-fspi node triggers a warning backtrace.
Remove it from the devicetree file.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Inspired-by: commit bf1da4b308 ("hw/arm/raspi4b: Temporarily disable
unimplemented rpi4b devices")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
[Bernhard: split patch, adapt commit message]
---
hw/arm/imx8mp-evk.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
index 3bbf2bfbea..b5aec06ec5 100644
--- a/hw/arm/imx8mp-evk.c
+++ b/hw/arm/imx8mp-evk.c
@@ -19,7 +19,22 @@
static void imx8mp_evk_modify_dtb(const struct arm_boot_info *info, void *fdt)
{
- int offset;
+ int i, offset;
+
+ /* Temporarily disable following nodes until they are implemented */
+ const char *nodes_to_remove[] = {
+ "nxp,imx8mp-fspi",
+ };
+
+ for (i = 0; i < ARRAY_SIZE(nodes_to_remove); i++) {
+ const char *dev_str = nodes_to_remove[i];
+
+ offset = fdt_node_offset_by_compatible(fdt, -1, dev_str);
+ while (offset >= 0) {
+ fdt_nop_node(fdt, offset);
+ offset = fdt_node_offset_by_compatible(fdt, offset, dev_str);
+ }
+ }
/* Remove cpu-idle-states property from CPU nodes */
offset = fdt_node_offset_by_compatible(fdt, -1, "arm,cortex-a53");
--
2.49.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage
2025-04-05 21:48 ` [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage Bernhard Beschow
@ 2025-04-07 5:38 ` Thomas Huth
2025-04-08 10:15 ` Bernhard Beschow
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2025-04-07 5:38 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Peter Maydell
Hi!
On 05/04/2025 23.48, Bernhard Beschow wrote:
> Introduce a functional test which boots Debian 12 on the imx8mp-evk board. Since
> the root filesystem resides on an SD card, the test also verifies the basic
> operation of the USDHC.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> MAINTAINERS | 1 +
> tests/functional/meson.build | 1 +
> tests/functional/test_aarch64_imx8mp_evk.py | 69 +++++++++++++++++++++
> 3 files changed, 71 insertions(+)
> create mode 100644 tests/functional/test_aarch64_imx8mp_evk.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d54b5578f8..4ceffa89dc 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -833,6 +833,7 @@ F: include/hw/arm/fsl-imx8mp.h
> F: include/hw/misc/imx8mp_*.h
> F: include/hw/pci-host/fsl_imx8m_phy.h
> F: docs/system/arm/imx8mp-evk.rst
> +F: tests/functional/test_aarch64_imx8mp_evk.py
> F: tests/qtest/rs5c372-test.c
>
> MPS2 / MPS3
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 0f8be30fe2..aaaf3472f1 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -75,6 +75,7 @@ tests_aarch64_system_quick = [
>
> tests_aarch64_system_thorough = [
> 'aarch64_aspeed',
> + 'aarch64_imx8mp_evk',
> 'aarch64_raspi3',
> 'aarch64_raspi4',
> 'aarch64_replay',
> diff --git a/tests/functional/test_aarch64_imx8mp_evk.py b/tests/functional/test_aarch64_imx8mp_evk.py
> new file mode 100644
The test files should be executable so you can run them directly (after
setting PYTHONPATH and QEMU_TEST_QEMU_BINARY)
> index 0000000000..5419d3c525
> --- /dev/null
> +++ b/tests/functional/test_aarch64_imx8mp_evk.py
> @@ -0,0 +1,69 @@
> +#!/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 Imx8mpEvkMachine(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
> + 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()
Is there any special reason for overriding the setUp function here? ...
otherwise, I think this could also simply be done from the
test_aarch64_imx8mp_evk_usdhc function instead?
> + self.ASSET_IMAGE.fetch()
I think you can omit the fetch() here, it should be handled by
archive_extract() already. At least that's what we're doing in the other
spots that use archive_extract().
> + self.archive_extract(self.ASSET_IMAGE)
> +
> + 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("imx8mp-evk.dtb")
> +
> + 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_imx8mp_evk_usdhc(self):
> + self.set_machine('imx8mp-evk')
> + self.vm.set_console(console_index=1)
> + self.vm.add_args('-m', '2G',
> + '-smp', '4',
> + '-accel', 'tcg',
The imx8mp-evk board has a "depends on TCG" in its Kconfig file, so I think
you could omit "-accel tcg" here (but it also does not hurt to be explicit,
I guess).
Thomas
> + '-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')
> +
> + self.vm.launch()
> + self.wait_for_console_pattern('Welcome to ')
> +
> +if __name__ == '__main__':
> + LinuxKernelTest.main()
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage
2025-04-07 5:38 ` Thomas Huth
@ 2025-04-08 10:15 ` Bernhard Beschow
0 siblings, 0 replies; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-08 10:15 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck,
Philippe Mathieu-Daudé, Peter Maydell
Am 7. April 2025 05:38:28 UTC schrieb Thomas Huth <thuth@redhat.com>:
> Hi!
>
>On 05/04/2025 23.48, Bernhard Beschow wrote:
>> Introduce a functional test which boots Debian 12 on the imx8mp-evk board. Since
>> the root filesystem resides on an SD card, the test also verifies the basic
>> operation of the USDHC.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>> MAINTAINERS | 1 +
>> tests/functional/meson.build | 1 +
>> tests/functional/test_aarch64_imx8mp_evk.py | 69 +++++++++++++++++++++
>> 3 files changed, 71 insertions(+)
>> create mode 100644 tests/functional/test_aarch64_imx8mp_evk.py
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index d54b5578f8..4ceffa89dc 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -833,6 +833,7 @@ F: include/hw/arm/fsl-imx8mp.h
>> F: include/hw/misc/imx8mp_*.h
>> F: include/hw/pci-host/fsl_imx8m_phy.h
>> F: docs/system/arm/imx8mp-evk.rst
>> +F: tests/functional/test_aarch64_imx8mp_evk.py
>> F: tests/qtest/rs5c372-test.c
>> MPS2 / MPS3
>> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
>> index 0f8be30fe2..aaaf3472f1 100644
>> --- a/tests/functional/meson.build
>> +++ b/tests/functional/meson.build
>> @@ -75,6 +75,7 @@ tests_aarch64_system_quick = [
>> tests_aarch64_system_thorough = [
>> 'aarch64_aspeed',
>> + 'aarch64_imx8mp_evk',
>> 'aarch64_raspi3',
>> 'aarch64_raspi4',
>> 'aarch64_replay',
>> diff --git a/tests/functional/test_aarch64_imx8mp_evk.py b/tests/functional/test_aarch64_imx8mp_evk.py
>> new file mode 100644
>
>The test files should be executable so you can run them directly (after setting PYTHONPATH and QEMU_TEST_QEMU_BINARY)
Ack. Will fix.
>
>> index 0000000000..5419d3c525
>> --- /dev/null
>> +++ b/tests/functional/test_aarch64_imx8mp_evk.py
>> @@ -0,0 +1,69 @@
>> +#!/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 Imx8mpEvkMachine(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
>> + 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()
>
>Is there any special reason for overriding the setUp function here? ... otherwise, I think this could also simply be done from the test_aarch64_imx8mp_evk_usdhc function instead?
The idea is that it prepares the test data once which could be used by multiple test cases in the future. One could add tests booting via USB and PCIe. Not done yet due to concerns about CI resources.
>
>> + self.ASSET_IMAGE.fetch()
>
>I think you can omit the fetch() here, it should be handled by archive_extract() already. At least that's what we're doing in the other spots that use archive_extract().
Sounds excellent, I'll try that.
>
>> + self.archive_extract(self.ASSET_IMAGE)
>> +
>> + 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("imx8mp-evk.dtb")
>> +
>> + 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_imx8mp_evk_usdhc(self):
>> + self.set_machine('imx8mp-evk')
>> + self.vm.set_console(console_index=1)
>> + self.vm.add_args('-m', '2G',
>> + '-smp', '4',
>> + '-accel', 'tcg',
>
>The imx8mp-evk board has a "depends on TCG" in its Kconfig file, so I think you could omit "-accel tcg" here (but it also does not hurt to be explicit, I guess).
I've seen it elsewhere, and I plan to add KVM support. That's why I added it. If it can be omitted I'm happy to remove it.
Best regards,
Bernhard
>
> Thomas
>
>
>> + '-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')
>> +
>> + self.vm.launch()
>> + self.wait_for_console_pattern('Welcome to ')
>> +
>> +if __name__ == '__main__':
>> + LinuxKernelTest.main()
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH-for-10.0 0/3] More imx8mp-evk improvements
2025-04-05 21:48 [PATCH-for-10.0 0/3] More imx8mp-evk improvements Bernhard Beschow
` (2 preceding siblings ...)
2025-04-05 21:49 ` [PATCH-for-10.0 3/3] hw/arm/imx8mp-evk: Remove unimplemented nxp, imx8mp-fspi node " Bernhard Beschow
@ 2025-04-08 18:57 ` Philippe Mathieu-Daudé
2025-04-08 20:39 ` Bernhard Beschow
3 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-08 18:57 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck, Peter Maydell,
Thomas Huth
On 5/4/25 23:48, Bernhard Beschow wrote:
> Guenter Roeck (2):
> hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties
> from devicetree
> hw/arm/imx8mp-evk: Remove unimplemented nxp,imx8mp-fspi node from
> devicetree
Patches 2 & 3 queued, thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH-for-10.0 0/3] More imx8mp-evk improvements
2025-04-08 18:57 ` [PATCH-for-10.0 0/3] More imx8mp-evk improvements Philippe Mathieu-Daudé
@ 2025-04-08 20:39 ` Bernhard Beschow
0 siblings, 0 replies; 8+ messages in thread
From: Bernhard Beschow @ 2025-04-08 20:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Cédric Le Goater, qemu-arm, Guenter Roeck, Peter Maydell,
Thomas Huth
Am 8. April 2025 18:57:45 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>On 5/4/25 23:48, Bernhard Beschow wrote:
>
>> Guenter Roeck (2):
>> hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties
>> from devicetree
>> hw/arm/imx8mp-evk: Remove unimplemented nxp,imx8mp-fspi node from
>> devicetree
>
>Patches 2 & 3 queued, thanks!
Thanks! This is a real quality of life improvement.
Best regards,
Bermhard
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-04-08 20:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-05 21:48 [PATCH-for-10.0 0/3] More imx8mp-evk improvements Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 1/3] tests/functional: Add test for imx8mp-evk board with USDHC coverage Bernhard Beschow
2025-04-07 5:38 ` Thomas Huth
2025-04-08 10:15 ` Bernhard Beschow
2025-04-05 21:48 ` [PATCH-for-10.0 2/3] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree Bernhard Beschow
2025-04-05 21:49 ` [PATCH-for-10.0 3/3] hw/arm/imx8mp-evk: Remove unimplemented nxp, imx8mp-fspi node " Bernhard Beschow
2025-04-08 18:57 ` [PATCH-for-10.0 0/3] More imx8mp-evk improvements Philippe Mathieu-Daudé
2025-04-08 20:39 ` Bernhard Beschow
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).