From patchwork Fri Jun 21 00:35:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2759361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D89219F751 for ; Fri, 21 Jun 2013 00:36:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E42DE201D6 for ; Fri, 21 Jun 2013 00:36:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCE05201CE for ; Fri, 21 Jun 2013 00:36:24 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppKr-0000QP-9p; Fri, 21 Jun 2013 00:36:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppKo-0004p3-AK; Fri, 21 Jun 2013 00:36:14 +0000 Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppKk-0004n7-FM for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 00:36:11 +0000 Received: by mail-ee0-f54.google.com with SMTP id t10so4280417eei.41 for ; Thu, 20 Jun 2013 17:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=8AQMgKSIltAzDfADPeUEK1KnWHAL7dXk6wa+Y2IvPyc=; b=MUnWtAzZvIEvUJVwWROrgE/QzTsw8se/EycZuvp1Svs/T0bfwV5SEPbNAcTyWhpteH O5nxEzrfWaIgcgna+7uZSZCg/M3fN/6sBAU0fmApk/05b2gJ3O1M/PupeZDR1jEBT2nv jifVa+bT7K59z4nI9sXOKJtkK3as0liHIXr8V7iRFo4/T//XUXc4z0IZ7eP1ZWgZy/bV qI43Lux4Bi+NujnTPXuzlmnw2S/Nes/CCmi5JlncH7crrUu0MNhQ0vo/Zf5ZuhhOvw/3 hKn9/rv7zRusaQO5Fu3wclkNSlo10T5x5CsnaiH5FvIhCiJWcSUyUnYr3uqWuqk6TuRX WhVQ== X-Received: by 10.14.115.9 with SMTP id d9mr9992431eeh.87.1371774945344; Thu, 20 Jun 2013 17:35:45 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id m1sm3910115eex.17.2013.06.20.17.35.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 17:35:44 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v6 1/8] ARM: common: vic: Parse interrupt and resume masks from device tree Date: Fri, 21 Jun 2013 02:35:17 +0200 Message-Id: <1371774924-9224-2-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371774924-9224-1-git-send-email-tomasz.figa@gmail.com> References: <1371774924-9224-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_203610_651863_7BAB8330 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Russell King , Jason Cooper , Arnd Bergmann , Nicolas Pitre , Marc Zyngier , devicetree-discuss@lists.ozlabs.org, Stephen Warren , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , Tomasz Figa , Grant Likely , Mark Brown , Olof Johansson , Benoit Cousson , Thomas Gleixner , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch extends vic_of_init to parse valid interrupt sources and resume sources masks from device tree. If mask values are not specified in device tree, all sources are assumed to be valid, as before this patch. Signed-off-by: Tomasz Figa --- Documentation/devicetree/bindings/arm/vic.txt | 6 ++++++ drivers/irqchip/irq-vic.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt index 266716b..bb7137c 100644 --- a/Documentation/devicetree/bindings/arm/vic.txt +++ b/Documentation/devicetree/bindings/arm/vic.txt @@ -18,6 +18,9 @@ Required properties: Optional properties: - interrupts : Interrupt source for parent controllers if the VIC is nested. +- interrupt-mask : Bit mask of valid interrupt sources (defaults to all valid) +- wakeup-mask : Bit mask of interrupt sources that can wake up the system + (defaults to all allowed) Example: @@ -26,4 +29,7 @@ Example: interrupt-controller; #interrupt-cells = <1>; reg = <0x60000 0x1000>; + + interrupt-mask = <0xffffff7f>; + wakeup-mask = <0x0000ff7f>; }; diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 2bbb004..d56750eb 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c @@ -469,6 +469,8 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, int __init vic_of_init(struct device_node *node, struct device_node *parent) { void __iomem *regs; + u32 interrupt_mask = ~0; + u32 wakeup_mask = ~0; if (WARN(parent, "non-root VICs are not supported")) return -EINVAL; @@ -477,10 +479,13 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) if (WARN_ON(!regs)) return -EIO; + of_property_read_u32(node, "interrupt-mask", &interrupt_mask); + of_property_read_u32(node, "wakeup-mask", &wakeup_mask); + /* * Passing 0 as first IRQ makes the simple domain allocate descriptors */ - __vic_init(regs, 0, ~0, ~0, node); + __vic_init(regs, 0, interrupt_mask, wakeup_mask, node); return 0; }