From patchwork Thu Sep 12 00:38:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2875221 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 BC44F9F476 for ; Thu, 12 Sep 2013 00:38:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A206720340 for ; Thu, 12 Sep 2013 00:38:16 +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 A4EEE201E7 for ; Thu, 12 Sep 2013 00:38:15 +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 1VJuvF-00007Z-6B; Thu, 12 Sep 2013 00:38:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJuvC-0007EA-Sc; Thu, 12 Sep 2013 00:38:10 +0000 Received: from mail-pb0-x231.google.com ([2607:f8b0:400e:c01::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJuvA-0007Da-DC for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2013 00:38:09 +0000 Received: by mail-pb0-f49.google.com with SMTP id xb4so9732931pbc.36 for ; Wed, 11 Sep 2013 17:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=4IDZbdom3L0YqDmFuLgL+k0NYczwDPA4cOhwJjkglXU=; b=hwH4X2IFr4oksO+uGC4guwl1FoYJwX+Fqye83zk8ElA1l7pQ6/nflO0Q1enzRiDs2x YS5qgqyvr+71+vzq4Jj9vBt/x7oi4L4Y7hPxQcnhlnS6HcOdx1NZhB1SBkIU88oG3r7G tmrsYztli3TpRCBWttkzFKEL5RxLb5YS4Hmr5oWEKMcvi6a4amB7ImcXlYA/DHHeJYXP IsDZHVPlya82MBHBOdF8B0qkfQy9FCd0kx3fwD3d4K7nHBowDLT8X8QssiAhYWr8l+6d 315GjsZ2fXQQq1iZEzujgTZkadp6qUEo16WDQrg0zelZa6iwW4S02nIVxuNIbaensBOZ 4W8A== X-Received: by 10.69.0.168 with SMTP id az8mr4682728pbd.51.1378946266476; Wed, 11 Sep 2013 17:37:46 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id xe9sm6574206pab.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 17:37:45 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Thu, 12 Sep 2013 09:38:06 +0900 Message-Id: <20130912003806.24022.63355.sendpatchset@w520> Subject: [PATCH] ARM: shmobile: r8a7791 IRQC support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130911_203808_605243_50734E67 X-CRM114-Status: GOOD ( 11.93 ) X-Spam-Score: -2.0 (--) Cc: ryo.kataoka.wt@renesas.com, kuninori.morimoto.gx@renesas.com, arnd@arndb.de, Magnus Damm , hisashi.nakamura.ak@renesas.com, horms@verge.net.au, yoshikazu.fujikawa.ue@renesas.com, olof@lixom.net, 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=-4.9 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 From: Magnus Damm Add support for r8a7791 IRQ pins IRQ0 -> IRQ9 via the IRQC driver in drivers/irqchip/irq-renesas-irqc.c Signed-off-by: Magnus Damm --- Written against renesas-devel-20130906 arch/arm/boot/dts/r8a7791.dtsi | 18 ++++++++++++++ arch/arm/mach-shmobile/Kconfig | 1 arch/arm/mach-shmobile/board-koelsch.c | 2 - arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 arch/arm/mach-shmobile/setup-r8a7791.c | 32 +++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) --- 0001/arch/arm/boot/dts/r8a7791.dtsi +++ work/arch/arm/boot/dts/r8a7791.dtsi 2013-09-12 09:02:03.000000000 +0900 @@ -38,4 +38,22 @@ <0 0xf1006000 0 0x2000>; interrupts = <1 9 0xf04>; }; + + irqc0: interrupt-controller@e61c0000 { + compatible = "renesas,irqc"; + #interrupt-cells = <2>; + interrupt-controller; + reg = <0 0xe61c0000 0 0x200>; + interrupt-parent = <&gic>; + interrupts = <0 0 4>, + <0 1 4>, + <0 2 4>, + <0 3 4>, + <0 12 4>, + <0 13 4>, + <0 14 4>, + <0 15 4>, + <0 16 4>, + <0 17 4>; + }; }; --- 0001/arch/arm/mach-shmobile/Kconfig +++ work/arch/arm/mach-shmobile/Kconfig 2013-09-12 09:02:03.000000000 +0900 @@ -106,6 +106,7 @@ config ARCH_R8A7791 select ARM_GIC select CPU_V7 select SH_CLK_CPG + select RENESAS_IRQC config ARCH_EMEV2 bool "Emma Mobile EV2" --- 0001/arch/arm/mach-shmobile/board-koelsch.c +++ work/arch/arm/mach-shmobile/board-koelsch.c 2013-09-12 09:04:06.000000000 +0900 @@ -29,7 +29,7 @@ static void __init koelsch_add_standard_devices(void) { r8a7791_clock_init(); - r8a7791_add_dt_devices(); + r8a7791_add_standard_devices(); } static const char * const koelsch_boards_compat_dt[] __initconst = { --- 0001/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ work/arch/arm/mach-shmobile/include/mach/r8a7791.h 2013-09-12 09:03:39.000000000 +0900 @@ -1,6 +1,7 @@ #ifndef __ASM_R8A7791_H__ #define __ASM_R8A7791_H__ +void r8a7791_add_standard_devices(void); void r8a7791_add_dt_devices(void); void r8a7791_clock_init(void); void r8a7791_init_early(void); --- 0001/arch/arm/mach-shmobile/setup-r8a7791.c +++ work/arch/arm/mach-shmobile/setup-r8a7791.c 2013-09-12 09:03:12.000000000 +0900 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,31 @@ static const struct resource cmt00_resou &cmt##idx##_platform_data, \ sizeof(struct sh_timer_config)) +static struct renesas_irqc_config irqc0_data = { + .irq_base = irq_pin(0), /* IRQ0 -> IRQ9 */ +}; + +static struct resource irqc0_resources[] = { + DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */ + DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */ + DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */ + DEFINE_RES_IRQ(gic_spi(2)), /* IRQ2 */ + DEFINE_RES_IRQ(gic_spi(3)), /* IRQ3 */ + DEFINE_RES_IRQ(gic_spi(12)), /* IRQ4 */ + DEFINE_RES_IRQ(gic_spi(13)), /* IRQ5 */ + DEFINE_RES_IRQ(gic_spi(14)), /* IRQ6 */ + DEFINE_RES_IRQ(gic_spi(15)), /* IRQ7 */ + DEFINE_RES_IRQ(gic_spi(16)), /* IRQ8 */ + DEFINE_RES_IRQ(gic_spi(17)), /* IRQ9 */ +}; + +#define r8a7791_register_irqc(idx) \ + platform_device_register_resndata(&platform_bus, "renesas_irqc", \ + idx, irqc##idx##_resources, \ + ARRAY_SIZE(irqc##idx##_resources), \ + &irqc##idx##_data, \ + sizeof(struct renesas_irqc_config)) + void __init r8a7791_add_dt_devices(void) { r8a7791_register_scif(SCIFA0); @@ -129,6 +155,12 @@ void __init r8a7791_add_dt_devices(void) r8a7791_register_cmt(00); } +void __init r8a7791_add_standard_devices(void) +{ + r8a7791_add_dt_devices(); + r8a7791_register_irqc(0); +} + void __init r8a7791_init_early(void) { #ifndef CONFIG_ARM_ARCH_TIMER