aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/intc-r8a7779.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-08-28 13:00:24 -0400
committerOlof Johansson <olof@lixom.net>2013-08-28 13:00:24 -0400
commite707bb338b5c6f5859578ae6eb426a21b78b0f42 (patch)
tree93f28a52a6d37e6855c51e644353bd23631a1c1c /arch/arm/mach-shmobile/intc-r8a7779.c
parentf0a108b7227c4328c7a32514ee6a4ceffaaed886 (diff)
parent282b583f752f996ee5c33b0cdc18adf3b5094ee0 (diff)
Merge tag 'renesas-cleanup3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/renesas
From Simon Horman: Third round of Renesas ARM based SoC cleanups for v3.12 * Remove global GPIO_NR definition from sh73a0 SoC * Remove unnecessary nfsroot settings from bootargs of kzm9d and armadillo800eva * Rename irq initialisation functions of r8a7779 SoC to make them consistent with other SoCs * Simplify irq initialisation of r8a7740 SoC * Add missing __initdata annotations to bockw board, and r8a7790 and r8a7779 SoCs * Refactor time initialisation and remove shmobile_init_time. - This affects the following boards: kzm9g, marzen, ape6evm, armadillo800eva and bockw - This affects the following SoCs: r8a7790, r8a7779, r7a7740, r7a73a4 * Cleanup device registration code of r8a7778 SoC * tag 'renesas-cleanup3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (45 commits) ARM: shmobile: sh73a0: Remove global GPIO_NR definition ARM: shmobile: kzm9d: remove nfsroot settings from bootargs ARM: shmobile: armadillo800eva: remove nfsroot settings from bootargs ARM: shmobile: r8a7779: move r8a7779_init_irq_xxx() to setup ARM: shmobile: r8a7740: move r8a7740_init_irq_of() to setup ARM: shmobile: bockw: add missing __initdata ARM: shmobile: r8a7790: add missing __initdata ARM: shmobile: r8a7779: add missing __initdata ARM: shmobile: Remove unused shmobile_init_time() ARM: shmobile: Use clocksource_of_init() on r8a7790 ARM: shmobile: Use default ->init_time() on KZM9G DT ref ARM: shmobile: Use default ->init_time() on Marzen DT ref ARM: shmobile: Use default ->init_time() on APE6EVM DT ref ARM: shmobile: Use default ->init_time() on APE6EVM ARM: shmobile: Use default ->init_time() on Armadillo DT ref ARM: shmobile: Use default ->init_time() on Bockw DT ref ARM: shmobile: Use default ->init_time() on Bockw ARM: shmobile: Use default ->init_time() on r8a7779 ARM: shmobile: Use default ->init_time() on r8a7778 ARM: shmobile: Use default ->init_time() on r8a7740 ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-shmobile/intc-r8a7779.c')
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c130
1 files changed, 0 insertions, 130 deletions
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
deleted file mode 100644
index 5f9e5dc0238b..000000000000
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * r8a7779 processor support - INTC hardware block
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/io.h>
26#include <linux/irqchip/arm-gic.h>
27#include <linux/platform_data/irq-renesas-intc-irqpin.h>
28#include <linux/irqchip.h>
29#include <mach/common.h>
30#include <mach/irqs.h>
31#include <mach/r8a7779.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35#define INT2SMSKCR0 IOMEM(0xfe7822a0)
36#define INT2SMSKCR1 IOMEM(0xfe7822a4)
37#define INT2SMSKCR2 IOMEM(0xfe7822a8)
38#define INT2SMSKCR3 IOMEM(0xfe7822ac)
39#define INT2SMSKCR4 IOMEM(0xfe7822b0)
40
41#define INT2NTSR0 IOMEM(0xfe700060)
42#define INT2NTSR1 IOMEM(0xfe700064)
43
44static struct renesas_intc_irqpin_config irqpin0_platform_data = {
45 .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
46 .sense_bitfield_width = 2,
47};
48
49static struct resource irqpin0_resources[] = {
50 DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
51 DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
52 DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
53 DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
54 DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
55 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
56 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
57 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
58 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
59};
60
61static struct platform_device irqpin0_device = {
62 .name = "renesas_intc_irqpin",
63 .id = 0,
64 .resource = irqpin0_resources,
65 .num_resources = ARRAY_SIZE(irqpin0_resources),
66 .dev = {
67 .platform_data = &irqpin0_platform_data,
68 },
69};
70
71void __init r8a7779_init_irq_extpin(int irlm)
72{
73 void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
74 unsigned long tmp;
75
76 if (icr0) {
77 tmp = ioread32(icr0);
78 if (irlm)
79 tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
80 else
81 tmp &= ~(1 << 23); /* IRL mode - not supported */
82 tmp |= (1 << 21); /* LVLMODE = 1 */
83 iowrite32(tmp, icr0);
84 iounmap(icr0);
85
86 if (irlm)
87 platform_device_register(&irqpin0_device);
88 } else
89 pr_warn("r8a7779: unable to setup external irq pin mode\n");
90}
91
92static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
93{
94 return 0; /* always allow wakeup */
95}
96
97static void __init r8a7779_init_irq_common(void)
98{
99 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
100
101 /* route all interrupts to ARM */
102 __raw_writel(0xffffffff, INT2NTSR0);
103 __raw_writel(0x3fffffff, INT2NTSR1);
104
105 /* unmask all known interrupts in INTCS2 */
106 __raw_writel(0xfffffff0, INT2SMSKCR0);
107 __raw_writel(0xfff7ffff, INT2SMSKCR1);
108 __raw_writel(0xfffbffdf, INT2SMSKCR2);
109 __raw_writel(0xbffffffc, INT2SMSKCR3);
110 __raw_writel(0x003fee3f, INT2SMSKCR4);
111}
112
113void __init r8a7779_init_irq(void)
114{
115 void __iomem *gic_dist_base = IOMEM(0xf0001000);
116 void __iomem *gic_cpu_base = IOMEM(0xf0000100);
117
118 /* use GIC to handle interrupts */
119 gic_init(0, 29, gic_dist_base, gic_cpu_base);
120
121 r8a7779_init_irq_common();
122}
123
124#ifdef CONFIG_OF
125void __init r8a7779_init_irq_dt(void)
126{
127 irqchip_init();
128 r8a7779_init_irq_common();
129}
130#endif