From patchwork Wed Sep 19 23:42:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1481831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C5F433FE65 for ; Wed, 19 Sep 2012 23:52:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEU1j-0008Ao-Ih; Wed, 19 Sep 2012 23:49:56 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TEU1K-0007r9-C9 for linux-arm-kernel@lists.infradead.org; Wed, 19 Sep 2012 23:49:32 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq8so3826884pbb.36 for ; Wed, 19 Sep 2012 16:49:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tvYWsK/dU8UJVmIG9wn3l+POQTaiYI0mxeqyr0f3WaI=; b=Xk/c5O6Cebqcfy8NrNkgKQMH8VnPB1MvHBvkIJ/QB0iuVNaNGRfNOi+FsWc8WILi0y Bmk0jYi9zT6k6CgJfXfA6xoZ1033t+jIHTljiGoyJTd7G/BdE2VJlCuNwjNxxjRuHMtG 57jlcZdKM/4wJwhCVB8d/nsrD0V07oGqSTASuuoX3+2Xf5TsSewPuk1ocTP/33EdNlBc 4kM9iT6CTsYIdrtvvyE2NOUSZ8zw+GpDPCl5P0OOKFNZcgo1nJPOs8TgaU5T9HqIqu2C JosCs9ITcvMwWTqP6A+Xf00iYY71lX4lUman8c9vPWG43rMNO4J6ku+6iNu0BaXZm0l8 T/wA== Received: by 10.66.73.166 with SMTP id m6mr1111327pav.1.1348098570042; Wed, 19 Sep 2012 16:49:30 -0700 (PDT) Received: from localhost (ip-64-134-220-225.public.wayport.net. [64.134.220.225]) by mx.google.com with ESMTPS id gf8sm2538318pbc.52.2012.09.19.16.49.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2012 16:49:29 -0700 (PDT) From: Anton Vorontsov To: Andrew Morton , Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Subject: [PATCH 10/11] ARM: VIC: Add a couple of low-level FIQ management helpers Date: Wed, 19 Sep 2012 16:42:01 -0700 Message-Id: <1348098122-11041-10-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <20120919234003.GA24143@lizard> References: <20120919234003.GA24143@lizard> X-Gm-Message-State: ALoCoQmmm+6wDkEjDQE9LWZm9H1HhSKvVCdG1vmRsBEILON9wuqDIjo8gVF73UjrbO0Zc1RZyD/U X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, Brian Swetland , linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , John Stultz , linux-serial@vger.kernel.org, Colin Cross , kgdb-bugreport@lists.sourceforge.net, Thomas Gleixner , kernel-team@android.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Just a couple of calls to manage VIC FIQ routing. We'll use them for KGDB FIQ support on ARM Versatile machines. Signed-off-by: Anton Vorontsov --- arch/arm/common/vic.c | 28 ++++++++++++++++++++++++++++ arch/arm/include/asm/hardware/vic.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e0d5388..df2fc82 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c @@ -66,6 +66,34 @@ static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; static int vic_id; +static void __iomem *vic_base(struct irq_data *d) +{ + return (void __iomem *)irq_data_get_irq_chip_data(d); +} + +void vic_fiq_select(unsigned int irq, bool on) +{ + void __iomem *base = vic_base(&irq_to_desc(irq)->irq_data); + void __iomem *sel = base + VIC_INT_SELECT; + u32 msk = 1 << irq; + u32 val; + + pr_debug("rerouting VIC vector %d to %s\n", irq, on ? "FIQ" : "IRQ"); + + val = readl(sel); + val &= ~msk; + if (on) + val |= msk; + writel(val, sel); +} + +bool vic_is_fiq_rised(unsigned int irq) +{ + void __iomem *base = vic_base(&irq_to_desc(irq)->irq_data); + + return readl(base + VIC_FIQ_STATUS) & (1 << irq); +} + /** * vic_init2 - common initialisation code * @base: Base of the VIC. diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h index e14af1a..2728975 100644 --- a/arch/arm/include/asm/hardware/vic.h +++ b/arch/arm/include/asm/hardware/vic.h @@ -52,6 +52,8 @@ void __vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); int vic_of_init(struct device_node *node, struct device_node *parent); void vic_handle_irq(struct pt_regs *regs); +void vic_fiq_select(unsigned int irq, bool on); +bool vic_is_fiq_rised(unsigned int irq); #endif /* __ASSEMBLY__ */ #endif