[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/14] Use PSCI v0.2 compatible string when KVM or TC
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 13/14] Use PSCI v0.2 compatible string when KVM or TCG provides it |
Date: |
Thu, 19 Jun 2014 18:36:56 +0100 |
From: Pranavkumar Sawargaonkar <address@hidden>
If we have PSCI v0.2 emulation available for KVM ARM/ARM64 or TCG then
we need to provide PSCI v0.2 compatible string via generated DTB.
Signed-off-by: Pranavkumar Sawargaonkar <address@hidden>
Signed-off-by: Anup Patel <address@hidden>
Reviewed-by: Rob Herring <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
hw/arm/virt.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 3b55a4b..72fe030 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -180,10 +180,23 @@ static void create_fdt(VirtBoardInfo *vbi)
"clk24mhz");
qemu_fdt_setprop_cell(fdt, "/apb-pclk", "phandle", vbi->clock_phandle);
+}
+
+static void fdt_add_psci_node(const VirtBoardInfo *vbi)
+{
+ void *fdt = vbi->fdt;
+ ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));
+
/* No PSCI for TCG yet */
if (kvm_enabled()) {
qemu_fdt_add_subnode(fdt, "/psci");
- qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");
+ if (armcpu->psci_version == 2) {
+ const char comp[] = "arm,psci-0.2\0arm,psci";
+ qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
+ } else {
+ qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");
+ }
+
qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc");
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend",
PSCI_FN_CPU_SUSPEND);
@@ -446,6 +459,7 @@ static void machvirt_init(MachineState *machine)
object_property_set_bool(cpuobj, true, "realized", NULL);
}
fdt_add_cpu_nodes(vbi);
+ fdt_add_psci_node(vbi);
memory_region_init_ram(ram, NULL, "mach-virt.ram", machine->ram_size);
vmstate_register_ram_global(ram);
--
1.9.2
- [Qemu-devel] [PULL 09/14] target-arm: Common kvm_arm_vcpu_init() for KVM ARM and KVM ARM64, (continued)
- [Qemu-devel] [PULL 09/14] target-arm: Common kvm_arm_vcpu_init() for KVM ARM and KVM ARM64, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 08/14] kvm: Handle exit reason KVM_EXIT_SYSTEM_EVENT, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 06/14] hw/arm/vexpress: Forbid specifying flash contents in two ways at once, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 04/14] target-arm/translate-a64.c: Remove dead ?: in disas_simd_3same_int(), Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 07/14] hw/block/pflash_cfi01: Report correct size info for parallel configs, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 03/14] target-arm: Add ULL suffix to calculation of page size, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 10/14] target-arm: Enable KVM_ARM_VCPU_PSCI_0_2 feature when possible, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 02/14] hw/arm/spitz: Avoid clash with Windows header symbol MOD_SHIFT, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 01/14] target-arm: implement PD0/PD1 bits for TTBCR, Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 05/14] target-arm/translate-a64.c: Fix dead ?: in handle_simd_shift_fpint_conv(), Peter Maydell, 2014/06/19
- [Qemu-devel] [PULL 13/14] Use PSCI v0.2 compatible string when KVM or TCG provides it,
Peter Maydell <=
- Re: [Qemu-devel] [PULL 00/14] target-arm queue, Peter Maydell, 2014/06/20