From patchwork Thu Jun 16 19:56:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 9181519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75F4B60776 for ; Thu, 16 Jun 2016 19:58:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 691C12837F for ; Thu, 16 Jun 2016 19:58:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DE6028387; Thu, 16 Jun 2016 19:58:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E37DC2837F for ; Thu, 16 Jun 2016 19:58:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDdPk-0004jQ-1W; Thu, 16 Jun 2016 19:57:20 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDdPh-0004de-4l for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2016 19:57:17 +0000 Received: by mail-lf0-x243.google.com with SMTP id l188so6220931lfe.0 for ; Thu, 16 Jun 2016 12:56:56 -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; bh=blsqBWfPyCJVum5EUGUWYcm90GPPkob1c2+3QLdB/PI=; b=DerlWvUUoOFCCAcYKm/ZaK0YDPX8nul3A/P2IxYkAGWZLHZaFEx2d+Sj0hAS6Egk4q UVX8+B4yH83D2Mf3mtR617B8eGqHXTegtJBC7+jj0fX/REL1XVv+9gZgyB9pASdjVQrh bk9P+LMJfGoaMe2nqOdw1RdTmeHR6xnHI58nzbBxHSjSzOJWxxNTRJV0NyfKQEDFTcE0 Qfn409oLFsceGeSgCNo9heU1Ll/5QiIWYKYn4vMA+4/l89GwW7jtOWIG1zxXshXYqONX XO5SDSHjnbneYbEw61qKfnTLX18mIFU6bkVcDkkuExwD1uK7m6JUyYUZWzjideOcTXBB SlwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=blsqBWfPyCJVum5EUGUWYcm90GPPkob1c2+3QLdB/PI=; b=KgaCSg+NRDgTFjt8/FXsro2JITLgA/OZMwNWhuLkueRFCoylD2izsiiOckob2bKydK XlEK+8EhVgyH5AFgElHfZaLZf0vHmseJkTShyCuv17+8adCf/qf3cy2s5KYDuS/EGN6A 05DtT8PCLz/rKFtJ7iOvjQtYM2RJ6HHhUkq+5c/Jkz+w8SFm5m+90uVHGCfuaGbndnDf ezQwHuvjosxT1Fg+5aSSfkmgsjQWemaenXYW6JFIAo/I8mjsWNgkgVPW6z6igBZ0JIYn Zr/v+W3ZKQ4FmwmUK/5HCkQriCduqqLmXH4WF3IlSQTOIQXAMI2YCTH7oJfzhrgcE7UH rO1A== X-Gm-Message-State: ALyK8tKajHdKcenTO9kpKsRM7EdkkKuZsct8bfFW/XmRslNQkcjlGCv7FG5X2sMHnWm3ew== X-Received: by 10.46.5.137 with SMTP id 131mr1578686ljf.8.1466107014902; Thu, 16 Jun 2016 12:56:54 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id 80sm4227232lfv.20.2016.06.16.12.56.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2016 12:56:54 -0700 (PDT) From: Janusz Krzysztofik To: Russell King , Tony Lindgren Subject: [PATCH] arm: omap1: fix ams-delta FIQ handler to work with sparse IRQ Date: Thu, 16 Jun 2016 21:56:30 +0200 Message-Id: <1466106990-9556-1-git-send-email-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.7.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160616_125717_481423_C33825CC X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-omap@vger.kernel.org, Janusz Krzysztofik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After OMAP1 IRQ definitions have been changed by commit 685e2d08c54b ("ARM: OMAP1: Change interrupt numbering for sparse IRQ") introduced in v4.2, ams-delta FIQ handler which depends on them no longer works as expected. Fix it. Created and tested on Amstrad Delta against Linux-4.7-rc3 Signed-off-by: Janusz Krzysztofik --- arch/arm/mach-omap1/ams-delta-fiq-handler.S | 6 +++--- arch/arm/mach-omap1/ams-delta-fiq.c | 5 +++-- arch/arm/mach-omap1/include/mach/ams-delta-fiq.h | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S index 5d7fb59..bf60844 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S +++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S @@ -43,8 +43,8 @@ #define OTHERS_MASK (MODEM_IRQ_MASK | HOOK_SWITCH_MASK) /* IRQ handler register bitmasks */ -#define DEFERRED_FIQ_MASK (0x1 << (INT_DEFERRED_FIQ % IH2_BASE)) -#define GPIO_BANK1_MASK (0x1 << INT_GPIO_BANK1) +#define DEFERRED_FIQ_MASK OMAP_IRQ_BIT(INT_DEFERRED_FIQ) +#define GPIO_BANK1_MASK OMAP_IRQ_BIT(INT_GPIO_BANK1) /* Driver buffer byte offsets */ #define BUF_MASK (FIQ_MASK * 4) @@ -110,7 +110,7 @@ ENTRY(qwerty_fiqin_start) mov r8, #2 @ reset FIQ agreement str r8, [r12, #IRQ_CONTROL_REG_OFFSET] - cmp r10, #INT_GPIO_BANK1 @ is it GPIO bank interrupt? + cmp r10, #(INT_GPIO_BANK1 - NR_IRQS_LEGACY) @ is it GPIO interrupt? beq gpio @ yes - process it mov r8, #1 diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c index d1f1209..ec760ae 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq.c +++ b/arch/arm/mach-omap1/ams-delta-fiq.c @@ -109,7 +109,8 @@ void __init ams_delta_init_fiq(void) * Since no set_type() method is provided by OMAP irq chip, * switch to edge triggered interrupt type manually. */ - offset = IRQ_ILR0_REG_OFFSET + INT_DEFERRED_FIQ * 0x4; + offset = IRQ_ILR0_REG_OFFSET + + ((INT_DEFERRED_FIQ - NR_IRQS_LEGACY) & 0x1f) * 0x4; val = omap_readl(DEFERRED_FIQ_IH_BASE + offset) & ~(1 << 1); omap_writel(val, DEFERRED_FIQ_IH_BASE + offset); @@ -149,7 +150,7 @@ void __init ams_delta_init_fiq(void) /* * Redirect GPIO interrupts to FIQ */ - offset = IRQ_ILR0_REG_OFFSET + INT_GPIO_BANK1 * 0x4; + offset = IRQ_ILR0_REG_OFFSET + (INT_GPIO_BANK1 - NR_IRQS_LEGACY) * 0x4; val = omap_readl(OMAP_IH1_BASE + offset) | 1; omap_writel(val, OMAP_IH1_BASE + offset); } diff --git a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h index adb5e76..6dfc3e1 100644 --- a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h +++ b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h @@ -14,6 +14,8 @@ #ifndef __AMS_DELTA_FIQ_H #define __AMS_DELTA_FIQ_H +#include + /* * Interrupt number used for passing control from FIQ to IRQ. * IRQ12, described as reserved, has been selected.