From patchwork Sun Apr 28 23:01:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16476 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 187C02395E for ; Sun, 28 Apr 2013 23:03:35 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id p7sf8681190qcq.2 for ; Sun, 28 Apr 2013 16:02:34 -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=pimc5/CSWD7KVxFhmqDBAca/1dkeSIGUaoSbwzTtWus=; b=JEp8UI+nx4bHUaOMiE34D+4jzJROaRQhiWS+DJql4JOjtVVQZReOZf+KIhP6HOTAry 8+D75yKZap1fmgsxPjQ/9KDmybZTk70FNtuqOGpq8mG0rx/TGvYk0yeV38TCm047kx+U iZ4VleGaRZGeR+nU8TgwszZ+AMAINKf8tsXXC5B3fvF+gSDFHQOLdRR5JAuVy3pxmEBH SOOmOFT+UkXcGeG19LQaVhNzhVktiYWxPy3/jMWNES6E6/r5waBkqoB9yoUTQgHeyFm7 GHLC6u7aY2vcTcPCtHfjMA1yBY5CpWIs6hnDFbpiTIc3HZJi1HXgJdVGLiAcWbzV4I2m NlvA== X-Received: by 10.224.88.200 with SMTP id b8mr38763460qam.8.1367190153991; Sun, 28 Apr 2013 16:02:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.37 with SMTP id r5ls2524928qeu.15.gmail; Sun, 28 Apr 2013 16:02:33 -0700 (PDT) X-Received: by 10.52.174.41 with SMTP id bp9mr15079148vdc.4.1367190153818; Sun, 28 Apr 2013 16:02:33 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id u19si8992054vcp.2.2013.04.28.16.02.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so4988333vcb.20 for ; Sun, 28 Apr 2013 16:02:33 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr27335069vdu.8.1367190153677; Sun, 28 Apr 2013 16:02:33 -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 nf2csp33789veb; Sun, 28 Apr 2013 16:02:33 -0700 (PDT) X-Received: by 10.180.13.179 with SMTP id i19mr14117920wic.18.1367190152826; Sun, 28 Apr 2013 16:02:32 -0700 (PDT) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [2a00:1450:400c:c00::232]) by mx.google.com with ESMTPS id eo2si3444405wic.82.2013.04.28.16.02.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:32 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::232 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::232; Received: by mail-wg0-f50.google.com with SMTP id m15so3269295wgh.29 for ; Sun, 28 Apr 2013 16:02:32 -0700 (PDT) X-Received: by 10.181.12.1 with SMTP id em1mr5294491wid.4.1367190152341; Sun, 28 Apr 2013 16:02:32 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id k5sm18711393wiy.5.2013.04.28.16.02.31 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:31 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, patches@linaro.org, anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Julien Grall Subject: [RFC 11/29] xen/arm: Introduce gic_route_dt_irq Date: Mon, 29 Apr 2013 00:01:54 +0100 Message-Id: <366b824864619d47572cd00cd62ef2c25dd513f7.1367188423.git.julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQmc4AFzNiO8SUFdagiJDgM9gqHIrlKDXBnm/daL83VDL1dEto2swDU/IM9wboZYpWxQ9qM1 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 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 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 bac2af2..e03bb67 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 = 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 c3f87e1..2fac673 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); @@ -141,6 +143,9 @@ extern int vcpu_vgic_init(struct vcpu *v); extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual); 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);