summaryrefslogtreecommitdiff
path: root/target-arm/cpu.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@linaro.org>2014-10-24 12:19:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-10-24 12:19:13 +0100
commit98128601ac8ff23df8a4c48acff00f9614613463 (patch)
tree998d9e41c44b4c4e411583264a2a780e744f759b /target-arm/cpu.c
parent37e6456ef539b2c4d1b9438f3df90eb032a9618f (diff)
downloadqemu-98128601ac8ff23df8a4c48acff00f9614613463.tar.gz
target-arm: add emulation of PSCI calls for system emulation
Add support for handling PSCI calls in system emulation. Both version 0.1 and 0.2 of the PSCI spec are supported. Platforms can enable support by setting the "psci-conduit" QOM property on the cpus to SMC or HVC emulation and having a PSCI binding in their dtb. Signed-off-by: Rob Herring <rob.herring@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1412865028-17725-7-git-send-email-peter.maydell@linaro.org [PMM: made system reset/off PSCI functions power down the CPU so we obey the PSCI API requirement never to return from them; rearranged how the code is plumbed into the exception system, so that we split "is this a valid call?" from "do the call"] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/cpu.c')
-rw-r--r--target-arm/cpu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 2061cb75fa..e837f64538 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -334,9 +334,12 @@ static void arm_cpu_initfn(Object *obj)
cpu->psci_version = 1; /* By default assume PSCI v0.1 */
cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE;
- if (tcg_enabled() && !inited) {
- inited = true;
- arm_translate_init();
+ if (tcg_enabled()) {
+ cpu->psci_version = 2; /* TCG implements PSCI 0.2 */
+ if (!inited) {
+ inited = true;
+ arm_translate_init();
+ }
}
}
@@ -1090,6 +1093,7 @@ static const ARMCPUInfo arm_cpus[] = {
static Property arm_cpu_properties[] = {
DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false),
+ DEFINE_PROP_UINT32("psci-conduit", ARMCPU, psci_conduit, 0),
DEFINE_PROP_UINT32("midr", ARMCPU, midr, 0),
DEFINE_PROP_END_OF_LIST()
};