From patchwork Mon Jul 2 21:53:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 1148331 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 1038240AEE for ; Mon, 2 Jul 2012 21:57:18 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SloZT-0002VJ-Cf; Mon, 02 Jul 2012 21:54:15 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SloZF-0002Tr-0w for linux-arm-kernel@lists.infradead.org; Mon, 02 Jul 2012 21:54:05 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 052BBF08B5; Mon, 2 Jul 2012 23:53:57 +0200 (CEST) Date: Mon, 2 Jul 2012 23:53:32 +0200 From: Pavel Machek To: Arnd Bergmann Subject: Re: [RFC PATCHv1 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform. Message-ID: <20120702215331.GA6173@elf.ucw.cz> References: <1340805007-3313-1-git-send-email-dinguyen@altera.com> <201206302104.37937.arnd@arndb.de> <20120701184110.GA30680@elf.ucw.cz> <201207021652.52787.arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201207021652.52787.arnd@arndb.de> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.113.26.193 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Thomas Petazzoni , linux@arm.linux.org.uk, wd@denx.de, cytan@altera.com, linux-arm-kernel@lists.infradead.org, dinguyen@altera.com 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi! > > static void __init socfpga_cyclone5_init(void) > > { > > + int i; > > + for (i = 0; i < 512; i++) { > > + dynamic_irq_init(i); > > + } > > + > > #ifdef CONFIG_CACHE_L2X0 > > /* 8-way, 64K/way, evmon/parity/share */ > > l2x0_of_init(0x00760000, 0xfe000fff); > > > > This looks wrong, I think what you should do instead is > to call irq_domain_add_legacy() for each controller you > register as the first step, and then try to convert the > controllers to use irq_domain_add_linear() as the second > step. See also Documentation/IRQ-domain.txt. Stupid me, GIC already has irq_domain support, so the switch to sparse_irq is as simple as: Pavel Signed-off-by: Pavel Machek diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b1578e1..d203253 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -263,6 +263,7 @@ config ARCH_SOCFPGA select GPIO_PL061 if GPIOLIB select NEED_MACH_MEMORY_H select USE_OF + select SPARSE_IRQ help This enables support for Altera SOCFPGA Cyclone V platform diff --git a/arch/arm/mach-socfpga/include/mach/irqs.h b/arch/arm/mach-socfpga/include/mach/irqs.h index da50124..565ca59 100644 --- a/arch/arm/mach-socfpga/include/mach/irqs.h +++ b/arch/arm/mach-socfpga/include/mach/irqs.h @@ -27,8 +27,6 @@ #define IRQ_SOCFPGA_CLK_MAN (IRQ_SOCFPGA_GIC_START + 173) /* Clock manager */ -#define NR_IRQS 512 - #define MAX_GIC_NR 1 #endif /* __MACH_IRQS_H */ diff --git a/arch/arm/mach-socfpga/socfpga_cyclone5.c b/arch/arm/mach-socfpga/socfpga_cyclone5.c index f6498cc..d8cd89b 100644 --- a/arch/arm/mach-socfpga/socfpga_cyclone5.c +++ b/arch/arm/mach-socfpga/socfpga_cyclone5.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include