From patchwork Sun Jan 22 12:15:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 718142 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v5th73y5Vz9sCX for ; Sun, 22 Jan 2017 23:15:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="iVs4RcOV"; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id ABBDDB90FCB; Sun, 22 Jan 2017 13:15:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Sun, 22 Jan 2017 13:15:32 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4B27FB90FCB for ; Sun, 22 Jan 2017 13:15:30 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .linaro. - helo: .mail-lf0-f53.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 22 Jan 2017 13:15:29 +0100 (CET) Received: by mail-lf0-f53.google.com with SMTP id n124so80460263lfd.2 for ; Sun, 22 Jan 2017 04:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Rb4KCMLZmVLqHvHOC9FsG9F5TRFCkHWdjVG1JaJUCLA=; b=iVs4RcOVVPepZtlN8p16WZuysQ0CwXNESagf/kgjJJvOynlhoEGTuotZQPJpbpyP6e G08GAqPrfPVMDUk2BOAZ38wpOS4F6h/uWbw5f/JPMhHruHWwRtKmxO60kO10ouIs1u+H A08WBSyFLiyqxOvQHb4rahhzDVDsktAzzNFO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Rb4KCMLZmVLqHvHOC9FsG9F5TRFCkHWdjVG1JaJUCLA=; b=BNhL06tAL0Vio0D5KoeuG5sjoI/M2og8ZALmOHOLtqvYpyw/lN/7Whg4FE2x3DeId4 a440cBDzkm56azczexgYyorLH5J6nM+xbQA7ayoXQ7vCcCMWHoAGCz96ujuFGkjBzP52 EqBLc2kIA1pdYO6nJTD9RjHS+GiFSYJwtASPRt3gMyyiPpIqS176/F9NoaOISwhEG89/ UOwvo4Bbfl1bRtSngicikpSkm2cqxxxwu1j4AshkaRjidK+z1XyjeVQY0mYxl5EaV1qn 3nBgplmYdoERok5fxuBGmlj2d4IcfBhhdUUieM7MxBDveHf20nLH2olm+KCnxNW4Ry1N LPCg== X-Gm-Message-State: AIkVDXIffIezefyzAffyiJnFBpt+WmAyUpmILhiwzdef2gqTfyR0nCLWfTtM62HVaCEAPKIa X-Received: by 10.25.15.199 with SMTP id 68mr6337966lfp.53.1485087329250; Sun, 22 Jan 2017 04:15:29 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id h76sm5300725lfg.39.2017.01.22.04.15.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 04:15:28 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli Date: Sun, 22 Jan 2017 13:15:24 +0100 Message-Id: <20170122121524.10048-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [OpenWrt-Devel] [PATCH 01/22] ARM: gemini: convert to MULTI_IRQ_HANDLER X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@openwrt.org, Janos Laube , Arnd Bergmann , Paulius Zaleckas MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" In order to enable device tree boot on this machine we must first convert it to runtime-manage its irq handler, so do this. Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 1 + arch/arm/mach-gemini/include/mach/entry-macro.S | 33 ------------------------- arch/arm/mach-gemini/irq.c | 15 +++++++++++ 3 files changed, 16 insertions(+), 33 deletions(-) delete mode 100644 arch/arm/mach-gemini/include/mach/entry-macro.S diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5fab553fd03a..63e61bf5aab0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -359,6 +359,7 @@ config ARCH_GEMINI select CPU_FA526 select GENERIC_CLOCKEVENTS select GPIOLIB + select MULTI_IRQ_HANDLER help Support for the Cortina Systems Gemini family SoCs diff --git a/arch/arm/mach-gemini/include/mach/entry-macro.S b/arch/arm/mach-gemini/include/mach/entry-macro.S deleted file mode 100644 index f044e430bfa4..000000000000 --- a/arch/arm/mach-gemini/include/mach/entry-macro.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Low-level IRQ helper macros for Gemini platform. - * - * Copyright (C) 2001-2006 Storlink, Corp. - * Copyright (C) 2008-2009 Paulius Zaleckas - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ -#include - -#define IRQ_STATUS 0x14 - - .macro get_irqnr_preamble, base, tmp - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, =IO_ADDRESS(GEMINI_INTERRUPT_BASE + IRQ_STATUS) - ldr \irqnr, [\irqstat] - cmp \irqnr, #0 - beq 2313f - mov \tmp, \irqnr - mov \irqnr, #0 -2312: - tst \tmp, #1 - bne 2313f - add \irqnr, \irqnr, #1 - mov \tmp, \tmp, lsr #1 - cmp \irqnr, #31 - bcc 2312b -2313: - .endm diff --git a/arch/arm/mach-gemini/irq.c b/arch/arm/mach-gemini/irq.c index d929b3ff18fd..37d52e372456 100644 --- a/arch/arm/mach-gemini/irq.c +++ b/arch/arm/mach-gemini/irq.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,18 @@ static struct irq_chip gemini_irq_chip = { .irq_unmask = gemini_unmask_irq, }; + +asmlinkage void __exception_irq_entry gemini_handle_irq(struct pt_regs *regs) +{ + int irq; + unsigned status; + + while ((status = __raw_readl(IRQ_STATUS(IO_ADDRESS(GEMINI_INTERRUPT_BASE))))) { + irq = ffs(status) - 1; + handle_domain_irq(NULL, irq, regs); + } +} + static struct resource irq_resource = { .name = "irq_handler", .start = GEMINI_INTERRUPT_BASE, @@ -102,4 +115,6 @@ void __init gemini_init_irq(void) /* Set interrupt mode */ __raw_writel(mode, IRQ_TMODE(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); __raw_writel(level, IRQ_TLEVEL(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); + + set_handle_irq(gemini_handle_irq); }