aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-03-15 17:46:51 -0400
committerArnd Bergmann <arnd@arndb.de>2013-03-15 17:46:51 -0400
commitcabaf3edf8b464558776c90c0c70252b40197c9d (patch)
tree7d12782b2ba51e3df507afd00a0cdc7d96f2e234
parentbffc5ce34483f3121f0b06e55a34b8eb56d253fb (diff)
parentd97fedef912832611b668fa7ece8e8ff54a6a590 (diff)
Merge branch 'next/irq-s3c24xx' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/drivers
From Kukjin Kim <kgene.kim@samsung.com>: Here is finish the irq rework for s3c2412, s3c2440 and s3c2442 into the new structure and eint0 to 3 on the s3c2412. * 'next/irq-s3c24xx' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: gpio: samsung: fixes build warning with s3c2410_defconfig ARM: S3C24XX: handle s3c2412 eints using new infrastructure ARM: S3C24XX: add soc_is_s3c2412 option ARM: S3C24XX: include first 4 bits of the eint register in irq mapping ARM: S3C24XX: transform s3c2412 irqs into new structure ARM: S3C24XX: modify s3c2412 irq init to initialize all irqs ARM: S3C24XX: move s3c2412 irq init to common code ARM: S3C24XX: use samsung_sync_wakemask in s3c2412 pm ARM: S3C24XX: transform s3c2440 irqs into new structure ARM: S3C24XX: transform s3c2442 irqs into new structure ARM: S3C24XX: integrate s3c2440 irqs into common init ARM: S3C24XX: move s3c2440 irqs to common irq code ARM: S3C24XX: create dedicated irq init functions for s3c2440 and s3c2442 ARM: S3C24XX: move s3c244x irq init to common irq code Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c24xx/Makefile6
-rw-r--r--arch/arm/mach-s3c24xx/common.h3
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/irqs.h58
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2412.c215
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2440.c128
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c244x.c142
-rw-r--r--arch/arm/mach-s3c24xx/irq.c264
-rw-r--r--arch/arm/mach-s3c24xx/mach-anubis.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-at2440evb.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-gta02.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-jive.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx3715.c7
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2413.c6
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-vstms.c2
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2412.c8
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h10
-rw-r--r--drivers/gpio/gpio-samsung.c8
23 files changed, 332 insertions, 544 deletions
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 0c5e4fb61117..0a8663c5f2ba 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -407,6 +407,7 @@ config S3C2412_DMA
407config S3C2412_PM 407config S3C2412_PM
408 bool 408 bool
409 select S3C2412_PM_SLEEP 409 select S3C2412_PM_SLEEP
410 select SAMSUNG_WAKEMASK
410 help 411 help
411 Internal config node to apply S3C2412 power management 412 Internal config node to apply S3C2412 power management
412 413
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index af53d27d5c36..be6e4d0e6f1a 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o
22obj-$(CONFIG_S3C2410_PLL) += pll-s3c2410.o 22obj-$(CONFIG_S3C2410_PLL) += pll-s3c2410.o
23obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o 23obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o
24 24
25obj-$(CONFIG_CPU_S3C2412) += s3c2412.o irq-s3c2412.o clock-s3c2412.o 25obj-$(CONFIG_CPU_S3C2412) += s3c2412.o clock-s3c2412.o
26obj-$(CONFIG_S3C2412_CPUFREQ) += cpufreq-s3c2412.o 26obj-$(CONFIG_S3C2412_CPUFREQ) += cpufreq-s3c2412.o
27obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o 27obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
28obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o 28obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o
@@ -31,9 +31,9 @@ obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
31obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o 31obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o
32obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o 32obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o
33 33
34obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o 34obj-$(CONFIG_CPU_S3C2440) += s3c2440.o clock-s3c2440.o
35obj-$(CONFIG_CPU_S3C2442) += s3c2442.o 35obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
36obj-$(CONFIG_CPU_S3C244X) += s3c244x.o irq-s3c244x.o clock-s3c244x.o 36obj-$(CONFIG_CPU_S3C244X) += s3c244x.o clock-s3c244x.o
37obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o 37obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o
38obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o 38obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
39obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o 39obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o
diff --git a/arch/arm/mach-s3c24xx/common.h b/arch/arm/mach-s3c24xx/common.h
index 8a2b4137ddb6..abefeb38bba4 100644
--- a/arch/arm/mach-s3c24xx/common.h
+++ b/arch/arm/mach-s3c24xx/common.h
@@ -36,6 +36,7 @@ extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
36extern void s3c2412_init_clocks(int xtal); 36extern void s3c2412_init_clocks(int xtal);
37extern int s3c2412_baseclk_add(void); 37extern int s3c2412_baseclk_add(void);
38extern void s3c2412_restart(char mode, const char *cmd); 38extern void s3c2412_restart(char mode, const char *cmd);
39extern void s3c2412_init_irq(void);
39#else 40#else
40#define s3c2412_init_clocks NULL 41#define s3c2412_init_clocks NULL
41#define s3c2412_init_uarts NULL 42#define s3c2412_init_uarts NULL
@@ -73,6 +74,7 @@ extern void s3c244x_restart(char mode, const char *cmd);
73#ifdef CONFIG_CPU_S3C2440 74#ifdef CONFIG_CPU_S3C2440
74extern int s3c2440_init(void); 75extern int s3c2440_init(void);
75extern void s3c2440_map_io(void); 76extern void s3c2440_map_io(void);
77extern void s3c2440_init_irq(void);
76#else 78#else
77#define s3c2440_init NULL 79#define s3c2440_init NULL
78#define s3c2440_map_io NULL 80#define s3c2440_map_io NULL
@@ -81,6 +83,7 @@ extern void s3c2440_map_io(void);
81#ifdef CONFIG_CPU_S3C2442 83#ifdef CONFIG_CPU_S3C2442
82extern int s3c2442_init(void); 84extern int s3c2442_init(void);
83extern void s3c2442_map_io(void); 85extern void s3c2442_map_io(void);
86extern void s3c2442_init_irq(void);
84#else 87#else
85#define s3c2442_init NULL 88#define s3c2442_init NULL
86#define s3c2442_map_io NULL 89#define s3c2442_map_io NULL
diff --git a/arch/arm/mach-s3c24xx/include/mach/irqs.h b/arch/arm/mach-s3c24xx/include/mach/irqs.h
index b7a9f4d469e8..43cada8019b4 100644
--- a/arch/arm/mach-s3c24xx/include/mach/irqs.h
+++ b/arch/arm/mach-s3c24xx/include/mach/irqs.h
@@ -59,49 +59,53 @@
59#define IRQ_ADCPARENT S3C2410_IRQ(31) 59#define IRQ_ADCPARENT S3C2410_IRQ(31)
60 60
61/* interrupts generated from the external interrupts sources */ 61/* interrupts generated from the external interrupts sources */
62#define IRQ_EINT4 S3C2410_IRQ(32) /* 48 */ 62#define IRQ_EINT0_2412 S3C2410_IRQ(32)
63#define IRQ_EINT5 S3C2410_IRQ(33) 63#define IRQ_EINT1_2412 S3C2410_IRQ(33)
64#define IRQ_EINT6 S3C2410_IRQ(34) 64#define IRQ_EINT2_2412 S3C2410_IRQ(34)
65#define IRQ_EINT7 S3C2410_IRQ(35) 65#define IRQ_EINT3_2412 S3C2410_IRQ(35)
66#define IRQ_EINT8 S3C2410_IRQ(36) 66#define IRQ_EINT4 S3C2410_IRQ(36) /* 52 */
67#define IRQ_EINT9 S3C2410_IRQ(37) 67#define IRQ_EINT5 S3C2410_IRQ(37)
68#define IRQ_EINT10 S3C2410_IRQ(38) 68#define IRQ_EINT6 S3C2410_IRQ(38)
69#define IRQ_EINT11 S3C2410_IRQ(39) 69#define IRQ_EINT7 S3C2410_IRQ(39)
70#define IRQ_EINT12 S3C2410_IRQ(40) 70#define IRQ_EINT8 S3C2410_IRQ(40)
71#define IRQ_EINT13 S3C2410_IRQ(41) 71#define IRQ_EINT9 S3C2410_IRQ(41)
72#define IRQ_EINT14 S3C2410_IRQ(42) 72#define IRQ_EINT10 S3C2410_IRQ(42)
73#define IRQ_EINT15 S3C2410_IRQ(43) 73#define IRQ_EINT11 S3C2410_IRQ(43)
74#define IRQ_EINT16 S3C2410_IRQ(44) 74#define IRQ_EINT12 S3C2410_IRQ(44)
75#define IRQ_EINT17 S3C2410_IRQ(45) 75#define IRQ_EINT13 S3C2410_IRQ(45)
76#define IRQ_EINT18 S3C2410_IRQ(46) 76#define IRQ_EINT14 S3C2410_IRQ(46)
77#define IRQ_EINT19 S3C2410_IRQ(47) 77#define IRQ_EINT15 S3C2410_IRQ(47)
78#define IRQ_EINT20 S3C2410_IRQ(48) /* 64 */ 78#define IRQ_EINT16 S3C2410_IRQ(48)
79#define IRQ_EINT21 S3C2410_IRQ(49) 79#define IRQ_EINT17 S3C2410_IRQ(49)
80#define IRQ_EINT22 S3C2410_IRQ(50) 80#define IRQ_EINT18 S3C2410_IRQ(50)
81#define IRQ_EINT23 S3C2410_IRQ(51) 81#define IRQ_EINT19 S3C2410_IRQ(51)
82#define IRQ_EINT20 S3C2410_IRQ(52) /* 68 */
83#define IRQ_EINT21 S3C2410_IRQ(53)
84#define IRQ_EINT22 S3C2410_IRQ(54)
85#define IRQ_EINT23 S3C2410_IRQ(55)
82 86
83#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT4 + 4) 87#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT4 + 4)
84#define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x))) 88#define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x)))
85 89
86#define IRQ_LCD_FIFO S3C2410_IRQ(52) 90#define IRQ_LCD_FIFO S3C2410_IRQ(56)
87#define IRQ_LCD_FRAME S3C2410_IRQ(53) 91#define IRQ_LCD_FRAME S3C2410_IRQ(57)
88 92
89/* IRQs for the interal UARTs, and ADC 93/* IRQs for the interal UARTs, and ADC
90 * these need to be ordered in number of appearance in the 94 * these need to be ordered in number of appearance in the
91 * SUBSRC mask register 95 * SUBSRC mask register
92*/ 96*/
93 97
94#define S3C2410_IRQSUB(x) S3C2410_IRQ((x)+54) 98#define S3C2410_IRQSUB(x) S3C2410_IRQ((x)+58)
95 99
96#define IRQ_S3CUART_RX0 S3C2410_IRQSUB(0) /* 70 */ 100#define IRQ_S3CUART_RX0 S3C2410_IRQSUB(0) /* 74 */
97#define IRQ_S3CUART_TX0 S3C2410_IRQSUB(1) 101#define IRQ_S3CUART_TX0 S3C2410_IRQSUB(1)
98#define IRQ_S3CUART_ERR0 S3C2410_IRQSUB(2) 102#define IRQ_S3CUART_ERR0 S3C2410_IRQSUB(2)
99 103
100#define IRQ_S3CUART_RX1 S3C2410_IRQSUB(3) /* 73 */ 104#define IRQ_S3CUART_RX1 S3C2410_IRQSUB(3) /* 77 */
101#define IRQ_S3CUART_TX1 S3C2410_IRQSUB(4) 105#define IRQ_S3CUART_TX1 S3C2410_IRQSUB(4)
102#define IRQ_S3CUART_ERR1 S3C2410_IRQSUB(5) 106#define IRQ_S3CUART_ERR1 S3C2410_IRQSUB(5)
103 107
104#define IRQ_S3CUART_RX2 S3C2410_IRQSUB(6) /* 76 */ 108#define IRQ_S3CUART_RX2 S3C2410_IRQSUB(6) /* 80 */
105#define IRQ_S3CUART_TX2 S3C2410_IRQSUB(7) 109#define IRQ_S3CUART_TX2 S3C2410_IRQSUB(7)
106#define IRQ_S3CUART_ERR2 S3C2410_IRQSUB(8) 110#define IRQ_S3CUART_ERR2 S3C2410_IRQSUB(8)
107 111
@@ -136,7 +140,7 @@
136 140
137/* second interrupt-register of s3c2416/s3c2450 */ 141/* second interrupt-register of s3c2416/s3c2450 */
138 142
139#define S3C2416_IRQ(x) S3C2410_IRQ((x) + 54 + 29) 143#define S3C2416_IRQ(x) S3C2410_IRQ((x) + 58 + 29)
140#define IRQ_S3C2416_2D S3C2416_IRQ(0) 144#define IRQ_S3C2416_2D S3C2416_IRQ(0)
141#define IRQ_S3C2416_IIC1 S3C2416_IRQ(1) 145#define IRQ_S3C2416_IIC1 S3C2416_IRQ(1)
142#define IRQ_S3C2416_RESERVED2 S3C2416_IRQ(2) 146#define IRQ_S3C2416_RESERVED2 S3C2416_IRQ(2)
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2412.c b/arch/arm/mach-s3c24xx/irq-s3c2412.c
deleted file mode 100644
index 67d763178d3f..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c2412.c
+++ /dev/null
@@ -1,215 +0,0 @@
1/* linux/arch/arm/mach-s3c2412/irq.c
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20*/
21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/io.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31
32#include <asm/mach/irq.h>
33
34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/irq.h>
39#include <plat/pm.h>
40
41#include "s3c2412-power.h"
42
43#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
44#define INTMSK_SUB(start, end) (INTMSK(start, end) << ((start - S3C2410_IRQSUB(0))))
45
46/* the s3c2412 changes the behaviour of IRQ_EINT0 through IRQ_EINT3 by
47 * having them turn up in both the INT* and the EINT* registers. Whilst
48 * both show the status, they both now need to be acked when the IRQs
49 * go off.
50*/
51
52static void
53s3c2412_irq_mask(struct irq_data *data)
54{
55 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
56 unsigned long mask;
57
58 mask = __raw_readl(S3C2410_INTMSK);
59 __raw_writel(mask | bitval, S3C2410_INTMSK);
60
61 mask = __raw_readl(S3C2412_EINTMASK);
62 __raw_writel(mask | bitval, S3C2412_EINTMASK);
63}
64
65static inline void
66s3c2412_irq_ack(struct irq_data *data)
67{
68 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
69
70 __raw_writel(bitval, S3C2412_EINTPEND);
71 __raw_writel(bitval, S3C2410_SRCPND);
72 __raw_writel(bitval, S3C2410_INTPND);
73}
74
75static inline void
76s3c2412_irq_maskack(struct irq_data *data)
77{
78 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
79 unsigned long mask;
80
81 mask = __raw_readl(S3C2410_INTMSK);
82 __raw_writel(mask|bitval, S3C2410_INTMSK);
83
84 mask = __raw_readl(S3C2412_EINTMASK);
85 __raw_writel(mask | bitval, S3C2412_EINTMASK);
86
87 __raw_writel(bitval, S3C2412_EINTPEND);
88 __raw_writel(bitval, S3C2410_SRCPND);
89 __raw_writel(bitval, S3C2410_INTPND);
90}
91
92static void
93s3c2412_irq_unmask(struct irq_data *data)
94{
95 unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
96 unsigned long mask;
97
98 mask = __raw_readl(S3C2412_EINTMASK);
99 __raw_writel(mask & ~bitval, S3C2412_EINTMASK);
100
101 mask = __raw_readl(S3C2410_INTMSK);
102 __raw_writel(mask & ~bitval, S3C2410_INTMSK);
103}
104
105static struct irq_chip s3c2412_irq_eint0t4 = {
106 .irq_ack = s3c2412_irq_ack,
107 .irq_mask = s3c2412_irq_mask,
108 .irq_unmask = s3c2412_irq_unmask,
109 .irq_set_wake = s3c_irq_wake,
110 .irq_set_type = s3c_irqext_type,
111};
112
113#define INTBIT(x) (1 << ((x) - S3C2410_IRQSUB(0)))
114
115/* CF and SDI sub interrupts */
116
117static void s3c2412_irq_demux_cfsdi(unsigned int irq, struct irq_desc *desc)
118{
119 unsigned int subsrc, submsk;
120
121 subsrc = __raw_readl(S3C2410_SUBSRCPND);
122 submsk = __raw_readl(S3C2410_INTSUBMSK);
123
124 subsrc &= ~submsk;
125
126 if (subsrc & INTBIT(IRQ_S3C2412_SDI))
127 generic_handle_irq(IRQ_S3C2412_SDI);
128
129 if (subsrc & INTBIT(IRQ_S3C2412_CF))
130 generic_handle_irq(IRQ_S3C2412_CF);
131}
132
133#define INTMSK_CFSDI (1UL << (IRQ_S3C2412_CFSDI - IRQ_EINT0))
134#define SUBMSK_CFSDI INTMSK_SUB(IRQ_S3C2412_SDI, IRQ_S3C2412_CF)
135
136static void s3c2412_irq_cfsdi_mask(struct irq_data *data)
137{
138 s3c_irqsub_mask(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI);
139}
140
141static void s3c2412_irq_cfsdi_unmask(struct irq_data *data)
142{
143 s3c_irqsub_unmask(data->irq, INTMSK_CFSDI);
144}
145
146static void s3c2412_irq_cfsdi_ack(struct irq_data *data)
147{
148 s3c_irqsub_maskack(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI);
149}
150
151static struct irq_chip s3c2412_irq_cfsdi = {
152 .name = "s3c2412-cfsdi",
153 .irq_ack = s3c2412_irq_cfsdi_ack,
154 .irq_mask = s3c2412_irq_cfsdi_mask,
155 .irq_unmask = s3c2412_irq_cfsdi_unmask,
156};
157
158static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
159{
160 unsigned long pwrcfg;
161
162 pwrcfg = __raw_readl(S3C2412_PWRCFG);
163 if (state)
164 pwrcfg &= ~S3C2412_PWRCFG_RTC_MASKIRQ;
165 else
166 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ;
167 __raw_writel(pwrcfg, S3C2412_PWRCFG);
168
169 return s3c_irq_chip.irq_set_wake(data, state);
170}
171
172static struct irq_chip s3c2412_irq_rtc_chip;
173
174static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
175{
176 unsigned int irqno;
177
178 for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
179 irq_set_chip_and_handler(irqno, &s3c2412_irq_eint0t4,
180 handle_edge_irq);
181 set_irq_flags(irqno, IRQF_VALID);
182 }
183
184 /* add demux support for CF/SDI */
185
186 irq_set_chained_handler(IRQ_S3C2412_CFSDI, s3c2412_irq_demux_cfsdi);
187
188 for (irqno = IRQ_S3C2412_SDI; irqno <= IRQ_S3C2412_CF; irqno++) {
189 irq_set_chip_and_handler(irqno, &s3c2412_irq_cfsdi,
190 handle_level_irq);
191 set_irq_flags(irqno, IRQF_VALID);
192 }
193
194 /* change RTC IRQ's set wake method */
195
196 s3c2412_irq_rtc_chip = s3c_irq_chip;
197 s3c2412_irq_rtc_chip.irq_set_wake = s3c2412_irq_rtc_wake;
198
199 irq_set_chip(IRQ_RTC, &s3c2412_irq_rtc_chip);
200
201 return 0;
202}
203
204static struct subsys_interface s3c2412_irq_interface = {
205 .name = "s3c2412_irq",
206 .subsys = &s3c2412_subsys,
207 .add_dev = s3c2412_irq_add,
208};
209
210static int s3c2412_irq_init(void)
211{
212 return subsys_interface_register(&s3c2412_irq_interface);
213}
214
215arch_initcall(s3c2412_irq_init);
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2440.c b/arch/arm/mach-s3c24xx/irq-s3c2440.c
deleted file mode 100644
index 4a18cde439cc..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c2440.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/* linux/arch/arm/mach-s3c2440/irq.c
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20*/
21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/io.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31
32#include <asm/mach/irq.h>
33
34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/pm.h>
39#include <plat/irq.h>
40
41/* WDT/AC97 */
42
43static void s3c_irq_demux_wdtac97(unsigned int irq,
44 struct irq_desc *desc)
45{
46 unsigned int subsrc, submsk;
47
48 /* read the current pending interrupts, and the mask
49 * for what it is available */
50
51 subsrc = __raw_readl(S3C2410_SUBSRCPND);
52 submsk = __raw_readl(S3C2410_INTSUBMSK);
53
54 subsrc &= ~submsk;
55 subsrc >>= 13;
56 subsrc &= 3;
57
58 if (subsrc != 0) {
59 if (subsrc & 1) {
60 generic_handle_irq(IRQ_S3C2440_WDT);
61 }
62 if (subsrc & 2) {
63 generic_handle_irq(IRQ_S3C2440_AC97);
64 }
65 }
66}
67
68
69#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
70
71static void
72s3c_irq_wdtac97_mask(struct irq_data *data)
73{
74 s3c_irqsub_mask(data->irq, INTMSK_WDT, 3 << 13);
75}
76
77static void
78s3c_irq_wdtac97_unmask(struct irq_data *data)
79{
80 s3c_irqsub_unmask(data->irq, INTMSK_WDT);
81}
82
83static void
84s3c_irq_wdtac97_ack(struct irq_data *data)
85{
86 s3c_irqsub_maskack(data->irq, INTMSK_WDT, 3 << 13);
87}
88
89static struct irq_chip s3c_irq_wdtac97 = {
90 .irq_mask = s3c_irq_wdtac97_mask,
91 .irq_unmask = s3c_irq_wdtac97_unmask,
92 .irq_ack = s3c_irq_wdtac97_ack,
93};
94
95static int s3c2440_irq_add(struct device *dev, struct subsys_interface *sif)
96{
97 unsigned int irqno;
98
99 printk("S3C2440: IRQ Support\n");
100
101 /* add new chained handler for wdt, ac7 */
102
103 irq_set_chip_and_handler(IRQ_WDT, &s3c_irq_level_chip,
104 handle_level_irq);
105 irq_set_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
106
107 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
108 irq_set_chip_and_handler(irqno, &s3c_irq_wdtac97,
109 handle_level_irq);
110 set_irq_flags(irqno, IRQF_VALID);
111 }
112
113 return 0;
114}
115
116static struct subsys_interface s3c2440_irq_interface = {
117 .name = "s3c2440_irq",
118 .subsys = &s3c2440_subsys,
119 .add_dev = s3c2440_irq_add,
120};
121
122static int s3c2440_irq_init(void)
123{
124 return subsys_interface_register(&s3c2440_irq_interface);
125}
126
127arch_initcall(s3c2440_irq_init);
128
diff --git a/arch/arm/mach-s3c24xx/irq-s3c244x.c b/arch/arm/mach-s3c24xx/irq-s3c244x.c
deleted file mode 100644
index 5fe8e58d3afd..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c244x.c
+++ /dev/null
@@ -1,142 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20*/
21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/io.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31
32#include <asm/mach/irq.h>
33
34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/pm.h>
39#include <plat/irq.h>
40
41/* camera irq */
42
43static void s3c_irq_demux_cam(unsigned int irq,
44 struct irq_desc *desc)
45{
46 unsigned int subsrc, submsk;
47
48 /* read the current pending interrupts, and the mask
49 * for what it is available */
50
51 subsrc = __raw_readl(S3C2410_SUBSRCPND);
52 submsk = __raw_readl(S3C2410_INTSUBMSK);
53
54 subsrc &= ~submsk;
55 subsrc >>= 11;
56 subsrc &= 3;
57
58 if (subsrc != 0) {
59 if (subsrc & 1) {
60 generic_handle_irq(IRQ_S3C2440_CAM_C);
61 }
62 if (subsrc & 2) {
63 generic_handle_irq(IRQ_S3C2440_CAM_P);
64 }
65 }
66}
67
68#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
69
70static void
71s3c_irq_cam_mask(struct irq_data *data)
72{
73 s3c_irqsub_mask(data->irq, INTMSK_CAM, 3 << 11);
74}
75
76static void
77s3c_irq_cam_unmask(struct irq_data *data)
78{
79 s3c_irqsub_unmask(data->irq, INTMSK_CAM);
80}
81
82static void
83s3c_irq_cam_ack(struct irq_data *data)
84{
85 s3c_irqsub_maskack(data->irq, INTMSK_CAM, 3 << 11);
86}
87
88static struct irq_chip s3c_irq_cam = {
89 .irq_mask = s3c_irq_cam_mask,
90 .irq_unmask = s3c_irq_cam_unmask,
91 .irq_ack = s3c_irq_cam_ack,
92};
93
94static int s3c244x_irq_add(struct device *dev, struct subsys_interface *sif)
95{
96 unsigned int irqno;
97
98 irq_set_chip_and_handler(IRQ_NFCON, &s3c_irq_level_chip,
99 handle_level_irq);
100 set_irq_flags(IRQ_NFCON, IRQF_VALID);
101
102 /* add chained handler for camera */
103
104 irq_set_chip_and_handler(IRQ_CAM, &s3c_irq_level_chip,
105 handle_level_irq);
106 irq_set_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
107
108 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
109 irq_set_chip_and_handler(irqno, &s3c_irq_cam,
110 handle_level_irq);
111 set_irq_flags(irqno, IRQF_VALID);
112 }
113
114 return 0;
115}
116
117static struct subsys_interface s3c2440_irq_interface = {
118 .name = "s3c2440_irq",
119 .subsys = &s3c2440_subsys,
120 .add_dev = s3c244x_irq_add,
121};
122
123static int s3c2440_irq_init(void)
124{
125 return subsys_interface_register(&s3c2440_irq_interface);
126}
127
128arch_initcall(s3c2440_irq_init);
129
130static struct subsys_interface s3c2442_irq_interface = {
131 .name = "s3c2442_irq",
132 .subsys = &s3c2442_subsys,
133 .add_dev = s3c244x_irq_add,
134};
135
136
137static int s3c2442_irq_init(void)
138{
139 return subsys_interface_register(&s3c2442_irq_interface);
140}
141
142arch_initcall(s3c2442_irq_init);
diff --git a/arch/arm/mach-s3c24xx/irq.c b/arch/arm/mach-s3c24xx/irq.c
index c1b96f7cc587..3f3de7492094 100644
--- a/arch/arm/mach-s3c24xx/irq.c
+++ b/arch/arm/mach-s3c24xx/irq.c
@@ -342,7 +342,10 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
342 case S3C_IRQTYPE_NONE: 342 case S3C_IRQTYPE_NONE:
343 return 0; 343 return 0;
344 case S3C_IRQTYPE_EINT: 344 case S3C_IRQTYPE_EINT:
345 if (irq_data->parent_irq) 345 /* On the S3C2412, the EINT0to3 have a parent irq
346 * but need the s3c_irq_eint0t4 chip
347 */
348 if (irq_data->parent_irq && (!soc_is_s3c2412() || hw >= 4))
346 irq_set_chip_and_handler(virq, &s3c_irqext_chip, 349 irq_set_chip_and_handler(virq, &s3c_irqext_chip,
347 handle_edge_irq); 350 handle_edge_irq);
348 else 351 else
@@ -450,7 +453,6 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
450 void __iomem *base = (void *)0xf6000000; /* static mapping */ 453 void __iomem *base = (void *)0xf6000000; /* static mapping */
451 int irq_num; 454 int irq_num;
452 int irq_start; 455 int irq_start;
453 int irq_offset;
454 int ret; 456 int ret;
455 457
456 intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL); 458 intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL);
@@ -474,7 +476,6 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
474 intc->reg_intpnd = base + 0x10; 476 intc->reg_intpnd = base + 0x10;
475 irq_num = 32; 477 irq_num = 32;
476 irq_start = S3C2410_IRQ(0); 478 irq_start = S3C2410_IRQ(0);
477 irq_offset = 0;
478 break; 479 break;
479 case 0x4a000018: 480 case 0x4a000018:
480 pr_debug("irq: found subintc\n"); 481 pr_debug("irq: found subintc\n");
@@ -482,7 +483,6 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
482 intc->reg_mask = base + 0x1c; 483 intc->reg_mask = base + 0x1c;
483 irq_num = 29; 484 irq_num = 29;
484 irq_start = S3C2410_IRQSUB(0); 485 irq_start = S3C2410_IRQSUB(0);
485 irq_offset = 0;
486 break; 486 break;
487 case 0x4a000040: 487 case 0x4a000040:
488 pr_debug("irq: found intc2\n"); 488 pr_debug("irq: found intc2\n");
@@ -491,7 +491,6 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
491 intc->reg_intpnd = base + 0x50; 491 intc->reg_intpnd = base + 0x50;
492 irq_num = 8; 492 irq_num = 8;
493 irq_start = S3C2416_IRQ(0); 493 irq_start = S3C2416_IRQ(0);
494 irq_offset = 0;
495 break; 494 break;
496 case 0x560000a4: 495 case 0x560000a4:
497 pr_debug("irq: found eintc\n"); 496 pr_debug("irq: found eintc\n");
@@ -499,9 +498,8 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
499 498
500 intc->reg_mask = base + 0xa4; 499 intc->reg_mask = base + 0xa4;
501 intc->reg_pending = base + 0x08; 500 intc->reg_pending = base + 0x08;
502 irq_num = 20; 501 irq_num = 24;
503 irq_start = S3C2410_IRQ(32); 502 irq_start = S3C2410_IRQ(32);
504 irq_offset = 4;
505 break; 503 break;
506 default: 504 default:
507 pr_err("irq: unsupported controller address\n"); 505 pr_err("irq: unsupported controller address\n");
@@ -512,7 +510,7 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np,
512 /* now that all the data is complete, init the irq-domain */ 510 /* now that all the data is complete, init the irq-domain */
513 s3c24xx_clear_intc(intc); 511 s3c24xx_clear_intc(intc);
514 intc->domain = irq_domain_add_legacy(np, irq_num, irq_start, 512 intc->domain = irq_domain_add_legacy(np, irq_num, irq_start,
515 irq_offset, &s3c24xx_irq_ops, 513 0, &s3c24xx_irq_ops,
516 intc); 514 intc);
517 if (!intc->domain) { 515 if (!intc->domain) {
518 pr_err("irq: could not create irq-domain\n"); 516 pr_err("irq: could not create irq-domain\n");
@@ -626,6 +624,108 @@ void __init s3c24xx_init_irq(void)
626 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4); 624 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
627} 625}
628 626
627#ifdef CONFIG_CPU_S3C2412
628static struct s3c_irq_data init_s3c2412base[32] = {
629 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT0 */
630 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT1 */
631 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT2 */
632 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT3 */
633 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
634 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
635 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
636 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
637 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
638 { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
639 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
640 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
641 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
642 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
643 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
644 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
645 { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
646 { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
647 { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
648 { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
649 { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
650 { .type = S3C_IRQTYPE_LEVEL, }, /* SDI/CF */
651 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
652 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
653 { .type = S3C_IRQTYPE_NONE, }, /* reserved */
654 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
655 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
656 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
657 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
658 { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
659 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
660 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
661};
662
663static struct s3c_irq_data init_s3c2412eint[32] = {
664 { .type = S3C_IRQTYPE_EINT, .parent_irq = 0 }, /* EINT0 */
665 { .type = S3C_IRQTYPE_EINT, .parent_irq = 1 }, /* EINT1 */
666 { .type = S3C_IRQTYPE_EINT, .parent_irq = 2 }, /* EINT2 */
667 { .type = S3C_IRQTYPE_EINT, .parent_irq = 3 }, /* EINT3 */
668 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT4 */
669 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT5 */
670 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT6 */
671 { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT7 */
672 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT8 */
673 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT9 */
674 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT10 */
675 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT11 */
676 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT12 */
677 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT13 */
678 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT14 */
679 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT15 */
680 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT16 */
681 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT17 */
682 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT18 */
683 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT19 */
684 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT20 */
685 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT21 */
686 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT22 */
687 { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT23 */
688};
689
690static struct s3c_irq_data init_s3c2412subint[32] = {
691 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
692 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
693 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
694 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
695 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
696 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
697 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
698 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
699 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
700 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
701 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
702 { .type = S3C_IRQTYPE_NONE, },
703 { .type = S3C_IRQTYPE_NONE, },
704 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 21 }, /* SDI */
705 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 21 }, /* CF */
706};
707
708void s3c2412_init_irq(void)
709{
710 struct s3c_irq_intc *main_intc;
711
712 pr_info("S3C2412: IRQ Support\n");
713
714#ifdef CONFIG_FIQ
715 init_FIQ(FIQ_START);
716#endif
717
718 main_intc = s3c24xx_init_intc(NULL, &init_s3c2412base[0], NULL, 0x4a000000);
719 if (IS_ERR(main_intc)) {
720 pr_err("irq: could not create main interrupt controller\n");
721 return;
722 }
723
724 s3c24xx_init_intc(NULL, &init_s3c2412eint[0], main_intc, 0x560000a4);
725 s3c24xx_init_intc(NULL, &init_s3c2412subint[0], main_intc, 0x4a000018);
726}
727#endif
728
629#ifdef CONFIG_CPU_S3C2416 729#ifdef CONFIG_CPU_S3C2416
630static struct s3c_irq_data init_s3c2416base[32] = { 730static struct s3c_irq_data init_s3c2416base[32] = {
631 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */ 731 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
@@ -729,6 +829,154 @@ void __init s3c2416_init_irq(void)
729 829
730#endif 830#endif
731 831
832#ifdef CONFIG_CPU_S3C2440
833static struct s3c_irq_data init_s3c2440base[32] = {
834 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
835 { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
836 { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
837 { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
838 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
839 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
840 { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
841 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
842 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
843 { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
844 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
845 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
846 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
847 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
848 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
849 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
850 { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
851 { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
852 { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
853 { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
854 { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
855 { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
856 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
857 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
858 { .type = S3C_IRQTYPE_LEVEL, }, /* NFCON */
859 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
860 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
861 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
862 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
863 { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
864 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
865 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
866};
867
868static struct s3c_irq_data init_s3c2440subint[32] = {
869 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
870 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
871 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
872 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
873 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
874 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
875 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
876 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
877 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
878 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
879 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
880 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* TC */
881 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* ADC */
882 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
883 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
884};
885
886void __init s3c2440_init_irq(void)
887{
888 struct s3c_irq_intc *main_intc;
889
890 pr_info("S3C2440: IRQ Support\n");
891
892#ifdef CONFIG_FIQ
893 init_FIQ(FIQ_START);
894#endif
895
896 main_intc = s3c24xx_init_intc(NULL, &init_s3c2440base[0], NULL, 0x4a000000);
897 if (IS_ERR(main_intc)) {
898 pr_err("irq: could not create main interrupt controller\n");
899 return;
900 }
901
902 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
903 s3c24xx_init_intc(NULL, &init_s3c2440subint[0], main_intc, 0x4a000018);
904}
905#endif
906
907#ifdef CONFIG_CPU_S3C2442
908static struct s3c_irq_data init_s3c2442base[32] = {
909 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
910 { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
911 { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
912 { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
913 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
914 { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
915 { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
916 { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
917 { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
918 { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
919 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
920 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
921 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
922 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
923 { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
924 { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
925 { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
926 { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
927 { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
928 { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
929 { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
930 { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
931 { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
932 { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
933 { .type = S3C_IRQTYPE_LEVEL, }, /* NFCON */
934 { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
935 { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
936 { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
937 { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
938 { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
939 { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
940 { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
941};
942
943static struct s3c_irq_data init_s3c2442subint[32] = {
944 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
945 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
946 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
947 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
948 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
949 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
950 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
951 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
952 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
953 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
954 { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
955 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* TC */
956 { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* ADC */
957};
958
959void __init s3c2442_init_irq(void)
960{
961 struct s3c_irq_intc *main_intc;
962
963 pr_info("S3C2442: IRQ Support\n");
964
965#ifdef CONFIG_FIQ
966 init_FIQ(FIQ_START);
967#endif
968
969 main_intc = s3c24xx_init_intc(NULL, &init_s3c2442base[0], NULL, 0x4a000000);
970 if (IS_ERR(main_intc)) {
971 pr_err("irq: could not create main interrupt controller\n");
972 return;
973 }
974
975 s3c24xx_init_intc(NULL, &init_eint[0], main_intc, 0x560000a4);
976 s3c24xx_init_intc(NULL, &init_s3c2442subint[0], main_intc, 0x4a000018);
977}
978#endif
979
732#ifdef CONFIG_CPU_S3C2443 980#ifdef CONFIG_CPU_S3C2443
733static struct s3c_irq_data init_s3c2443base[32] = { 981static struct s3c_irq_data init_s3c2443base[32] = {
734 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */ 982 { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index 24f1a04ccc88..c1fb6c37867f 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -445,7 +445,7 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
445 .atag_offset = 0x100, 445 .atag_offset = 0x100,
446 .map_io = anubis_map_io, 446 .map_io = anubis_map_io,
447 .init_machine = anubis_init, 447 .init_machine = anubis_init,
448 .init_irq = s3c24xx_init_irq, 448 .init_irq = s3c2440_init_irq,
449 .init_time = samsung_timer_init, 449 .init_time = samsung_timer_init,
450 .restart = s3c244x_restart, 450 .restart = s3c244x_restart,
451MACHINE_END 451MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 2bf6c8c24317..6dfeeb7ef469 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -211,7 +211,7 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
211 .atag_offset = 0x100, 211 .atag_offset = 0x100,
212 .map_io = at2440evb_map_io, 212 .map_io = at2440evb_map_io,
213 .init_machine = at2440evb_init, 213 .init_machine = at2440evb_init,
214 .init_irq = s3c24xx_init_irq, 214 .init_irq = s3c2440_init_irq,
215 .init_time = samsung_timer_init, 215 .init_time = samsung_timer_init,
216 .restart = s3c244x_restart, 216 .restart = s3c244x_restart,
217MACHINE_END 217MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 84a750d46d4b..13d8d073675a 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -589,7 +589,7 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
589 /* Maintainer: Nelson Castillo <arhuaco@freaks-unidos.net> */ 589 /* Maintainer: Nelson Castillo <arhuaco@freaks-unidos.net> */
590 .atag_offset = 0x100, 590 .atag_offset = 0x100,
591 .map_io = gta02_map_io, 591 .map_io = gta02_map_io,
592 .init_irq = s3c24xx_init_irq, 592 .init_irq = s3c2442_init_irq,
593 .init_machine = gta02_machine_init, 593 .init_machine = gta02_machine_init,
594 .init_time = samsung_timer_init, 594 .init_time = samsung_timer_init,
595 .restart = s3c244x_restart, 595 .restart = s3c244x_restart,
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index aade943288c7..a45fcd8ccf79 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -660,7 +660,7 @@ MACHINE_START(JIVE, "JIVE")
660 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ 660 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
661 .atag_offset = 0x100, 661 .atag_offset = 0x100,
662 662
663 .init_irq = s3c24xx_init_irq, 663 .init_irq = s3c2412_init_irq,
664 .map_io = jive_map_io, 664 .map_io = jive_map_io,
665 .init_machine = jive_machine_init, 665 .init_machine = jive_machine_init,
666 .init_time = samsung_timer_init, 666 .init_time = samsung_timer_init,
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index 29f106cb370e..a83db46320bc 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -688,7 +688,7 @@ MACHINE_START(MINI2440, "MINI2440")
688 .atag_offset = 0x100, 688 .atag_offset = 0x100,
689 .map_io = mini2440_map_io, 689 .map_io = mini2440_map_io,
690 .init_machine = mini2440_init, 690 .init_machine = mini2440_init,
691 .init_irq = s3c24xx_init_irq, 691 .init_irq = s3c2440_init_irq,
692 .init_time = samsung_timer_init, 692 .init_time = samsung_timer_init,
693 .restart = s3c244x_restart, 693 .restart = s3c244x_restart,
694MACHINE_END 694MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c
index 5c826d10a66d..01f4354206f9 100644
--- a/arch/arm/mach-s3c24xx/mach-nexcoder.c
+++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c
@@ -152,7 +152,7 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
152 .atag_offset = 0x100, 152 .atag_offset = 0x100,
153 .map_io = nexcoder_map_io, 153 .map_io = nexcoder_map_io,
154 .init_machine = nexcoder_init, 154 .init_machine = nexcoder_init,
155 .init_irq = s3c24xx_init_irq, 155 .init_irq = s3c2440_init_irq,
156 .init_time = samsung_timer_init, 156 .init_time = samsung_timer_init,
157 .restart = s3c244x_restart, 157 .restart = s3c244x_restart,
158MACHINE_END 158MACHINE_END
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 4c90ffda4e11..58d6fbe5bf1f 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -426,7 +426,7 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
426 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */ 426 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
427 .atag_offset = 0x100, 427 .atag_offset = 0x100,
428 .map_io = osiris_map_io, 428 .map_io = osiris_map_io,
429 .init_irq = s3c24xx_init_irq, 429 .init_irq = s3c2440_init_irq,
430 .init_machine = osiris_init, 430 .init_machine = osiris_init,
431 .init_time = samsung_timer_init, 431 .init_time = samsung_timer_init,
432 .restart = s3c244x_restart, 432 .restart = s3c244x_restart,
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 799af43b4e6a..e4d67a33ebee 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -813,7 +813,7 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
813 .atag_offset = 0x100, 813 .atag_offset = 0x100,
814 .map_io = rx1950_map_io, 814 .map_io = rx1950_map_io,
815 .reserve = rx1950_reserve, 815 .reserve = rx1950_reserve,
816 .init_irq = s3c24xx_init_irq, 816 .init_irq = s3c2442_init_irq,
817 .init_machine = rx1950_init_machine, 817 .init_machine = rx1950_init_machine,
818 .init_time = samsung_timer_init, 818 .init_time = samsung_timer_init,
819 .restart = s3c244x_restart, 819 .restart = s3c244x_restart,
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c
index 0a3c96452f0f..3bc6231d0a1f 100644
--- a/arch/arm/mach-s3c24xx/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
@@ -190,11 +190,6 @@ static void __init rx3715_reserve(void)
190 memblock_reserve(0x30081000, 0x1000); 190 memblock_reserve(0x30081000, 0x1000);
191} 191}
192 192
193static void __init rx3715_init_irq(void)
194{
195 s3c24xx_init_irq();
196}
197
198static void __init rx3715_init_machine(void) 193static void __init rx3715_init_machine(void)
199{ 194{
200#ifdef CONFIG_PM_H1940 195#ifdef CONFIG_PM_H1940
@@ -212,7 +207,7 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
212 .atag_offset = 0x100, 207 .atag_offset = 0x100,
213 .map_io = rx3715_map_io, 208 .map_io = rx3715_map_io,
214 .reserve = rx3715_reserve, 209 .reserve = rx3715_reserve,
215 .init_irq = rx3715_init_irq, 210 .init_irq = s3c2440_init_irq,
216 .init_machine = rx3715_init_machine, 211 .init_machine = rx3715_init_machine,
217 .init_time = samsung_timer_init, 212 .init_time = samsung_timer_init,
218 .restart = s3c244x_restart, 213 .restart = s3c244x_restart,
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index 8e3f1d9bbb7c..8146e920f10d 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -130,7 +130,7 @@ MACHINE_START(S3C2413, "S3C2413")
130 .atag_offset = 0x100, 130 .atag_offset = 0x100,
131 131
132 .fixup = smdk2413_fixup, 132 .fixup = smdk2413_fixup,
133 .init_irq = s3c24xx_init_irq, 133 .init_irq = s3c2412_init_irq,
134 .map_io = smdk2413_map_io, 134 .map_io = smdk2413_map_io,
135 .init_machine = smdk2413_machine_init, 135 .init_machine = smdk2413_machine_init,
136 .init_time = samsung_timer_init, 136 .init_time = samsung_timer_init,
@@ -142,7 +142,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
142 .atag_offset = 0x100, 142 .atag_offset = 0x100,
143 143
144 .fixup = smdk2413_fixup, 144 .fixup = smdk2413_fixup,
145 .init_irq = s3c24xx_init_irq, 145 .init_irq = s3c2412_init_irq,
146 .map_io = smdk2413_map_io, 146 .map_io = smdk2413_map_io,
147 .init_machine = smdk2413_machine_init, 147 .init_machine = smdk2413_machine_init,
148 .init_time = samsung_timer_init, 148 .init_time = samsung_timer_init,
@@ -154,7 +154,7 @@ MACHINE_START(SMDK2413, "SMDK2413")
154 .atag_offset = 0x100, 154 .atag_offset = 0x100,
155 155
156 .fixup = smdk2413_fixup, 156 .fixup = smdk2413_fixup,
157 .init_irq = s3c24xx_init_irq, 157 .init_irq = s3c2412_init_irq,
158 .map_io = smdk2413_map_io, 158 .map_io = smdk2413_map_io,
159 .init_machine = smdk2413_machine_init, 159 .init_machine = smdk2413_machine_init,
160 .init_time = samsung_timer_init, 160 .init_time = samsung_timer_init,
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index f56cb08e6d1c..de2e5d39a847 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -177,7 +177,7 @@ MACHINE_START(S3C2440, "SMDK2440")
177 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ 177 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
178 .atag_offset = 0x100, 178 .atag_offset = 0x100,
179 179
180 .init_irq = s3c24xx_init_irq, 180 .init_irq = s3c2440_init_irq,
181 .map_io = smdk2440_map_io, 181 .map_io = smdk2440_map_io,
182 .init_machine = smdk2440_machine_init, 182 .init_machine = smdk2440_machine_init,
183 .init_time = samsung_timer_init, 183 .init_time = samsung_timer_init,
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index 622a1ed24509..b66588428ec9 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -158,7 +158,7 @@ MACHINE_START(VSTMS, "VSTMS")
158 .atag_offset = 0x100, 158 .atag_offset = 0x100,
159 159
160 .fixup = vstms_fixup, 160 .fixup = vstms_fixup,
161 .init_irq = s3c24xx_init_irq, 161 .init_irq = s3c2412_init_irq,
162 .init_machine = vstms_init, 162 .init_machine = vstms_init,
163 .map_io = vstms_map_io, 163 .map_io = vstms_map_io,
164 .init_time = samsung_timer_init, 164 .init_time = samsung_timer_init,
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2412.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c
index 4c4bc1c83b77..d75f95e487ee 100644
--- a/arch/arm/mach-s3c24xx/pm-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c
@@ -29,6 +29,7 @@
29 29
30#include <plat/cpu.h> 30#include <plat/cpu.h>
31#include <plat/pm.h> 31#include <plat/pm.h>
32#include <plat/wakeup-mask.h>
32 33
33#include "regs-dsc.h" 34#include "regs-dsc.h"
34#include "s3c2412-power.h" 35#include "s3c2412-power.h"
@@ -51,8 +52,15 @@ static int s3c2412_cpu_suspend(unsigned long arg)
51 return 1; /* Aborting suspend */ 52 return 1; /* Aborting suspend */
52} 53}
53 54
55/* mapping of interrupts to parts of the wakeup mask */
56static struct samsung_wakeup_mask wake_irqs[] = {
57 { .irq = IRQ_RTC, .bit = S3C2412_PWRCFG_RTC_MASKIRQ, },
58};
59
54static void s3c2412_pm_prepare(void) 60static void s3c2412_pm_prepare(void)
55{ 61{
62 samsung_sync_wakemask(S3C2412_PWRCFG,
63 wake_irqs, ARRAY_SIZE(wake_irqs));
56} 64}
57 65
58static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif) 66static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index e126644cadf4..0f6c47a6475b 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -23,6 +23,9 @@ extern unsigned long samsung_cpu_id;
23#define S3C24XX_CPU_ID 0x32400000 23#define S3C24XX_CPU_ID 0x32400000
24#define S3C24XX_CPU_MASK 0xFFF00000 24#define S3C24XX_CPU_MASK 0xFFF00000
25 25
26#define S3C2412_CPU_ID 0x32412000
27#define S3C2412_CPU_MASK 0xFFFFF000
28
26#define S3C6400_CPU_ID 0x36400000 29#define S3C6400_CPU_ID 0x36400000
27#define S3C6410_CPU_ID 0x36410000 30#define S3C6410_CPU_ID 0x36410000
28#define S3C64XX_CPU_MASK 0xFFFFF000 31#define S3C64XX_CPU_MASK 0xFFFFF000
@@ -53,6 +56,7 @@ static inline int is_samsung_##name(void) \
53} 56}
54 57
55IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK) 58IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
59IS_SAMSUNG_CPU(s3c2412, S3C2412_CPU_ID, S3C2412_CPU_MASK)
56IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK) 60IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
57IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK) 61IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
58IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK) 62IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK)
@@ -74,6 +78,12 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
74# define soc_is_s3c24xx() 0 78# define soc_is_s3c24xx() 0
75#endif 79#endif
76 80
81#if defined(CONFIG_CPU_S3C2412)
82# define soc_is_s3c2412() is_samsung_s3c2412()
83#else
84# define soc_is_s3c2412() 0
85#endif
86
77#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) 87#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
78# define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410()) 88# define soc_is_s3c64xx() (is_samsung_s3c6400() || is_samsung_s3c6410())
79#else 89#else
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index b3643ff007e4..58aa28fb5889 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -1122,8 +1122,12 @@ int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
1122#ifdef CONFIG_PLAT_S3C24XX 1122#ifdef CONFIG_PLAT_S3C24XX
1123static int s3c24xx_gpiolib_fbank_to_irq(struct gpio_chip *chip, unsigned offset) 1123static int s3c24xx_gpiolib_fbank_to_irq(struct gpio_chip *chip, unsigned offset)
1124{ 1124{
1125 if (offset < 4) 1125 if (offset < 4) {
1126 return IRQ_EINT0 + offset; 1126 if (soc_is_s3c2412())
1127 return IRQ_EINT0_2412 + offset;
1128 else
1129 return IRQ_EINT0 + offset;
1130 }
1127 1131
1128 if (offset < 8) 1132 if (offset < 8)
1129 return IRQ_EINT4 + offset - 4; 1133 return IRQ_EINT4 + offset - 4;