From patchwork Mon Jun 16 06:53:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 31914 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C9B43206A0 for ; Mon, 16 Jun 2014 06:56:50 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uz6sf29298582obc.8 for ; Sun, 15 Jun 2014 23:56:50 -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=UcXus+bZUk0yoAlflI6/cNENLPpNC4+TQB6qiA2aLBk=; b=Wudf3Z1vBRugL7QzEk53MDyhHrAatFZDB89jWWpftqAZLGVQrQRzqIGr+0zd8fG88b ZEl+7kzebLNYZfqJAbzOGYKIzW5YF8DkevhkyCB1V7F2ULl71DVHGdjB4UnN2QILfk/F lQa1FQwtUAf1wJzUGRx52rTvGuoztsF4r1fwIhAJdeYkmcdmh05WBJARC/+DkiVI34t7 unzK+ftfon3j2F+oWuFqAceCfsiOZRGdjyC8F0PWD2kugqQa7s+MkuchKrwy2V3igYod KBZ0jPnPcj0YkUYGVoKaShT0yzvZabC5SxGCobs8qegQohxVhF3RblDGTSp63ydQx8tG 1lOA== X-Gm-Message-State: ALoCoQlAv602rf8ynQa3Dmw1kpVfZq0CTZeOiBBgiFGtsUhuxlC1vGPLNauMWunoEiIbK9gEI8qU X-Received: by 10.182.86.5 with SMTP id l5mr8918047obz.32.1402901810308; Sun, 15 Jun 2014 23:56:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.240 with SMTP id j103ls4242792qgd.47.gmail; Sun, 15 Jun 2014 23:56:50 -0700 (PDT) X-Received: by 10.58.109.71 with SMTP id hq7mr3418715veb.26.1402901810186; Sun, 15 Jun 2014 23:56:50 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id y17si3744476vdg.107.2014.06.15.23.56.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so4610608vcb.30 for ; Sun, 15 Jun 2014 23:56:50 -0700 (PDT) X-Received: by 10.52.189.161 with SMTP id gj1mr12406191vdc.2.1402901810110; Sun, 15 Jun 2014 23:56:50 -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.221.54.6 with SMTP id vs6csp114122vcb; Sun, 15 Jun 2014 23:56:49 -0700 (PDT) X-Received: by 10.140.98.234 with SMTP id o97mr22969374qge.35.1402901809751; Sun, 15 Jun 2014 23:56:49 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y9si12135276qat.45.2014.06.15.23.56.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:56:49 -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]:41845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQqX-0002hS-BU for patch@linaro.org; Mon, 16 Jun 2014 02:56:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQoI-0007TB-2p for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwQoC-0003gQ-6z for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:30 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:50673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQoC-0003gE-2Z for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:24 -0400 Received: by mail-pd0-f176.google.com with SMTP id ft15so528650pdb.35 for ; Sun, 15 Jun 2014 23:54:23 -0700 (PDT) X-Received: by 10.66.131.39 with SMTP id oj7mr21801208pab.20.1402901663387; Sun, 15 Jun 2014 23:54:23 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id op3sm16777787pbc.40.2014.06.15.23.54.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:54:22 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 16 Jun 2014 12:23:25 +0530 Message-Id: <1402901605-24551-9-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402901605-24551-1-git-send-email-pranavkumar@linaro.org> References: <1402901605-24551-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.192.176 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 V7 8/8] 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.171 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 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);