Skip to content

Commit 764ca3e

Browse files
groeckphilmd
authored andcommitted
hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree
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 <[email protected]> Signed-off-by: Bernhard Beschow <[email protected]> [Bernhard: split patch, update documentation, adapt commit message] Signed-off-by: Bernhard Beschow <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 535ef19 commit 764ca3e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docs/system/arm/imx8mp-evk.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Direct Linux Kernel Boot
3535

3636
Probably the easiest way to get started with a whole Linux system on the machine
3737
is to generate an image with Buildroot. Version 2024.11.1 is tested at the time
38-
of writing and involves three steps. First run the following commands in the
38+
of writing and involves two steps. First run the following commands in the
3939
toplevel directory of the Buildroot source tree:
4040

4141
.. code-block:: bash
@@ -50,21 +50,13 @@ it and resize the SD card image to a power of two:
5050
5151
$ qemu-img resize sdcard.img 256M
5252
53-
Finally, the device tree needs to be patched with the following commands which
54-
will remove the ``cpu-idle-states`` properties from CPU nodes:
55-
56-
.. code-block:: bash
57-
58-
$ dtc imx8mp-evk.dtb | sed '/cpu-idle-states/d' > imx8mp-evk-patched.dts
59-
$ dtc imx8mp-evk-patched.dts -o imx8mp-evk-patched.dtb
60-
6153
Now that everything is prepared the machine can be started as follows:
6254

6355
.. code-block:: bash
6456
6557
$ qemu-system-aarch64 -M imx8mp-evk -smp 4 -m 3G \
6658
-display none -serial null -serial stdio \
6759
-kernel Image \
68-
-dtb imx8mp-evk-patched.dtb \
60+
-dtb imx8mp-evk.dtb \
6961
-append "root=/dev/mmcblk2p2" \
7062
-drive file=sdcard.img,if=sd,bus=2,format=raw,id=mmcblk2

hw/arm/imx8mp-evk.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515
#include "system/qtest.h"
1616
#include "qemu/error-report.h"
1717
#include "qapi/error.h"
18+
#include <libfdt.h>
19+
20+
static void imx8mp_evk_modify_dtb(const struct arm_boot_info *info, void *fdt)
21+
{
22+
int offset;
23+
24+
/* Remove cpu-idle-states property from CPU nodes */
25+
offset = fdt_node_offset_by_compatible(fdt, -1, "arm,cortex-a53");
26+
while (offset >= 0) {
27+
fdt_nop_property(fdt, offset, "cpu-idle-states");
28+
offset = fdt_node_offset_by_compatible(fdt, offset, "arm,cortex-a53");
29+
}
30+
}
1831

1932
static void imx8mp_evk_init(MachineState *machine)
2033
{
@@ -32,6 +45,7 @@ static void imx8mp_evk_init(MachineState *machine)
3245
.board_id = -1,
3346
.ram_size = machine->ram_size,
3447
.psci_conduit = QEMU_PSCI_CONDUIT_SMC,
48+
.modify_dtb = imx8mp_evk_modify_dtb,
3549
};
3650

3751
s = FSL_IMX8MP(object_new(TYPE_FSL_IMX8MP));

0 commit comments

Comments
 (0)