From patchwork Thu Aug 13 10:44:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 52381 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id B39AD2031F for ; Thu, 13 Aug 2015 11:11:13 +0000 (UTC) Received: by labd1 with SMTP id d1sf15645379lab.0 for ; Thu, 13 Aug 2015 04:11:12 -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=L75aFLy5f2KXY9q/bEY6RwUEt6bNGm5IeN1BxT6IZqQ=; b=aciDh5IGpTXfY1rs3Ix8KHg6hJDbRMPLdK0QpYpfx377ijcGjPoJKqDyaAQbmXwUZN FG2aeKU58L9fu56gEZSbL965U8PKvmEKlLyQRNhKHmxd2bszqi6GdgGGW1a7HOREM3vq DmjYaEP/sInRQNTOCBEBA6gNBc3gt/pFwfQh/ZAKG0uw2pRirUp9YQXkflG8SwpafhJH JViMr0dfEO1ZQtigiDtwiizOKhgR9kZ/nGPenWuivBlGZolwee2JCo+evIe5caAZ4LQr aKi7FoFOB1N3vvaAuilq5bqKzO1QA7GWEO+wKRBTkbApUPdib3eUK2Xx8hv9UpPxl2Jj pExw== X-Gm-Message-State: ALoCoQmlHx01s5h8J79VbO7qyR2S17/Uo8kW30Q1WQXxif6JOupHbQw1IS9cBBL6gmvGp2Uv/JTm X-Received: by 10.152.182.226 with SMTP id eh2mr11013851lac.0.1439464272764; Thu, 13 Aug 2015 04:11:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.1 with SMTP id m1ls178813laj.32.gmail; Thu, 13 Aug 2015 04:11:12 -0700 (PDT) X-Received: by 10.112.122.78 with SMTP id lq14mr10295451lbb.5.1439464272357; Thu, 13 Aug 2015 04:11:12 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id f5si1850671lah.164.2015.08.13.04.11.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 04:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lahi9 with SMTP id i9so24007556lah.2 for ; Thu, 13 Aug 2015 04:11:11 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr35307603lbc.41.1439464271786; Thu, 13 Aug 2015 04:11:11 -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.7.198 with SMTP id l6csp869332lba; Thu, 13 Aug 2015 04:11:10 -0700 (PDT) X-Received: by 10.107.153.200 with SMTP id b191mr1488185ioe.185.1439464270174; Thu, 13 Aug 2015 04:11:10 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 9si1215955ios.179.2015.08.13.04.11.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Aug 2015 04:11:10 -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]:41876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPqPd-0000Ti-0H for patch@linaro.org; Thu, 13 Aug 2015 07:11:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0P-0005TV-9h for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPq0M-0005Qv-Ut for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:05 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0M-0005DT-MZ for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:02 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZPq08-000724-Eq for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:48 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Aug 2015 11:44:46 +0100 Message-Id: <1439462687-26903-27-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1439462687-26903-1-git-send-email-peter.maydell@linaro.org> References: <1439462687-26903-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 26/27] hw/cpu/a15mpcore: Wire up hyp and secure physical timer interrupts 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.52 as permitted sender) smtp.mailfrom=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 Since we now support both the hypervisor and the secure physical timer, wire their interrupt lines up in the a15mpcore wrapper object. Signed-off-by: Peter Maydell Message-id: 1437047249-2357-5-git-send-email-peter.maydell@linaro.org Reviewed-by: Edgar E. Iglesias --- hw/cpu/a15mpcore.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index e31a1f9..58ac02e 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -75,14 +75,21 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp) for (i = 0; i < s->num_cpu; i++) { DeviceState *cpudev = DEVICE(qemu_get_cpu(i)); int ppibase = s->num_irq - 32 + i * 32; - /* physical timer; we wire it up to the non-secure timer's ID, - * since a real A15 always has TrustZone but QEMU doesn't. + int irq; + /* Mapping from the output timer irq lines from the CPU to the + * GIC PPI inputs used on the A15: */ - qdev_connect_gpio_out(cpudev, 0, - qdev_get_gpio_in(gicdev, ppibase + 30)); - /* virtual timer */ - qdev_connect_gpio_out(cpudev, 1, - qdev_get_gpio_in(gicdev, ppibase + 27)); + const int timer_irq[] = { + [GTIMER_PHYS] = 30, + [GTIMER_VIRT] = 27, + [GTIMER_HYP] = 26, + [GTIMER_SEC] = 29, + }; + for (irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) { + qdev_connect_gpio_out(cpudev, irq, + qdev_get_gpio_in(gicdev, + ppibase + timer_irq[irq])); + } } /* Memory map (addresses are offsets from PERIPHBASE):