arm-trusted-firmware/plat
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
..
allwinner Remove MULTI_CONSOLE_API flag and references to it 2019-06-28 10:52:48 +01:00
amlogic amlogic: Fix includes order 2019-09-11 18:05:26 +01:00
arm Merge "plat/arm: Introduce corstone700 platform." into integration 2019-08-20 14:47:56 +00:00
common Add UBSAN support and handlers 2019-09-11 14:15:54 +01:00
hisilicon Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
imx Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
intel/soc Invalidate dcache build option for bl2 entry at EL3 2019-09-12 12:36:31 +00:00
layerscape Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
marvell Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
mediatek Merge changes I08cf22df,I535ee414,Ie84cfc96,I8c35ce4e,If7649764, ... into integration 2019-09-13 11:51:49 +00:00
nvidia/tegra Tegra: memctrl_v2: fix "overflow before widen" coverity issue 2019-09-05 08:40:38 -07:00
qemu qemu: Move and generalise FDT PSCI fixup 2019-09-13 16:54:21 +01:00
renesas/rcar rcar_get3: drivers: ddr: Partly unify register macros between DDR A and B 2019-08-29 13:02:30 +02:00
rockchip Merge changes from topic "rockchip-uart-fixes" into integration 2019-08-15 15:30:13 +00:00
rpi/rpi3 rpi3: Move rng driver to drivers 2019-09-13 16:54:21 +01:00
socionext uniphier: set CONSOLE_FLAG_TRANSLATE_CRLF and clean up console driver 2019-09-03 09:08:16 +00:00
st stm32mp1: manage CONSOLE_FLAG_TRANSLATE_CRLF and cleanup driver 2019-09-10 17:21:58 +02:00
ti/k3 ti: k3: common: Trap all asynchronous bus errors to EL3 2019-07-04 12:14:46 -04:00
xilinx plat: xilinx: zynqmp: Initialize IPI table from zynqmp_config_setup() 2019-09-10 12:25:56 -07:00