From patchwork Fri Oct 24 11:37:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 39456 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 688A624026 for ; Fri, 24 Oct 2014 12:03:56 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf1759230lab.2 for ; Fri, 24 Oct 2014 05:03:55 -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: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=DlwsUyo+chvtoOECtistyTnB6d+r6Fa77O4eq3mucTs=; b=XS3sz7Q+rW5dBEnixBJWhSAFanCAJ8yJ4wpzi1g7wn5fQKDpQVu9jEDHTQfHTkKP6T g18dbM1Oo8lD4EuuoIbgdCVD0utDeVZVj4wbWS6/gCvrpDTD1s7wEBciVzdShyTMQJz9 xQRQCsnCkNGr/NWOAg2YFM+snLr3onsZ5UGlw+98Z7ebiHvAjZkMLi8SeTJDj7xWfpWY P1XeWXEfIXihO2RNsYaihybm1hdFxw4euXcKofjl/WAQ26GlqiF453kV6RbK2PQ3dJDW TUZo4Fh2uhjly6nGCcbO4EhATubsv2qA9YP9kQhZJlANHqhBQnMjyXvaVqW8bsUkyH9E jnUQ== X-Gm-Message-State: ALoCoQmCBQ5uYW6XMuQk19e6J1NrrBlGc2pHyxyDggUf0tn0E/LuyotJSaXAHKhwTtW5KHQcqa29 X-Received: by 10.112.217.102 with SMTP id ox6mr379917lbc.19.1414152235293; Fri, 24 Oct 2014 05:03:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls91182lae.38.gmail; Fri, 24 Oct 2014 05:03:55 -0700 (PDT) X-Received: by 10.152.23.3 with SMTP id i3mr3996769laf.53.1414152235142; Fri, 24 Oct 2014 05:03:55 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id z7si6729478lag.18.2014.10.24.05.03.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 05:03:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id mc6so2546492lab.16 for ; Fri, 24 Oct 2014 05:03:54 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr3949941laa.71.1414152234724; Fri, 24 Oct 2014 05:03:54 -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.112.84.229 with SMTP id c5csp414753lbz; Fri, 24 Oct 2014 05:03:54 -0700 (PDT) X-Received: by 10.52.30.232 with SMTP id v8mr2312646vdh.24.1414152233475; Fri, 24 Oct 2014 05:03:53 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id wk2si2471341vcb.10.2014.10.24.05.03.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 05:03:53 -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]:47287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xhdaw-0005ST-1i for patch@linaro.org; Fri, 24 Oct 2014 08:03:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhdBh-0006fJ-84 for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhdBg-0008VE-0c for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:45 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhdBf-0008OE-Q1 for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:43 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XhdBR-0007vN-Hh for qemu-devel@nongnu.org; Fri, 24 Oct 2014 12:37:29 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Oct 2014 12:37:08 +0100 Message-Id: <1414150649-30428-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414150649-30428-1-git-send-email-peter.maydell@linaro.org> References: <1414150649-30428-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 02/23] hw/arm/virt: mark timer in fdt as v8-compatible 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: peter.maydell@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.215.43 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 From: Claudio Fontana check if the first cpu is an armv8 cpu, and if so, put arm,armv8-timer in the compatible string list. Note that due to this check, this patch moves the creation of the timer fdt node to after the cpu creation loop. Signed-off-by: Claudio Fontana Message-id: 1411736960-24206-1-git-send-email-hw.claudio@gmail.com [PMM: updated to list arm,armv8-timer first] Signed-off-by: Peter Maydell --- hw/arm/virt.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8ea592e..5c010e5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -240,14 +240,23 @@ static void fdt_add_timer_nodes(const VirtBoardInfo *vbi) * but for the GIC implementation provided by both QEMU and KVM * they are edge-triggered. */ + ARMCPU *armcpu; uint32_t irqflags = GIC_FDT_IRQ_FLAGS_EDGE_LO_HI; irqflags = deposit32(irqflags, GIC_FDT_IRQ_PPI_CPU_START, GIC_FDT_IRQ_PPI_CPU_WIDTH, (1 << vbi->smp_cpus) - 1); qemu_fdt_add_subnode(vbi->fdt, "/timer"); - qemu_fdt_setprop_string(vbi->fdt, "/timer", - "compatible", "arm,armv7-timer"); + + armcpu = ARM_CPU(qemu_get_cpu(0)); + if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { + const char compat[] = "arm,armv8-timer\0arm,armv7-timer"; + qemu_fdt_setprop(vbi->fdt, "/timer", "compatible", + compat, sizeof(compat)); + } else { + qemu_fdt_setprop_string(vbi->fdt, "/timer", "compatible", + "arm,armv7-timer"); + } qemu_fdt_setprop_cells(vbi->fdt, "/timer", "interrupts", GIC_FDT_IRQ_TYPE_PPI, 13, irqflags, GIC_FDT_IRQ_TYPE_PPI, 14, irqflags, @@ -555,7 +564,6 @@ static void machvirt_init(MachineState *machine) } create_fdt(vbi); - fdt_add_timer_nodes(vbi); for (n = 0; n < smp_cpus; n++) { ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model); @@ -579,6 +587,7 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, true, "realized", NULL); } + fdt_add_timer_nodes(vbi); fdt_add_cpu_nodes(vbi); fdt_add_psci_node(vbi);