From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Guenter Roeck" <linux@roeck-us.net>,
"Bernhard Beschow" <shentey@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 5/8] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree
Date: Tue, 8 Apr 2025 20:55:35 +0200 [thread overview]
Message-ID: <20250408185538.85538-6-philmd@linaro.org> (raw)
In-Reply-To: <20250408185538.85538-1-philmd@linaro.org>
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>
Message-ID: <20250405214900.7114-3-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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 00527b0cbed..b2f7d29ade5 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 f17d5db466d..3bbf2bfbea3 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.47.1
next prev parent reply other threads:[~2025-04-08 18:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 18:55 [PULL 0/8] Misc HW patches for 2025-04-08 Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 1/8] smbios: Fix buffer overrun when using path= option Philippe Mathieu-Daudé
2025-04-17 10:11 ` Daan De Meyer
2025-04-17 13:05 ` Michael Tokarev
2025-04-17 13:25 ` Daan De Meyer
2025-04-17 13:56 ` Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 2/8] hw/core/machine: Fix -machine dumpdtb=file.dtb Philippe Mathieu-Daudé
2025-05-08 13:46 ` Peter Maydell
2025-04-08 18:55 ` [PULL 3/8] docs/arm: Add apple HVF host for supported guest CPU type Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 4/8] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size Philippe Mathieu-Daudé
2025-04-08 18:55 ` Philippe Mathieu-Daudé [this message]
2025-04-08 18:55 ` [PULL 6/8] hw/arm/imx8mp-evk: Temporarily remove unimplemented imx8mp-fspi node from devicetree Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 7/8] hw/nvme: fix attachment of private namespaces Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 8/8] scripts/checkpatch: Fix typo in SPDX-License-Identifier keyword 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=20250408185538.85538-6-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=linux@roeck-us.net \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.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;
as well as URLs for NNTP newsgroup(s).