aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-10-07 14:00:15 -0400
committerArnd Bergmann <arnd@arndb.de>2011-10-07 14:00:15 -0400
commit127d4eb97b7bebc15fd692603263e75c220e24f9 (patch)
tree984ff729eafadf38d972c7a0253d6fc778d3e6ac /arch/arm
parente2d7fbbd7ee0daa0588e3d7f00a3c3cccb295a19 (diff)
parent31451afd2480caf3ae15da56cf9fc3cb3fb821cb (diff)
Merge branch 'samsung/board' into next/board
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-exynos4/Kconfig14
-rw-r--r--arch/arm/mach-exynos4/Makefile3
-rw-r--r--arch/arm/mach-exynos4/clock.c4
-rw-r--r--arch/arm/mach-exynos4/cpu.c21
-rw-r--r--arch/arm/mach-exynos4/include/mach/entry-macro.S29
-rw-r--r--arch/arm/mach-exynos4/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-exynos4/include/mach/map.h1
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-mct.h5
-rw-r--r--arch/arm/mach-exynos4/mach-origen.c2
-rw-r--r--arch/arm/mach-exynos4/mach-smdk4x12.c (renamed from arch/arm/mach-exynos4/mach-smdk4212.c)128
-rw-r--r--arch/arm/mach-exynos4/mach-smdkv310.c4
-rw-r--r--arch/arm/mach-exynos4/mct.c166
-rw-r--r--arch/arm/mach-exynos4/platsmp.c5
-rw-r--r--arch/arm/plat-s5p/cpu.c9
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h8
15 files changed, 251 insertions, 150 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index c595bb03f417..fec23859388b 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -20,6 +20,11 @@ config SOC_EXYNOS4212
20 help 20 help
21 Enable EXYNOS4212 SoC support 21 Enable EXYNOS4212 SoC support
22 22
23config SOC_EXYNOS4412
24 bool
25 help
26 Enable EXYNOS4412 SoC support
27
23config EXYNOS4_MCT 28config EXYNOS4_MCT
24 bool 29 bool
25 default y 30 default y
@@ -243,6 +248,15 @@ config MACH_SMDK4212
243 help 248 help
244 Machine support for Samsung SMDK4212 249 Machine support for Samsung SMDK4212
245 250
251comment "EXYNOS4412 Boards"
252
253config MACH_SMDK4412
254 bool "SMDK4412"
255 select SOC_EXYNOS4412
256 select MACH_SMDK4212
257 help
258 Machine support for Samsung SMDK4412
259
246endmenu 260endmenu
247 261
248comment "Configuration for HSMMC bus width" 262comment "Configuration for HSMMC bus width"
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index e19cd12d264e..c9b2e1f97e44 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -34,7 +34,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
34obj-$(CONFIG_MACH_NURI) += mach-nuri.o 34obj-$(CONFIG_MACH_NURI) += mach-nuri.o
35obj-$(CONFIG_MACH_ORIGEN) += mach-origen.o 35obj-$(CONFIG_MACH_ORIGEN) += mach-origen.o
36 36
37obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4212.o 37obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o
38obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o
38 39
39# device support 40# device support
40 41
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index f26aea3e1bbf..2a037cc221d0 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -1149,7 +1149,7 @@ static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
1149 if (soc_is_exynos4210()) 1149 if (soc_is_exynos4210())
1150 return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), 1150 return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0),
1151 pll_4508); 1151 pll_4508);
1152 else if (soc_is_exynos4212()) 1152 else if (soc_is_exynos4212() || soc_is_exynos4412())
1153 return s5p_get_pll35xx(xtal_rate, __raw_readl(S5P_APLL_CON0)); 1153 return s5p_get_pll35xx(xtal_rate, __raw_readl(S5P_APLL_CON0));
1154 else 1154 else
1155 return 0; 1155 return 0;
@@ -1200,7 +1200,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void)
1200 vpllsrc = clk_get_rate(&clk_vpllsrc.clk); 1200 vpllsrc = clk_get_rate(&clk_vpllsrc.clk);
1201 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1201 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0),
1202 __raw_readl(S5P_VPLL_CON1), pll_4650c); 1202 __raw_readl(S5P_VPLL_CON1), pll_4650c);
1203 } else if (soc_is_exynos4212()) { 1203 } else if (soc_is_exynos4212() || soc_is_exynos4412()) {
1204 apll = s5p_get_pll35xx(xtal, __raw_readl(S5P_APLL_CON0)); 1204 apll = s5p_get_pll35xx(xtal, __raw_readl(S5P_APLL_CON0));
1205 mpll = s5p_get_pll35xx(xtal, __raw_readl(S5P_MPLL_CON0)); 1205 mpll = s5p_get_pll35xx(xtal, __raw_readl(S5P_MPLL_CON0));
1206 epll = s5p_get_pll36xx(xtal, __raw_readl(S5P_EPLL_CON0), 1206 epll = s5p_get_pll36xx(xtal, __raw_readl(S5P_EPLL_CON0),
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 02ec52a99274..a348434f17b5 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -32,6 +32,8 @@
32#include <mach/regs-irq.h> 32#include <mach/regs-irq.h>
33#include <mach/regs-pmu.h> 33#include <mach/regs-pmu.h>
34 34
35unsigned int gic_bank_offset __read_mostly;
36
35extern int combiner_init(unsigned int combiner_nr, void __iomem *base, 37extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
36 unsigned int irq_start); 38 unsigned int irq_start);
37extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq); 39extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
@@ -191,27 +193,34 @@ void __init exynos4_init_clocks(int xtal)
191 193
192 if (soc_is_exynos4210()) 194 if (soc_is_exynos4210())
193 exynos4210_register_clocks(); 195 exynos4210_register_clocks();
194 else if (soc_is_exynos4212()) 196 else if (soc_is_exynos4212() || soc_is_exynos4412())
195 exynos4212_register_clocks(); 197 exynos4212_register_clocks();
196 198
197 exynos4_register_clocks(); 199 exynos4_register_clocks();
198 exynos4_setup_clocks(); 200 exynos4_setup_clocks();
199} 201}
200 202
201static void exynos4_gic_irq_eoi(struct irq_data *d) 203static void exynos4_gic_irq_fix_base(struct irq_data *d)
202{ 204{
203 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 205 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
204 206
205 gic_data->cpu_base = S5P_VA_GIC_CPU + 207 gic_data->cpu_base = S5P_VA_GIC_CPU +
206 (EXYNOS4_GIC_BANK_OFFSET * smp_processor_id()); 208 (gic_bank_offset * smp_processor_id());
209
210 gic_data->dist_base = S5P_VA_GIC_DIST +
211 (gic_bank_offset * smp_processor_id());
207} 212}
208 213
209void __init exynos4_init_irq(void) 214void __init exynos4_init_irq(void)
210{ 215{
211 int irq; 216 int irq;
212 217
213 gic_init(0, IRQ_SPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 218 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
214 gic_arch_extn.irq_eoi = exynos4_gic_irq_eoi; 219
220 gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
221 gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base;
222 gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base;
223 gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base;
215 224
216 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 225 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
217 226
@@ -250,7 +259,7 @@ static int __init exynos4_l2x0_cache_init(void)
250 259
251 if (soc_is_exynos4210()) 260 if (soc_is_exynos4210())
252 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL); 261 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
253 else if (soc_is_exynos4212()) 262 else if (soc_is_exynos4212() || soc_is_exynos4412())
254 __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL); 263 __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
255 264
256 /* L2X0 Prefetch Control */ 265 /* L2X0 Prefetch Control */
diff --git a/arch/arm/mach-exynos4/include/mach/entry-macro.S b/arch/arm/mach-exynos4/include/mach/entry-macro.S
index d7a1e281ce7a..4c9adbd87eac 100644
--- a/arch/arm/mach-exynos4/include/mach/entry-macro.S
+++ b/arch/arm/mach-exynos4/include/mach/entry-macro.S
@@ -17,12 +17,25 @@
17 .endm 17 .endm
18 18
19 .macro get_irqnr_preamble, base, tmp 19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =gic_cpu_base_addr 20 mov \tmp, #0
21
22 mrc p15, 0, \base, c0, c0, 5
23 and \base, \base, #3
24 cmp \base, #0
25 beq 1f
26
27 ldr \tmp, =gic_bank_offset
28 ldr \tmp, [\tmp]
29 cmp \base, #1
30 beq 1f
31
32 cmp \base, #2
33 addeq \tmp, \tmp, \tmp
34 addne \tmp, \tmp, \tmp, LSL #1
35
361: ldr \base, =gic_cpu_base_addr
21 ldr \base, [\base] 37 ldr \base, [\base]
22 mrc p15, 0, \tmp, c0, c0, 5 38 add \base, \base, \tmp
23 and \tmp, \tmp, #3
24 cmp \tmp, #1
25 addeq \base, \base, #EXYNOS4_GIC_BANK_OFFSET
26 .endm 39 .endm
27 40
28 .macro arch_ret_to_user, tmp1, tmp2 41 .macro arch_ret_to_user, tmp1, tmp2
@@ -80,4 +93,10 @@
80 /* As above, this assumes that irqstat and base are preserved.. */ 93 /* As above, this assumes that irqstat and base are preserved.. */
81 94
82 .macro test_for_ltirq, irqnr, irqstat, base, tmp 95 .macro test_for_ltirq, irqnr, irqstat, base, tmp
96 bic \irqnr, \irqstat, #0x1c00
97 mov \tmp, #0
98 cmp \irqnr, #28
99 moveq \tmp, #1
100 streq \irqstat, [\base, #GIC_CPU_EOI]
101 cmp \tmp, #0
83 .endm 102 .endm
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h
index f8952f8f3757..2d3f6bcd9bc0 100644
--- a/arch/arm/mach-exynos4/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -19,6 +19,8 @@
19 19
20#define IRQ_PPI(x) S5P_IRQ(x+16) 20#define IRQ_PPI(x) S5P_IRQ(x+16)
21 21
22#define IRQ_MCT_LOCALTIMER IRQ_PPI(12)
23
22/* SPI: Shared Peripheral Interrupt */ 24/* SPI: Shared Peripheral Interrupt */
23 25
24#define IRQ_SPI(x) S5P_IRQ(x+32) 26#define IRQ_SPI(x) S5P_IRQ(x+32)
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h
index 7073ac730855..9f97eb8499ee 100644
--- a/arch/arm/mach-exynos4/include/mach/map.h
+++ b/arch/arm/mach-exynos4/include/mach/map.h
@@ -62,7 +62,6 @@
62 62
63#define EXYNOS4_PA_GIC_CPU 0x10480000 63#define EXYNOS4_PA_GIC_CPU 0x10480000
64#define EXYNOS4_PA_GIC_DIST 0x10490000 64#define EXYNOS4_PA_GIC_DIST 0x10490000
65#define EXYNOS4_GIC_BANK_OFFSET 0x8000
66 65
67#define EXYNOS4_PA_COREPERI 0x10500000 66#define EXYNOS4_PA_COREPERI 0x10500000
68#define EXYNOS4_PA_TWD 0x10500600 67#define EXYNOS4_PA_TWD 0x10500600
diff --git a/arch/arm/mach-exynos4/include/mach/regs-mct.h b/arch/arm/mach-exynos4/include/mach/regs-mct.h
index ca9c8434b023..80dd02ad6d61 100644
--- a/arch/arm/mach-exynos4/include/mach/regs-mct.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-mct.h
@@ -31,8 +31,9 @@
31#define EXYNOS4_MCT_G_INT_ENB EXYNOS4_MCTREG(0x248) 31#define EXYNOS4_MCT_G_INT_ENB EXYNOS4_MCTREG(0x248)
32#define EXYNOS4_MCT_G_WSTAT EXYNOS4_MCTREG(0x24C) 32#define EXYNOS4_MCT_G_WSTAT EXYNOS4_MCTREG(0x24C)
33 33
34#define EXYNOS4_MCT_L0_BASE EXYNOS4_MCTREG(0x300) 34#define _EXYNOS4_MCT_L_BASE EXYNOS4_MCTREG(0x300)
35#define EXYNOS4_MCT_L1_BASE EXYNOS4_MCTREG(0x400) 35#define EXYNOS4_MCT_L_BASE(x) (_EXYNOS4_MCT_L_BASE + (0x100 * x))
36#define EXYNOS4_MCT_L_MASK (0xffffff00)
36 37
37#define MCT_L_TCNTB_OFFSET (0x00) 38#define MCT_L_TCNTB_OFFSET (0x00)
38#define MCT_L_ICNTB_OFFSET (0x08) 39#define MCT_L_ICNTB_OFFSET (0x08)
diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c
index ed59f86001ac..b5f6f38557c9 100644
--- a/arch/arm/mach-exynos4/mach-origen.c
+++ b/arch/arm/mach-exynos4/mach-origen.c
@@ -100,7 +100,7 @@ static void __init origen_machine_init(void)
100 100
101MACHINE_START(ORIGEN, "ORIGEN") 101MACHINE_START(ORIGEN, "ORIGEN")
102 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */ 102 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
103 .boot_params = S5P_PA_SDRAM + 0x100, 103 .atag_offset = 0x100,
104 .init_irq = exynos4_init_irq, 104 .init_irq = exynos4_init_irq,
105 .map_io = origen_map_io, 105 .map_io = origen_map_io,
106 .init_machine = origen_machine_init, 106 .init_machine = origen_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-smdk4212.c b/arch/arm/mach-exynos4/mach-smdk4x12.c
index 3479a933a6de..fcf2e0e23d53 100644
--- a/arch/arm/mach-exynos4/mach-smdk4212.c
+++ b/arch/arm/mach-exynos4/mach-smdk4x12.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-exynos4/mach-smdk4212.c 2 * linux/arch/arm/mach-exynos4/mach-smdk4x12.c
3 * 3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com 5 * http://www.samsung.com
@@ -37,51 +37,51 @@
37#include <mach/map.h> 37#include <mach/map.h>
38 38
39/* Following are default values for UCON, ULCON and UFCON UART registers */ 39/* Following are default values for UCON, ULCON and UFCON UART registers */
40#define SMDK4212_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 40#define SMDK4X12_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
41 S3C2410_UCON_RXILEVEL | \ 41 S3C2410_UCON_RXILEVEL | \
42 S3C2410_UCON_TXIRQMODE | \ 42 S3C2410_UCON_TXIRQMODE | \
43 S3C2410_UCON_RXIRQMODE | \ 43 S3C2410_UCON_RXIRQMODE | \
44 S3C2410_UCON_RXFIFO_TOI | \ 44 S3C2410_UCON_RXFIFO_TOI | \
45 S3C2443_UCON_RXERR_IRQEN) 45 S3C2443_UCON_RXERR_IRQEN)
46 46
47#define SMDK4212_ULCON_DEFAULT S3C2410_LCON_CS8 47#define SMDK4X12_ULCON_DEFAULT S3C2410_LCON_CS8
48 48
49#define SMDK4212_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ 49#define SMDK4X12_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
50 S5PV210_UFCON_TXTRIG4 | \ 50 S5PV210_UFCON_TXTRIG4 | \
51 S5PV210_UFCON_RXTRIG4) 51 S5PV210_UFCON_RXTRIG4)
52 52
53static struct s3c2410_uartcfg smdk4212_uartcfgs[] __initdata = { 53static struct s3c2410_uartcfg smdk4x12_uartcfgs[] __initdata = {
54 [0] = { 54 [0] = {
55 .hwport = 0, 55 .hwport = 0,
56 .flags = 0, 56 .flags = 0,
57 .ucon = SMDK4212_UCON_DEFAULT, 57 .ucon = SMDK4X12_UCON_DEFAULT,
58 .ulcon = SMDK4212_ULCON_DEFAULT, 58 .ulcon = SMDK4X12_ULCON_DEFAULT,
59 .ufcon = SMDK4212_UFCON_DEFAULT, 59 .ufcon = SMDK4X12_UFCON_DEFAULT,
60 }, 60 },
61 [1] = { 61 [1] = {
62 .hwport = 1, 62 .hwport = 1,
63 .flags = 0, 63 .flags = 0,
64 .ucon = SMDK4212_UCON_DEFAULT, 64 .ucon = SMDK4X12_UCON_DEFAULT,
65 .ulcon = SMDK4212_ULCON_DEFAULT, 65 .ulcon = SMDK4X12_ULCON_DEFAULT,
66 .ufcon = SMDK4212_UFCON_DEFAULT, 66 .ufcon = SMDK4X12_UFCON_DEFAULT,
67 }, 67 },
68 [2] = { 68 [2] = {
69 .hwport = 2, 69 .hwport = 2,
70 .flags = 0, 70 .flags = 0,
71 .ucon = SMDK4212_UCON_DEFAULT, 71 .ucon = SMDK4X12_UCON_DEFAULT,
72 .ulcon = SMDK4212_ULCON_DEFAULT, 72 .ulcon = SMDK4X12_ULCON_DEFAULT,
73 .ufcon = SMDK4212_UFCON_DEFAULT, 73 .ufcon = SMDK4X12_UFCON_DEFAULT,
74 }, 74 },
75 [3] = { 75 [3] = {
76 .hwport = 3, 76 .hwport = 3,
77 .flags = 0, 77 .flags = 0,
78 .ucon = SMDK4212_UCON_DEFAULT, 78 .ucon = SMDK4X12_UCON_DEFAULT,
79 .ulcon = SMDK4212_ULCON_DEFAULT, 79 .ulcon = SMDK4X12_ULCON_DEFAULT,
80 .ufcon = SMDK4212_UFCON_DEFAULT, 80 .ufcon = SMDK4X12_UFCON_DEFAULT,
81 }, 81 },
82}; 82};
83 83
84static struct s3c_sdhci_platdata smdk4212_hsmmc2_pdata __initdata = { 84static struct s3c_sdhci_platdata smdk4x12_hsmmc2_pdata __initdata = {
85 .cd_type = S3C_SDHCI_CD_INTERNAL, 85 .cd_type = S3C_SDHCI_CD_INTERNAL,
86 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 86 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
87#ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT 87#ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT
@@ -90,7 +90,7 @@ static struct s3c_sdhci_platdata smdk4212_hsmmc2_pdata __initdata = {
90#endif 90#endif
91}; 91};
92 92
93static struct s3c_sdhci_platdata smdk4212_hsmmc3_pdata __initdata = { 93static struct s3c_sdhci_platdata smdk4x12_hsmmc3_pdata __initdata = {
94 .cd_type = S3C_SDHCI_CD_INTERNAL, 94 .cd_type = S3C_SDHCI_CD_INTERNAL,
95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
96}; 96};
@@ -106,7 +106,7 @@ static struct regulator_consumer_supply max8997_buck3 =
106 106
107static struct regulator_init_data max8997_buck1_data = { 107static struct regulator_init_data max8997_buck1_data = {
108 .constraints = { 108 .constraints = {
109 .name = "VDD_ARM_SMDK4212", 109 .name = "VDD_ARM_SMDK4X12",
110 .min_uV = 925000, 110 .min_uV = 925000,
111 .max_uV = 1350000, 111 .max_uV = 1350000,
112 .always_on = 1, 112 .always_on = 1,
@@ -121,7 +121,7 @@ static struct regulator_init_data max8997_buck1_data = {
121 121
122static struct regulator_init_data max8997_buck2_data = { 122static struct regulator_init_data max8997_buck2_data = {
123 .constraints = { 123 .constraints = {
124 .name = "VDD_INT_SMDK4212", 124 .name = "VDD_INT_SMDK4X12",
125 .min_uV = 950000, 125 .min_uV = 950000,
126 .max_uV = 1150000, 126 .max_uV = 1150000,
127 .always_on = 1, 127 .always_on = 1,
@@ -136,7 +136,7 @@ static struct regulator_init_data max8997_buck2_data = {
136 136
137static struct regulator_init_data max8997_buck3_data = { 137static struct regulator_init_data max8997_buck3_data = {
138 .constraints = { 138 .constraints = {
139 .name = "VDD_G3D_SMDK4212", 139 .name = "VDD_G3D_SMDK4X12",
140 .min_uV = 950000, 140 .min_uV = 950000,
141 .max_uV = 1150000, 141 .max_uV = 1150000,
142 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 142 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
@@ -149,15 +149,15 @@ static struct regulator_init_data max8997_buck3_data = {
149 .consumer_supplies = &max8997_buck3, 149 .consumer_supplies = &max8997_buck3,
150}; 150};
151 151
152static struct max8997_regulator_data smdk4212_max8997_regulators[] = { 152static struct max8997_regulator_data smdk4x12_max8997_regulators[] = {
153 { MAX8997_BUCK1, &max8997_buck1_data }, 153 { MAX8997_BUCK1, &max8997_buck1_data },
154 { MAX8997_BUCK2, &max8997_buck2_data }, 154 { MAX8997_BUCK2, &max8997_buck2_data },
155 { MAX8997_BUCK3, &max8997_buck3_data }, 155 { MAX8997_BUCK3, &max8997_buck3_data },
156}; 156};
157 157
158static struct max8997_platform_data smdk4212_max8997_pdata = { 158static struct max8997_platform_data smdk4x12_max8997_pdata = {
159 .num_regulators = ARRAY_SIZE(smdk4212_max8997_regulators), 159 .num_regulators = ARRAY_SIZE(smdk4x12_max8997_regulators),
160 .regulators = smdk4212_max8997_regulators, 160 .regulators = smdk4x12_max8997_regulators,
161 161
162 .buck1_voltage[0] = 1100000, /* 1.1V */ 162 .buck1_voltage[0] = 1100000, /* 1.1V */
163 .buck1_voltage[1] = 1100000, /* 1.1V */ 163 .buck1_voltage[1] = 1100000, /* 1.1V */
@@ -187,53 +187,53 @@ static struct max8997_platform_data smdk4212_max8997_pdata = {
187 .buck5_voltage[7] = 1100000, /* 1.1V */ 187 .buck5_voltage[7] = 1100000, /* 1.1V */
188}; 188};
189 189
190static struct i2c_board_info smdk4212_i2c_devs0[] __initdata = { 190static struct i2c_board_info smdk4x12_i2c_devs0[] __initdata = {
191 { 191 {
192 I2C_BOARD_INFO("max8997", 0x66), 192 I2C_BOARD_INFO("max8997", 0x66),
193 .platform_data = &smdk4212_max8997_pdata, 193 .platform_data = &smdk4x12_max8997_pdata,
194 } 194 }
195}; 195};
196 196
197static struct i2c_board_info smdk4212_i2c_devs1[] __initdata = { 197static struct i2c_board_info smdk4x12_i2c_devs1[] __initdata = {
198 { I2C_BOARD_INFO("wm8994", 0x1a), } 198 { I2C_BOARD_INFO("wm8994", 0x1a), }
199}; 199};
200 200
201static struct i2c_board_info smdk4212_i2c_devs3[] __initdata = { 201static struct i2c_board_info smdk4x12_i2c_devs3[] __initdata = {
202 /* nothing here yet */ 202 /* nothing here yet */
203}; 203};
204 204
205static struct i2c_board_info smdk4212_i2c_devs7[] __initdata = { 205static struct i2c_board_info smdk4x12_i2c_devs7[] __initdata = {
206 /* nothing here yet */ 206 /* nothing here yet */
207}; 207};
208 208
209static struct samsung_bl_gpio_info smdk4212_bl_gpio_info = { 209static struct samsung_bl_gpio_info smdk4x12_bl_gpio_info = {
210 .no = EXYNOS4_GPD0(1), 210 .no = EXYNOS4_GPD0(1),
211 .func = S3C_GPIO_SFN(2), 211 .func = S3C_GPIO_SFN(2),
212}; 212};
213 213
214static struct platform_pwm_backlight_data smdk4212_bl_data = { 214static struct platform_pwm_backlight_data smdk4x12_bl_data = {
215 .pwm_id = 1, 215 .pwm_id = 1,
216 .pwm_period_ns = 1000, 216 .pwm_period_ns = 1000,
217}; 217};
218 218
219static uint32_t smdk4212_keymap[] __initdata = { 219static uint32_t smdk4x12_keymap[] __initdata = {
220 /* KEY(row, col, keycode) */ 220 /* KEY(row, col, keycode) */
221 KEY(1, 0, KEY_D), KEY(1, 1, KEY_A), KEY(1, 2, KEY_B), 221 KEY(1, 0, KEY_D), KEY(1, 1, KEY_A), KEY(1, 2, KEY_B),
222 KEY(1, 3, KEY_E), KEY(1, 4, KEY_C) 222 KEY(1, 3, KEY_E), KEY(1, 4, KEY_C)
223}; 223};
224 224
225static struct matrix_keymap_data smdk4212_keymap_data __initdata = { 225static struct matrix_keymap_data smdk4x12_keymap_data __initdata = {
226 .keymap = smdk4212_keymap, 226 .keymap = smdk4x12_keymap,
227 .keymap_size = ARRAY_SIZE(smdk4212_keymap), 227 .keymap_size = ARRAY_SIZE(smdk4x12_keymap),
228}; 228};
229 229
230static struct samsung_keypad_platdata smdk4212_keypad_data __initdata = { 230static struct samsung_keypad_platdata smdk4x12_keypad_data __initdata = {
231 .keymap_data = &smdk4212_keymap_data, 231 .keymap_data = &smdk4x12_keymap_data,
232 .rows = 2, 232 .rows = 2,
233 .cols = 5, 233 .cols = 5,
234}; 234};
235 235
236static struct platform_device *smdk4212_devices[] __initdata = { 236static struct platform_device *smdk4x12_devices[] __initdata = {
237 &s3c_device_hsmmc2, 237 &s3c_device_hsmmc2,
238 &s3c_device_hsmmc3, 238 &s3c_device_hsmmc3,
239 &s3c_device_i2c0, 239 &s3c_device_i2c0,
@@ -245,48 +245,58 @@ static struct platform_device *smdk4212_devices[] __initdata = {
245 &samsung_device_keypad, 245 &samsung_device_keypad,
246}; 246};
247 247
248static void __init smdk4212_map_io(void) 248static void __init smdk4x12_map_io(void)
249{ 249{
250 clk_xusbxti.rate = 24000000; 250 clk_xusbxti.rate = 24000000;
251 251
252 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 252 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
253 s3c24xx_init_clocks(clk_xusbxti.rate); 253 s3c24xx_init_clocks(clk_xusbxti.rate);
254 s3c24xx_init_uarts(smdk4212_uartcfgs, ARRAY_SIZE(smdk4212_uartcfgs)); 254 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs));
255} 255}
256 256
257static void __init smdk4212_machine_init(void) 257static void __init smdk4x12_machine_init(void)
258{ 258{
259 s3c_i2c0_set_platdata(NULL); 259 s3c_i2c0_set_platdata(NULL);
260 i2c_register_board_info(0, smdk4212_i2c_devs0, 260 i2c_register_board_info(0, smdk4x12_i2c_devs0,
261 ARRAY_SIZE(smdk4212_i2c_devs0)); 261 ARRAY_SIZE(smdk4x12_i2c_devs0));
262 262
263 s3c_i2c1_set_platdata(NULL); 263 s3c_i2c1_set_platdata(NULL);
264 i2c_register_board_info(1, smdk4212_i2c_devs1, 264 i2c_register_board_info(1, smdk4x12_i2c_devs1,
265 ARRAY_SIZE(smdk4212_i2c_devs1)); 265 ARRAY_SIZE(smdk4x12_i2c_devs1));
266 266
267 s3c_i2c3_set_platdata(NULL); 267 s3c_i2c3_set_platdata(NULL);
268 i2c_register_board_info(3, smdk4212_i2c_devs3, 268 i2c_register_board_info(3, smdk4x12_i2c_devs3,
269 ARRAY_SIZE(smdk4212_i2c_devs3)); 269 ARRAY_SIZE(smdk4x12_i2c_devs3));
270 270
271 s3c_i2c7_set_platdata(NULL); 271 s3c_i2c7_set_platdata(NULL);
272 i2c_register_board_info(7, smdk4212_i2c_devs7, 272 i2c_register_board_info(7, smdk4x12_i2c_devs7,
273 ARRAY_SIZE(smdk4212_i2c_devs7)); 273 ARRAY_SIZE(smdk4x12_i2c_devs7));
274 274
275 samsung_bl_set(&smdk4212_bl_gpio_info, &smdk4212_bl_data); 275 samsung_bl_set(&smdk4x12_bl_gpio_info, &smdk4x12_bl_data);
276 276
277 samsung_keypad_set_platdata(&smdk4212_keypad_data); 277 samsung_keypad_set_platdata(&smdk4x12_keypad_data);
278 278
279 s3c_sdhci2_set_platdata(&smdk4212_hsmmc2_pdata); 279 s3c_sdhci2_set_platdata(&smdk4x12_hsmmc2_pdata);
280 s3c_sdhci3_set_platdata(&smdk4212_hsmmc3_pdata); 280 s3c_sdhci3_set_platdata(&smdk4x12_hsmmc3_pdata);
281 281
282 platform_add_devices(smdk4212_devices, ARRAY_SIZE(smdk4212_devices)); 282 platform_add_devices(smdk4x12_devices, ARRAY_SIZE(smdk4x12_devices));
283} 283}
284 284
285MACHINE_START(SMDK4212, "SMDK4212") 285MACHINE_START(SMDK4212, "SMDK4212")
286 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 286 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
287 .boot_params = S5P_PA_SDRAM + 0x100, 287 .atag_offset = 0x100,
288 .init_irq = exynos4_init_irq, 288 .init_irq = exynos4_init_irq,
289 .map_io = smdk4212_map_io, 289 .map_io = smdk4x12_map_io,
290 .init_machine = smdk4212_machine_init, 290 .init_machine = smdk4x12_machine_init,
291 .timer = &exynos4_timer,
292MACHINE_END
293
294MACHINE_START(SMDK4412, "SMDK4412")
295 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
296 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
297 .atag_offset = 0x100,
298 .init_irq = exynos4_init_irq,
299 .map_io = smdk4x12_map_io,
300 .init_machine = smdk4x12_machine_init,
291 .timer = &exynos4_timer, 301 .timer = &exynos4_timer,
292MACHINE_END 302MACHINE_END
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index a16eb569a3e6..2c1a076c6a73 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -324,7 +324,7 @@ static void __init smdkv310_machine_init(void)
324MACHINE_START(SMDKV310, "SMDKV310") 324MACHINE_START(SMDKV310, "SMDKV310")
325 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 325 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
326 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 326 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
327 .boot_params = S5P_PA_SDRAM + 0x100, 327 .atag_offset = 0x100,
328 .init_irq = exynos4_init_irq, 328 .init_irq = exynos4_init_irq,
329 .map_io = smdkv310_map_io, 329 .map_io = smdkv310_map_io,
330 .init_machine = smdkv310_machine_init, 330 .init_machine = smdkv310_machine_init,
@@ -333,7 +333,7 @@ MACHINE_END
333 333
334MACHINE_START(SMDKC210, "SMDKC210") 334MACHINE_START(SMDKC210, "SMDKC210")
335 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 335 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
336 .boot_params = S5P_PA_SDRAM + 0x100, 336 .atag_offset = 0x100,
337 .init_irq = exynos4_init_irq, 337 .init_irq = exynos4_init_irq,
338 .map_io = smdkv310_map_io, 338 .map_io = smdkv310_map_io,
339 .init_machine = smdkv310_machine_init, 339 .init_machine = smdkv310_machine_init,
diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c
index ddd86864fb83..eb182f29f48f 100644
--- a/arch/arm/mach-exynos4/mct.c
+++ b/arch/arm/mach-exynos4/mct.c
@@ -20,19 +20,31 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/percpu.h> 21#include <linux/percpu.h>
22 22
23#include <asm/hardware/gic.h>
24
25#include <plat/cpu.h>
26
23#include <mach/map.h> 27#include <mach/map.h>
28#include <mach/irqs.h>
24#include <mach/regs-mct.h> 29#include <mach/regs-mct.h>
25#include <asm/mach/time.h> 30#include <asm/mach/time.h>
26 31
32enum {
33 MCT_INT_SPI,
34 MCT_INT_PPI
35};
36
27static unsigned long clk_cnt_per_tick; 37static unsigned long clk_cnt_per_tick;
28static unsigned long clk_rate; 38static unsigned long clk_rate;
39static unsigned int mct_int_type;
29 40
30struct mct_clock_event_device { 41struct mct_clock_event_device {
31 struct clock_event_device *evt; 42 struct clock_event_device *evt;
32 void __iomem *base; 43 void __iomem *base;
44 char name[10];
33}; 45};
34 46
35struct mct_clock_event_device mct_tick[2]; 47struct mct_clock_event_device mct_tick[NR_CPUS];
36 48
37static void exynos4_mct_write(unsigned int value, void *addr) 49static void exynos4_mct_write(unsigned int value, void *addr)
38{ 50{
@@ -42,57 +54,53 @@ static void exynos4_mct_write(unsigned int value, void *addr)
42 54
43 __raw_writel(value, addr); 55 __raw_writel(value, addr);
44 56
45 switch ((u32) addr) { 57 if (likely(addr >= EXYNOS4_MCT_L_BASE(0))) {
46 case (u32) EXYNOS4_MCT_G_TCON: 58 u32 base = (u32) addr & EXYNOS4_MCT_L_MASK;
47 stat_addr = EXYNOS4_MCT_G_WSTAT; 59 switch ((u32) addr & ~EXYNOS4_MCT_L_MASK) {
48 mask = 1 << 16; /* G_TCON write status */ 60 case (u32) MCT_L_TCON_OFFSET:
49 break; 61 stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
50 case (u32) EXYNOS4_MCT_G_COMP0_L: 62 mask = 1 << 3; /* L_TCON write status */
51 stat_addr = EXYNOS4_MCT_G_WSTAT; 63 break;
52 mask = 1 << 0; /* G_COMP0_L write status */ 64 case (u32) MCT_L_ICNTB_OFFSET:
53 break; 65 stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
54 case (u32) EXYNOS4_MCT_G_COMP0_U: 66 mask = 1 << 1; /* L_ICNTB write status */
55 stat_addr = EXYNOS4_MCT_G_WSTAT; 67 break;
56 mask = 1 << 1; /* G_COMP0_U write status */ 68 case (u32) MCT_L_TCNTB_OFFSET:
57 break; 69 stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
58 case (u32) EXYNOS4_MCT_G_COMP0_ADD_INCR: 70 mask = 1 << 0; /* L_TCNTB write status */
59 stat_addr = EXYNOS4_MCT_G_WSTAT; 71 break;
60 mask = 1 << 2; /* G_COMP0_ADD_INCR write status */ 72 default:
61 break; 73 return;
62 case (u32) EXYNOS4_MCT_G_CNT_L: 74 }
63 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT; 75 } else {
64 mask = 1 << 0; /* G_CNT_L write status */ 76 switch ((u32) addr) {
65 break; 77 case (u32) EXYNOS4_MCT_G_TCON:
66 case (u32) EXYNOS4_MCT_G_CNT_U: 78 stat_addr = EXYNOS4_MCT_G_WSTAT;
67 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT; 79 mask = 1 << 16; /* G_TCON write status */
68 mask = 1 << 1; /* G_CNT_U write status */ 80 break;
69 break; 81 case (u32) EXYNOS4_MCT_G_COMP0_L:
70 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_TCON_OFFSET): 82 stat_addr = EXYNOS4_MCT_G_WSTAT;
71 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET; 83 mask = 1 << 0; /* G_COMP0_L write status */
72 mask = 1 << 3; /* L0_TCON write status */ 84 break;
73 break; 85 case (u32) EXYNOS4_MCT_G_COMP0_U:
74 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_TCON_OFFSET): 86 stat_addr = EXYNOS4_MCT_G_WSTAT;
75 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET; 87 mask = 1 << 1; /* G_COMP0_U write status */
76 mask = 1 << 3; /* L1_TCON write status */ 88 break;
77 break; 89 case (u32) EXYNOS4_MCT_G_COMP0_ADD_INCR:
78 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_TCNTB_OFFSET): 90 stat_addr = EXYNOS4_MCT_G_WSTAT;
79 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET; 91 mask = 1 << 2; /* G_COMP0_ADD_INCR w status */
80 mask = 1 << 0; /* L0_TCNTB write status */ 92 break;
81 break; 93 case (u32) EXYNOS4_MCT_G_CNT_L:
82 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_TCNTB_OFFSET): 94 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
83 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET; 95 mask = 1 << 0; /* G_CNT_L write status */
84 mask = 1 << 0; /* L1_TCNTB write status */ 96 break;
85 break; 97 case (u32) EXYNOS4_MCT_G_CNT_U:
86 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_ICNTB_OFFSET): 98 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
87 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET; 99 mask = 1 << 1; /* G_CNT_U write status */
88 mask = 1 << 1; /* L0_ICNTB write status */ 100 break;
89 break; 101 default:
90 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_ICNTB_OFFSET): 102 return;
91 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET; 103 }
92 mask = 1 << 1; /* L1_ICNTB write status */
93 break;
94 default:
95 return;
96 } 104 }
97 105
98 /* Wait maximum 1 ms until written values are applied */ 106 /* Wait maximum 1 ms until written values are applied */
@@ -321,9 +329,8 @@ static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
321 } 329 }
322} 330}
323 331
324static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id) 332static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt)
325{ 333{
326 struct mct_clock_event_device *mevt = dev_id;
327 struct clock_event_device *evt = mevt->evt; 334 struct clock_event_device *evt = mevt->evt;
328 335
329 /* 336 /*
@@ -335,7 +342,20 @@ static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
335 exynos4_mct_tick_stop(mevt); 342 exynos4_mct_tick_stop(mevt);
336 343
337 /* Clear the MCT tick interrupt */ 344 /* Clear the MCT tick interrupt */
338 exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); 345 if (__raw_readl(mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) {
346 exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
347 return 1;
348 } else {
349 return 0;
350 }
351}
352
353static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
354{
355 struct mct_clock_event_device *mevt = dev_id;
356 struct clock_event_device *evt = mevt->evt;
357
358 exynos4_mct_tick_clear(mevt);
339 359
340 evt->event_handler(evt); 360 evt->event_handler(evt);
341 361
@@ -360,14 +380,10 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
360 380
361 mct_tick[cpu].evt = evt; 381 mct_tick[cpu].evt = evt;
362 382
363 if (cpu == 0) { 383 mct_tick[cpu].base = EXYNOS4_MCT_L_BASE(cpu);
364 mct_tick[cpu].base = EXYNOS4_MCT_L0_BASE; 384 sprintf(mct_tick[cpu].name, "mct_tick%d", cpu);
365 evt->name = "mct_tick0";
366 } else {
367 mct_tick[cpu].base = EXYNOS4_MCT_L1_BASE;
368 evt->name = "mct_tick1";
369 }
370 385
386 evt->name = mct_tick[cpu].name;
371 evt->cpumask = cpumask_of(cpu); 387 evt->cpumask = cpumask_of(cpu);
372 evt->set_next_event = exynos4_tick_set_next_event; 388 evt->set_next_event = exynos4_tick_set_next_event;
373 evt->set_mode = exynos4_tick_set_mode; 389 evt->set_mode = exynos4_tick_set_mode;
@@ -384,13 +400,17 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
384 400
385 exynos4_mct_write(0x1, mct_tick[cpu].base + MCT_L_TCNTB_OFFSET); 401 exynos4_mct_write(0x1, mct_tick[cpu].base + MCT_L_TCNTB_OFFSET);
386 402
387 if (cpu == 0) { 403 if (mct_int_type == MCT_INT_SPI) {
388 mct_tick0_event_irq.dev_id = &mct_tick[cpu]; 404 if (cpu == 0) {
389 setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq); 405 mct_tick0_event_irq.dev_id = &mct_tick[cpu];
406 setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
407 } else {
408 mct_tick1_event_irq.dev_id = &mct_tick[cpu];
409 setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
410 irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
411 }
390 } else { 412 } else {
391 mct_tick1_event_irq.dev_id = &mct_tick[cpu]; 413 gic_enable_ppi(IRQ_MCT_LOCALTIMER);
392 setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
393 irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
394 } 414 }
395} 415}
396 416
@@ -404,7 +424,10 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
404 424
405int local_timer_ack(void) 425int local_timer_ack(void)
406{ 426{
407 return 0; 427 unsigned int cpu = smp_processor_id();
428 struct mct_clock_event_device *mevt = &mct_tick[cpu];
429
430 return exynos4_mct_tick_clear(mevt);
408} 431}
409 432
410#endif /* CONFIG_LOCAL_TIMERS */ 433#endif /* CONFIG_LOCAL_TIMERS */
@@ -419,6 +442,11 @@ static void __init exynos4_timer_resources(void)
419 442
420static void __init exynos4_timer_init(void) 443static void __init exynos4_timer_init(void)
421{ 444{
445 if (soc_is_exynos4210())
446 mct_int_type = MCT_INT_SPI;
447 else
448 mct_int_type = MCT_INT_PPI;
449
422 exynos4_timer_resources(); 450 exynos4_timer_resources();
423 exynos4_clocksource_init(); 451 exynos4_clocksource_init();
424 exynos4_clockevent_init(); 452 exynos4_clockevent_init();
diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
index a3346e36d0ae..d5f0f299ba0d 100644
--- a/arch/arm/mach-exynos4/platsmp.c
+++ b/arch/arm/mach-exynos4/platsmp.c
@@ -32,6 +32,7 @@
32 32
33#include <plat/cpu.h> 33#include <plat/cpu.h>
34 34
35extern unsigned int gic_bank_offset;
35extern void exynos4_secondary_startup(void); 36extern void exynos4_secondary_startup(void);
36 37
37#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ 38#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \
@@ -67,9 +68,9 @@ static DEFINE_SPINLOCK(boot_lock);
67static void __cpuinit exynos4_gic_secondary_init(void) 68static void __cpuinit exynos4_gic_secondary_init(void)
68{ 69{
69 void __iomem *dist_base = S5P_VA_GIC_DIST + 70 void __iomem *dist_base = S5P_VA_GIC_DIST +
70 (EXYNOS4_GIC_BANK_OFFSET * smp_processor_id()); 71 (gic_bank_offset * smp_processor_id());
71 void __iomem *cpu_base = S5P_VA_GIC_CPU + 72 void __iomem *cpu_base = S5P_VA_GIC_CPU +
72 (EXYNOS4_GIC_BANK_OFFSET * smp_processor_id()); 73 (gic_bank_offset * smp_processor_id());
73 int i; 74 int i;
74 75
75 /* 76 /*
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index 909507bae2fa..7b0a28f73a68 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -34,6 +34,7 @@ static const char name_s5pc100[] = "S5PC100";
34static const char name_s5pv210[] = "S5PV210/S5PC110"; 34static const char name_s5pv210[] = "S5PV210/S5PC110";
35static const char name_exynos4210[] = "EXYNOS4210"; 35static const char name_exynos4210[] = "EXYNOS4210";
36static const char name_exynos4212[] = "EXYNOS4212"; 36static const char name_exynos4212[] = "EXYNOS4212";
37static const char name_exynos4412[] = "EXYNOS4412";
37 38
38static struct cpu_table cpu_ids[] __initdata = { 39static struct cpu_table cpu_ids[] __initdata = {
39 { 40 {
@@ -84,6 +85,14 @@ static struct cpu_table cpu_ids[] __initdata = {
84 .init_uarts = exynos4_init_uarts, 85 .init_uarts = exynos4_init_uarts,
85 .init = exynos4_init, 86 .init = exynos4_init,
86 .name = name_exynos4212, 87 .name = name_exynos4212,
88 }, {
89 .idcode = EXYNOS4412_CPU_ID,
90 .idmask = EXYNOS4_CPU_MASK,
91 .map_io = exynos4_map_io,
92 .init_clocks = exynos4_init_clocks,
93 .init_uarts = exynos4_init_uarts,
94 .init = exynos4_init,
95 .name = name_exynos4412,
87 }, 96 },
88}; 97};
89 98
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 1bbbbb420be7..54f370f0fc07 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -40,6 +40,7 @@ extern unsigned long samsung_cpu_id;
40 40
41#define EXYNOS4210_CPU_ID 0x43210000 41#define EXYNOS4210_CPU_ID 0x43210000
42#define EXYNOS4212_CPU_ID 0x43220000 42#define EXYNOS4212_CPU_ID 0x43220000
43#define EXYNOS4412_CPU_ID 0xE4412200
43#define EXYNOS4_CPU_MASK 0xFFFE0000 44#define EXYNOS4_CPU_MASK 0xFFFE0000
44 45
45#define IS_SAMSUNG_CPU(name, id, mask) \ 46#define IS_SAMSUNG_CPU(name, id, mask) \
@@ -56,6 +57,7 @@ IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK)
56IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK) 57IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK)
57IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) 58IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK)
58IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) 59IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
60IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
59 61
60#if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \ 62#if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
61 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \ 63 defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
@@ -108,6 +110,12 @@ IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
108# define soc_is_exynos4212() 0 110# define soc_is_exynos4212() 0
109#endif 111#endif
110 112
113#if defined(CONFIG_SOC_EXYNOS4412)
114# define soc_is_exynos4412() is_samsung_exynos4412()
115#else
116# define soc_is_exynos4412() 0
117#endif
118
111#define EXYNOS4210_REV_0 (0x0) 119#define EXYNOS4210_REV_0 (0x0)
112#define EXYNOS4210_REV_1_0 (0x10) 120#define EXYNOS4210_REV_1_0 (0x10)
113#define EXYNOS4210_REV_1_1 (0x11) 121#define EXYNOS4210_REV_1_1 (0x11)