From patchwork Thu May 22 11:18:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 30608 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9317A20369 for ; Thu, 22 May 2014 11:25:01 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf14594647obc.11 for ; Thu, 22 May 2014 04:25:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=SoLA4707iN24CU+abApAgFzNxrvbQIIIRsVSGql9vOU=; b=hyGb6nm+pDjX4Y0gux9zQS0QGpPKkBIYtf129q3XlccZHeDPbnYG8L+IF3jxhizsDe ZNqmCOasoxm0PZaeIcd5yoVeXgRl1HyWM82SP0qa0cJpSFUrAYnys6kJtH2v2vD6xGg9 ofEc2ctb2CVvpRYqsbfGjLkl1cfDcAP6YbhkUPmbv7tu88ki+H6KsDKS44yQGY2ESk+E oUDIRggeuJx9+vC5ejj2cqdVfr4CVw58Ri+4lC1YX8tZVoEFaCPZ1FBmUZgyKRRr8sxM RU7VhX4EJv3A1JfRsBukXdW59Ny3mAFknXgVF79Z53VLbb5eAyX02FdE7F+io96rv/tW 3XEw== X-Gm-Message-State: ALoCoQnOJgLTYFHiKyGuMO75wu8JwQdk7JMf8QUsD2Qh6Wi8TkTNe9tAwYjvgU9KQt+jlyP/sO6Y X-Received: by 10.182.103.199 with SMTP id fy7mr26289191obb.18.1400757900744; Thu, 22 May 2014 04:25:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.83 with SMTP id 77ls1134328qgg.28.gmail; Thu, 22 May 2014 04:25:00 -0700 (PDT) X-Received: by 10.220.249.6 with SMTP id mi6mr14958129vcb.33.1400757900652; Thu, 22 May 2014 04:25:00 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id 8si2939743vdx.54.2014.05.22.04.25.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so4215666vcb.18 for ; Thu, 22 May 2014 04:25:00 -0700 (PDT) X-Received: by 10.221.50.70 with SMTP id vd6mr82914vcb.51.1400757900571; Thu, 22 May 2014 04:25:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp190003vcb; Thu, 22 May 2014 04:25:00 -0700 (PDT) X-Received: by 10.140.95.80 with SMTP id h74mr75045724qge.2.1400757900203; Thu, 22 May 2014 04:25:00 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y10si4883195qaj.18.2014.05.22.04.25.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 04:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:36777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR7L-0003Tf-Od for patch@linaro.org; Thu, 22 May 2014 07:24:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR2B-00030I-FS for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnR24-0005LK-PD for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:39 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR24-0005LB-Jl for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:32 -0400 Received: by mail-pa0-f44.google.com with SMTP id ld10so2401025pab.31 for ; Thu, 22 May 2014 04:19:32 -0700 (PDT) X-Received: by 10.66.121.131 with SMTP id lk3mr65879857pab.61.1400757572077; Thu, 22 May 2014 04:19:32 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id xr9sm118782087pab.5.2014.05.22.04.19.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:19:31 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Thu, 22 May 2014 16:48:06 +0530 Message-Id: <1400757486-2860-9-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400757486-2860-1-git-send-email-pranavkumar@linaro.org> References: <1400757486-2860-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.44 Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, robherring2@gmail.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [PATCH V6 8/8] hw/arm/virt: Use PSCI v0.2 compatible string when KVM or TCG provides it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Signed-off-by: Anup Patel Reviewed-by: Rob Herring --- 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 ea4f02d..442363c 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(QEMUMachineInitArgs *args) 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", args->ram_size); vmstate_register_ram_global(ram);