diff options
| -rw-r--r-- | arch/arm/mach-exynos/Kconfig | 3 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/common.c | 30 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/common.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-exynos/mach-universal_c210.c | 5 |
4 files changed, 35 insertions, 5 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 | |||
| 250 | config MACH_UNIVERSAL_C210 | 250 | config 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..a2d20120e9fc 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 | ||
| 307 | static 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 | |||
| 305 | void exynos4_restart(char mode, const char *cmd) | 314 | void exynos4_restart(char mode, const char *cmd) |
| 306 | { | 315 | { |
| 307 | __raw_writel(0x1, S5P_SWRESET); | 316 | __raw_writel(0x1, S5P_SWRESET); |
| @@ -442,8 +451,20 @@ static void __init exynos5440_map_io(void) | |||
| 442 | iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0)); | 451 | iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0)); |
| 443 | } | 452 | } |
| 444 | 453 | ||
| 454 | void __init exynos_set_timer_source(u8 channels) | ||
| 455 | { | ||
| 456 | exynos4_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
| 457 | exynos4_pwm_variant.output_mask &= ~channels; | ||
| 458 | } | ||
| 459 | |||
| 445 | void __init exynos_init_time(void) | 460 | void __init exynos_init_time(void) |
| 446 | { | 461 | { |
| 462 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
| 463 | EXYNOS4_IRQ_TIMER0_VIC, EXYNOS4_IRQ_TIMER1_VIC, | ||
| 464 | EXYNOS4_IRQ_TIMER2_VIC, EXYNOS4_IRQ_TIMER3_VIC, | ||
| 465 | EXYNOS4_IRQ_TIMER4_VIC, | ||
| 466 | }; | ||
| 467 | |||
| 447 | if (of_have_populated_dt()) { | 468 | if (of_have_populated_dt()) { |
| 448 | #ifdef CONFIG_OF | 469 | #ifdef CONFIG_OF |
| 449 | of_clk_init(NULL); | 470 | of_clk_init(NULL); |
| @@ -455,7 +476,14 @@ void __init exynos_init_time(void) | |||
| 455 | exynos4_clk_init(NULL, !soc_is_exynos4210(), S5P_VA_CMU, readl(S5P_VA_CHIPID + 8) & 1); | 476 | 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); | 477 | exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f); |
| 457 | #endif | 478 | #endif |
| 458 | mct_init(S5P_VA_SYSTIMER, EXYNOS4_IRQ_MCT_G0, EXYNOS4_IRQ_MCT_L0, EXYNOS4_IRQ_MCT_L1); | 479 | #ifdef CONFIG_CLKSRC_SAMSUNG_PWM |
| 480 | if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0) | ||
| 481 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
| 482 | timer_irqs, &exynos4_pwm_variant); | ||
| 483 | else | ||
| 484 | #endif | ||
| 485 | mct_init(S5P_VA_SYSTIMER, EXYNOS4_IRQ_MCT_G0, | ||
| 486 | EXYNOS4_IRQ_MCT_L0, EXYNOS4_IRQ_MCT_L1); | ||
| 459 | } | 487 | } |
| 460 | } | 488 | } |
| 461 | 489 | ||
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 | ||
| 33 | void exynos_firmware_init(void); | 33 | void exynos_firmware_init(void); |
| 34 | 34 | ||
| 35 | void exynos_set_timer_source(u8 channels); | ||
| 36 | |||
| 35 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 37 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
| 36 | int exynos_pm_late_initcall(void); | 38 | int exynos_pm_late_initcall(void); |
| 37 | #else | 39 | #else |
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, |
| 1160 | MACHINE_END | 1159 | MACHINE_END |
