From patchwork Wed May 8 02:33:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16746 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6DBCE238FD for ; Wed, 8 May 2013 02:35:08 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id g10sf1904428qah.2 for ; Tue, 07 May 2013 19:34:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=O27khc/KOn3jUVs3tMW2kCWl+FSQYwNVPvX7M57h2lU=; b=iwwcHq3udDkz70QBYY0PFfKKpNMMaD1cvcc8TtNFZe8oeuFHKcbYtrnv0MX2oEzTa2 dwJm3N9Z9NBN37RQslr0w2ELZslfHhYExiqJOew3QdLjHrNmXCdkvHDftDvJeDjIHyeY 0MO0P1HnvFsKV5Tqf4FM3aUJ7QnUa9MUcNOdtH6741P8DXUFotEOLqd9NrtygyuS4Bgk LrS2FJl0ij7p2SdXRA6dv6PpSLLzRG43UTTdZj6UB/G/+wDF8VEnObDfq/xPUqYWuuWA 7WRK3mGmcPHdysVBBfakMRfOaOfl/+6DBpDHRHM2sr6Ad8ALoHFCaEJybdo6f/EOOUGM quRw== X-Received: by 10.224.130.195 with SMTP id u3mr6527272qas.1.1367980488275; Tue, 07 May 2013 19:34:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.16.164 with SMTP id h4ls619716qed.40.gmail; Tue, 07 May 2013 19:34:47 -0700 (PDT) X-Received: by 10.220.177.8 with SMTP id bg8mr3126643vcb.35.1367980487923; Tue, 07 May 2013 19:34:47 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id ez9si14124320vdb.146.2013.05.07.19.34.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::230; Received: by mail-vb0-f48.google.com with SMTP id q16so1150487vbe.21 for ; Tue, 07 May 2013 19:34:47 -0700 (PDT) X-Received: by 10.52.66.101 with SMTP id e5mr2695575vdt.57.1367980487839; Tue, 07 May 2013 19:34:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp131009veb; Tue, 7 May 2013 19:34:47 -0700 (PDT) X-Received: by 10.180.212.46 with SMTP id nh14mr18301974wic.26.1367980486075; Tue, 07 May 2013 19:34:46 -0700 (PDT) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [2a00:1450:400c:c00::22b]) by mx.google.com with ESMTPS id ua15si1340236wib.2.2013.05.07.19.34.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:46 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22b is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::22b; Received: by mail-wg0-f43.google.com with SMTP id c11so1306546wgh.34 for ; Tue, 07 May 2013 19:34:45 -0700 (PDT) X-Received: by 10.194.61.10 with SMTP id l10mr7143373wjr.32.1367980485584; Tue, 07 May 2013 19:34:45 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id v6sm6823630wiy.11.2013.05.07.19.34.44 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:44 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: Stefano.Stabellini@eu.citrix.com, patches@linaro.org, ian.campbell@citrix.com, Julien Grall Subject: [PATCH V2 11/33] xen/arm: Introduce gic_route_dt_irq Date: Wed, 8 May 2013 03:33:31 +0100 Message-Id: <4a02970d6042bb5317d14cf76e21d1b9016c2ef5.1367979526.git.julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQm0SCRDk6/5M0EJGiu7SwGt+V9VA/R+Pdtn2gAVBPROUgKG/5LiIssbZWnRh1+A6jXpxSJc X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This function routes an IRQ to a specific cpu. The IRQ is retrieved via the device tree. Signed-off-by: Julien Grall Changes in v2: - Use dt_irq_is_level_trigger instead of the old name irq_is_level_trigger Acked-by: Ian Campbell --- xen/arch/arm/gic.c | 11 +++++++++++ xen/include/asm-arm/gic.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 6d71aae..b9fbe3d 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -238,6 +238,17 @@ static int gic_route_irq(unsigned int irq, bool_t level, return 0; } +/* Program the GIC to route an interrupt with a dt_irq */ +void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask, + unsigned int priority) +{ + bool_t level; + + level = dt_irq_is_level_trigger(irq); + + gic_route_irq(irq->irq, level, cpu_mask, priority); +} + static void __init gic_dist_init(void) { uint32_t type; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 3efb2b5..78dd21a 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -133,6 +133,8 @@ #define VGIC_IRQ_EVTCHN_CALLBACK 31 #ifndef __ASSEMBLY__ +#include + extern int domain_vgic_init(struct domain *d); extern void domain_vgic_free(struct domain *d); @@ -142,6 +144,9 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual); extern void vgic_clear_pending_irqs(struct vcpu *v); extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq); +/* Program the GIC to route an interrupt with a dt_irq */ +extern void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask, + unsigned int priority); extern void gic_route_ppis(void); extern void gic_route_spis(void);