aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r--arch/arm/mach-exynos/Kconfig3
-rw-r--r--arch/arm/mach-exynos/common.c41
-rw-r--r--arch/arm/mach-exynos/common.h2
-rw-r--r--arch/arm/mach-exynos/include/mach/pm-core.h14
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c5
5 files changed, 58 insertions, 7 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index d19edff0ea6e..ff18fc2ea46f 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -250,6 +250,7 @@ config MACH_ARMLEX4210
250config MACH_UNIVERSAL_C210 250config MACH_UNIVERSAL_C210
251 bool "Mobile UNIVERSAL_C210 Board" 251 bool "Mobile UNIVERSAL_C210 Board"
252 select CLKSRC_MMIO 252 select CLKSRC_MMIO
253 select CLKSRC_SAMSUNG_PWM
253 select CPU_EXYNOS4210 254 select CPU_EXYNOS4210
254 select EXYNOS4_SETUP_FIMC 255 select EXYNOS4_SETUP_FIMC
255 select EXYNOS4_SETUP_FIMD0 256 select EXYNOS4_SETUP_FIMD0
@@ -281,7 +282,6 @@ config MACH_UNIVERSAL_C210
281 select S5P_DEV_TV 282 select S5P_DEV_TV
282 select S5P_GPIO_INT 283 select S5P_GPIO_INT
283 select S5P_SETUP_MIPIPHY 284 select S5P_SETUP_MIPIPHY
284 select SAMSUNG_HRT
285 help 285 help
286 Machine support for Samsung Mobile Universal S5PC210 Reference 286 Machine support for Samsung Mobile Universal S5PC210 Reference
287 Board. 287 Board.
@@ -410,6 +410,7 @@ config MACH_EXYNOS4_DT
410 depends on ARCH_EXYNOS4 410 depends on ARCH_EXYNOS4
411 select ARM_AMBA 411 select ARM_AMBA
412 select CLKSRC_OF 412 select CLKSRC_OF
413 select CLKSRC_SAMSUNG_PWM if CPU_EXYNOS4210
413 select CPU_EXYNOS4210 414 select CPU_EXYNOS4210
414 select KEYBOARD_SAMSUNG if INPUT_KEYBOARD 415 select KEYBOARD_SAMSUNG if INPUT_KEYBOARD
415 select PINCTRL 416 select PINCTRL
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 745e304ad0de..f7e504b7874d 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -10,12 +10,14 @@
10 */ 10 */
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/bitops.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14#include <linux/irq.h> 15#include <linux/irq.h>
15#include <linux/irqchip.h> 16#include <linux/irqchip.h>
16#include <linux/io.h> 17#include <linux/io.h>
17#include <linux/device.h> 18#include <linux/device.h>
18#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <clocksource/samsung_pwm.h>
19#include <linux/sched.h> 21#include <linux/sched.h>
20#include <linux/serial_core.h> 22#include <linux/serial_core.h>
21#include <linux/of.h> 23#include <linux/of.h>
@@ -302,6 +304,13 @@ static struct map_desc exynos5440_iodesc0[] __initdata = {
302 }, 304 },
303}; 305};
304 306
307static struct samsung_pwm_variant exynos4_pwm_variant = {
308 .bits = 32,
309 .div_base = 0,
310 .has_tint_cstat = true,
311 .tclk_mask = 0,
312};
313
305void exynos4_restart(char mode, const char *cmd) 314void exynos4_restart(char mode, const char *cmd)
306{ 315{
307 __raw_writel(0x1, S5P_SWRESET); 316 __raw_writel(0x1, S5P_SWRESET);
@@ -317,9 +326,16 @@ void exynos5_restart(char mode, const char *cmd)
317 val = 0x1; 326 val = 0x1;
318 addr = EXYNOS_SWRESET; 327 addr = EXYNOS_SWRESET;
319 } else if (of_machine_is_compatible("samsung,exynos5440")) { 328 } else if (of_machine_is_compatible("samsung,exynos5440")) {
329 u32 status;
320 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock"); 330 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
331
332 addr = of_iomap(np, 0) + 0xbc;
333 status = __raw_readl(addr);
334
321 addr = of_iomap(np, 0) + 0xcc; 335 addr = of_iomap(np, 0) + 0xcc;
322 val = (0xfff << 20) | (0x1 << 16); 336 val = __raw_readl(addr);
337
338 val = (val & 0xffff0000) | (status & 0xffff);
323 } else { 339 } else {
324 pr_err("%s: cannot support non-DT\n", __func__); 340 pr_err("%s: cannot support non-DT\n", __func__);
325 return; 341 return;
@@ -370,6 +386,8 @@ int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
370 386
371void __init exynos_init_io(struct map_desc *mach_desc, int size) 387void __init exynos_init_io(struct map_desc *mach_desc, int size)
372{ 388{
389 debug_ll_io_init();
390
373#ifdef CONFIG_OF 391#ifdef CONFIG_OF
374 if (initial_boot_params) 392 if (initial_boot_params)
375 of_scan_flat_dt(exynos_fdt_map_chipid, NULL); 393 of_scan_flat_dt(exynos_fdt_map_chipid, NULL);
@@ -442,8 +460,20 @@ static void __init exynos5440_map_io(void)
442 iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0)); 460 iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
443} 461}
444 462
463void __init exynos_set_timer_source(u8 channels)
464{
465 exynos4_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
466 exynos4_pwm_variant.output_mask &= ~channels;
467}
468
445void __init exynos_init_time(void) 469void __init exynos_init_time(void)
446{ 470{
471 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
472 EXYNOS4_IRQ_TIMER0_VIC, EXYNOS4_IRQ_TIMER1_VIC,
473 EXYNOS4_IRQ_TIMER2_VIC, EXYNOS4_IRQ_TIMER3_VIC,
474 EXYNOS4_IRQ_TIMER4_VIC,
475 };
476
447 if (of_have_populated_dt()) { 477 if (of_have_populated_dt()) {
448#ifdef CONFIG_OF 478#ifdef CONFIG_OF
449 of_clk_init(NULL); 479 of_clk_init(NULL);
@@ -455,7 +485,14 @@ void __init exynos_init_time(void)
455 exynos4_clk_init(NULL, !soc_is_exynos4210(), S5P_VA_CMU, readl(S5P_VA_CHIPID + 8) & 1); 485 exynos4_clk_init(NULL, !soc_is_exynos4210(), S5P_VA_CMU, readl(S5P_VA_CHIPID + 8) & 1);
456 exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f); 486 exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f);
457#endif 487#endif
458 mct_init(S5P_VA_SYSTIMER, EXYNOS4_IRQ_MCT_G0, EXYNOS4_IRQ_MCT_L0, EXYNOS4_IRQ_MCT_L1); 488#ifdef CONFIG_CLKSRC_SAMSUNG_PWM
489 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0)
490 samsung_pwm_clocksource_init(S3C_VA_TIMER,
491 timer_irqs, &exynos4_pwm_variant);
492 else
493#endif
494 mct_init(S5P_VA_SYSTIMER, EXYNOS4_IRQ_MCT_G0,
495 EXYNOS4_IRQ_MCT_L0, EXYNOS4_IRQ_MCT_L1);
459 } 496 }
460} 497}
461 498
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 60dd35cc01a6..11fc1e29819b 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -32,6 +32,8 @@ void exynos4_clk_register_fixed_ext(unsigned long, unsigned long);
32 32
33void exynos_firmware_init(void); 33void exynos_firmware_init(void);
34 34
35void exynos_set_timer_source(u8 channels);
36
35#ifdef CONFIG_PM_GENERIC_DOMAINS 37#ifdef CONFIG_PM_GENERIC_DOMAINS
36int exynos_pm_late_initcall(void); 38int exynos_pm_late_initcall(void);
37#else 39#else
diff --git a/arch/arm/mach-exynos/include/mach/pm-core.h b/arch/arm/mach-exynos/include/mach/pm-core.h
index 7dbbfec13ea5..296090e7f423 100644
--- a/arch/arm/mach-exynos/include/mach/pm-core.h
+++ b/arch/arm/mach-exynos/include/mach/pm-core.h
@@ -18,8 +18,15 @@
18#ifndef __ASM_ARCH_PM_CORE_H 18#ifndef __ASM_ARCH_PM_CORE_H
19#define __ASM_ARCH_PM_CORE_H __FILE__ 19#define __ASM_ARCH_PM_CORE_H __FILE__
20 20
21#include <linux/of.h>
21#include <mach/regs-pmu.h> 22#include <mach/regs-pmu.h>
22 23
24#ifdef CONFIG_PINCTRL_EXYNOS
25extern u32 exynos_get_eint_wake_mask(void);
26#else
27static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; }
28#endif
29
23static inline void s3c_pm_debug_init_uart(void) 30static inline void s3c_pm_debug_init_uart(void)
24{ 31{
25 /* nothing here yet */ 32 /* nothing here yet */
@@ -27,7 +34,12 @@ static inline void s3c_pm_debug_init_uart(void)
27 34
28static inline void s3c_pm_arch_prepare_irqs(void) 35static inline void s3c_pm_arch_prepare_irqs(void)
29{ 36{
30 __raw_writel(s3c_irqwake_eintmask, S5P_EINT_WAKEUP_MASK); 37 u32 eintmask = s3c_irqwake_eintmask;
38
39 if (of_have_populated_dt())
40 eintmask = exynos_get_eint_wake_mask();
41
42 __raw_writel(eintmask, S5P_EINT_WAKEUP_MASK);
31 __raw_writel(s3c_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); 43 __raw_writel(s3c_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK);
32} 44}
33 45
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 327d50d4681d..74ddb2b55614 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -41,7 +41,6 @@
41#include <plat/mfc.h> 41#include <plat/mfc.h>
42#include <plat/sdhci.h> 42#include <plat/sdhci.h>
43#include <plat/fimc-core.h> 43#include <plat/fimc-core.h>
44#include <plat/samsung-time.h>
45#include <plat/camport.h> 44#include <plat/camport.h>
46 45
47#include <mach/map.h> 46#include <mach/map.h>
@@ -1094,7 +1093,7 @@ static void __init universal_map_io(void)
1094{ 1093{
1095 exynos_init_io(NULL, 0); 1094 exynos_init_io(NULL, 0);
1096 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 1095 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
1097 samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4); 1096 exynos_set_timer_source(BIT(2) | BIT(4));
1098 xxti_f = 0; 1097 xxti_f = 0;
1099 xusbxti_f = 24000000; 1098 xusbxti_f = 24000000;
1100} 1099}
@@ -1154,7 +1153,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1154 .map_io = universal_map_io, 1153 .map_io = universal_map_io,
1155 .init_machine = universal_machine_init, 1154 .init_machine = universal_machine_init,
1156 .init_late = exynos_init_late, 1155 .init_late = exynos_init_late,
1157 .init_time = samsung_timer_init, 1156 .init_time = exynos_init_time,
1158 .reserve = &universal_reserve, 1157 .reserve = &universal_reserve,
1159 .restart = exynos4_restart, 1158 .restart = exynos4_restart,
1160MACHINE_END 1159MACHINE_END