arm-trusted-firmware/plat/qemu
Andre Przywara f240728b76 qemu: Move and generalise FDT PSCI fixup
The QEMU platform port scans its device tree to advertise PSCI as the
CPU enable method. It does this by scanning *every* node in the DT and
check whether its compatible string starts with "arm,cortex-a". Then it
sets the enable-method to PSCI, if it doesn't already have one.

Other platforms might want to use this functionality as well, so let's
move it out of the QEMU platform directory and make it more robust by
fixing some shortcomings:
- A compatible string starting with a certain prefix is not a good way
to find the CPU nodes. For instance a "arm,cortex-a72-pmu" node will
match as well and is in turn favoured with an enable-method.
- If the DT already has an enable-method, we won't change this to PSCI.

Those two issues will for instance fail on the Raspberry Pi 4 DT.
To fix those problems, we adjust the scanning method:
The DT spec says that all CPU nodes are subnodes of the mandatory
/cpus node, which is a subnode of the root node. Also each CPU node has
to have a device_type = "cpu" property. So we find the /cpus node, then
scan for a subnode with the proper device_type, forcing the
enable-method to "psci".
We have to restart this search after a property has been patched, as the
node offsets might have changed meanwhile.

This allows this routine to be reused for the Raspberry Pi 4 later.

Change-Id: I00cae16cc923d9f8bb96a9b2a2933b9a79b06139
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2019-09-13 16:54:21 +01:00
..
aarch32 qemu: use new console interface in aarch32 2019-06-28 10:52:48 +01:00
aarch64 qemu: don't use C functions for the crash console callbacks 2018-03-31 16:26:18 +08:00
include plat/qemu: add gicv3 support for qemu 2019-07-26 18:53:18 +02:00
sp_min qemu: use new console interface in aarch32 2019-06-28 10:52:48 +01:00
platform.mk qemu: Move and generalise FDT PSCI fixup 2019-09-13 16:54:21 +01:00
qemu_bl1_setup.c Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
qemu_bl2_mem_params_desc.c Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
qemu_bl2_setup.c qemu: Move and generalise FDT PSCI fixup 2019-09-13 16:54:21 +01:00
qemu_bl31_setup.c plat/qemu: move gicv2 codes to separate file 2019-07-26 18:53:18 +02:00
qemu_common.c Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
qemu_console.c Remove MULTI_CONSOLE_API flag and references to it 2019-06-28 10:52:48 +01:00
qemu_gicv2.c plat/qemu: move gicv2 codes to separate file 2019-07-26 18:53:18 +02:00
qemu_gicv3.c plat/qemu: add gicv3 support for qemu 2019-07-26 18:53:18 +02:00
qemu_image_load.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
qemu_io_storage.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
qemu_pm.c plat/qemu: move gicv2 codes to separate file 2019-07-26 18:53:18 +02:00
qemu_private.h qemu: Move and generalise FDT PSCI fixup 2019-09-13 16:54:21 +01:00
qemu_rotpk.S qemu: Add support for Trusted Board Boot 2017-10-25 10:48:58 +08:00
qemu_stack_protector.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
qemu_trusted_boot.c Mbed TLS: Remove weak heap implementation 2019-04-12 09:52:52 +01:00
topology.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00