From patchwork Mon Jan 24 08:51:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 500541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0OJh2Up026265 for ; Mon, 24 Jan 2011 19:43:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374Ab1AXIvv (ORCPT ); Mon, 24 Jan 2011 03:51:51 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:38256 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350Ab1AXIvu (ORCPT ); Mon, 24 Jan 2011 03:51:50 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p0O8pSuK023048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Jan 2011 02:51:31 -0600 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p0O8pNGg016795; Mon, 24 Jan 2011 14:21:24 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id p0O8pNlw015332; Mon, 24 Jan 2011 14:21:23 +0530 Received: (from a0393909@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id p0O8pNRU015330; Mon, 24 Jan 2011 14:21:23 +0530 From: Santosh Shilimkar To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org, ccross@android.com, catalin.marinas@arm.com, linux@arm.linux.org.uk, linus.ml.walleij@gmail.com, Santosh Shilimkar , Russell King Subject: [PATCH 2/5] ARM: gic: Add distributor and interface enable/disable accessory api Date: Mon, 24 Jan 2011 14:21:16 +0530 Message-Id: <1295859080-15259-3-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.5.6.6 In-Reply-To: <1295859080-15259-1-git-send-email-santosh.shilimkar@ti.com> References: <1295859080-15259-1-git-send-email-santosh.shilimkar@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 24 Jan 2011 19:43:09 +0000 (UTC) diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index b4a9ea7..6384bb7 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c @@ -369,6 +369,30 @@ void __cpuinit gic_enable_ppi(unsigned int irq) local_irq_restore(flags); } +/* Used in power management paths */ +void gic_secondary_set(unsigned int gic_nr, unsigned int on) +{ + BUG_ON(gic_nr >= MAX_GIC_NR); + + if (on) { + __raw_writel(0xf0, gic_data[gic_nr].cpu_base + GIC_CPU_PRIMASK); + __raw_writel(1, gic_data[gic_nr].cpu_base + GIC_CPU_CTRL); + + } else { + __raw_writel(0, gic_data[gic_nr].cpu_base + GIC_CPU_CTRL); + } +} + +void gic_dist_set(unsigned int gic_nr, unsigned int on) +{ + BUG_ON(gic_nr >= MAX_GIC_NR); + + if (on) + __raw_writel(0x1, gic_data[gic_nr].dist_base + GIC_DIST_CTRL); + else + __raw_writel(0, gic_data[gic_nr].cpu_base + GIC_CPU_CTRL); +} + #ifdef CONFIG_SMP void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) { diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h index 0691f9d..638d9dc 100644 --- a/arch/arm/include/asm/hardware/gic.h +++ b/arch/arm/include/asm/hardware/gic.h @@ -41,6 +41,8 @@ void gic_secondary_init(unsigned int); void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); void gic_raise_softirq(const struct cpumask *mask, unsigned int irq); void gic_enable_ppi(unsigned int); +void gic_secondary_set(unsigned int gic_nr, unsigned int on); +void gic_dist_set(unsigned int gic_nr, unsigned int on); #endif #endif