Commit 04a49b710d436ac977d3db41ae8ad23fe800a30b

Authored by Romain Naour
Committed by Kukjin Kim
1 parent 7f78b6eb5f

ARM: S3C64XX: Add samsung-time support for s3c64xx

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
[tomasz.figa@gmail.com: tested on a Tiny6410 board]
Reviewed-and-Tested-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

Showing 13 changed files with 34 additions and 11 deletions Side-by-side Diff

... ... @@ -790,10 +790,11 @@
790 790 bool "Samsung S3C64XX"
791 791 select ARCH_HAS_CPUFREQ
792 792 select ARCH_REQUIRE_GPIOLIB
793   - select ARCH_USES_GETTIMEOFFSET
794 793 select ARM_VIC
795 794 select CLKDEV_LOOKUP
  795 + select CLKSRC_MMIO
796 796 select CPU_V6
  797 + select GENERIC_CLOCKEVENTS
797 798 select HAVE_CLK
798 799 select HAVE_S3C2410_I2C if I2C
799 800 select HAVE_S3C2410_WATCHDOG if WATCHDOG
arch/arm/mach-s3c64xx/Kconfig
... ... @@ -17,11 +17,13 @@
17 17 # Configuration options for the S3C6410 CPU
18 18  
19 19 config CPU_S3C6400
  20 + select SAMSUNG_HRT
20 21 bool
21 22 help
22 23 Enable S3C6400 CPU support
23 24  
24 25 config CPU_S3C6410
  26 + select SAMSUNG_HRT
25 27 bool
26 28 help
27 29 Enable S3C6410 CPU support
arch/arm/mach-s3c64xx/mach-anw6410.c
... ... @@ -49,6 +49,7 @@
49 49 #include <plat/devs.h>
50 50 #include <plat/cpu.h>
51 51 #include <mach/regs-gpio.h>
  52 +#include <plat/samsung-time.h>
52 53  
53 54 #include "common.h"
54 55 #include "regs-modem.h"
... ... @@ -208,6 +209,7 @@
208 209 s3c64xx_init_io(anw6410_iodesc, ARRAY_SIZE(anw6410_iodesc));
209 210 s3c24xx_init_clocks(12000000);
210 211 s3c24xx_init_uarts(anw6410_uartcfgs, ARRAY_SIZE(anw6410_uartcfgs));
  212 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
211 213  
212 214 anw6410_lcd_mode_set();
213 215 }
... ... @@ -232,7 +234,7 @@
232 234 .map_io = anw6410_map_io,
233 235 .init_machine = anw6410_machine_init,
234 236 .init_late = s3c64xx_init_late,
235   - .init_time = s3c24xx_timer_init,
  237 + .init_time = samsung_timer_init,
236 238 .restart = s3c64xx_restart,
237 239 MACHINE_END
arch/arm/mach-s3c64xx/mach-crag6410.c
... ... @@ -64,6 +64,7 @@
64 64 #include <plat/adc.h>
65 65 #include <linux/platform_data/i2c-s3c2410.h>
66 66 #include <plat/pm.h>
  67 +#include <plat/samsung-time.h>
67 68  
68 69 #include "common.h"
69 70 #include "crag6410.h"
... ... @@ -744,6 +745,7 @@
744 745 s3c64xx_init_io(NULL, 0);
745 746 s3c24xx_init_clocks(12000000);
746 747 s3c24xx_init_uarts(crag6410_uartcfgs, ARRAY_SIZE(crag6410_uartcfgs));
  748 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
747 749  
748 750 /* LCD type and Bypass set by bootloader */
749 751 }
... ... @@ -868,7 +870,7 @@
868 870 .map_io = crag6410_map_io,
869 871 .init_machine = crag6410_machine_init,
870 872 .init_late = s3c64xx_init_late,
871   - .init_time = s3c24xx_timer_init,
  873 + .init_time = samsung_timer_init,
872 874 .restart = s3c64xx_restart,
873 875 MACHINE_END
arch/arm/mach-s3c64xx/mach-hmt.c
... ... @@ -41,6 +41,7 @@
41 41 #include <plat/clock.h>
42 42 #include <plat/devs.h>
43 43 #include <plat/cpu.h>
  44 +#include <plat/samsung-time.h>
44 45  
45 46 #include "common.h"
46 47  
... ... @@ -248,6 +249,7 @@
248 249 s3c64xx_init_io(hmt_iodesc, ARRAY_SIZE(hmt_iodesc));
249 250 s3c24xx_init_clocks(12000000);
250 251 s3c24xx_init_uarts(hmt_uartcfgs, ARRAY_SIZE(hmt_uartcfgs));
  252 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
251 253 }
252 254  
253 255 static void __init hmt_machine_init(void)
... ... @@ -275,7 +277,7 @@
275 277 .map_io = hmt_map_io,
276 278 .init_machine = hmt_machine_init,
277 279 .init_late = s3c64xx_init_late,
278   - .init_time = s3c24xx_timer_init,
  280 + .init_time = samsung_timer_init,
279 281 .restart = s3c64xx_restart,
280 282 MACHINE_END
arch/arm/mach-s3c64xx/mach-mini6410.c
... ... @@ -41,6 +41,7 @@
41 41  
42 42 #include <video/platform_lcd.h>
43 43 #include <video/samsung_fimd.h>
  44 +#include <plat/samsung-time.h>
44 45  
45 46 #include "common.h"
46 47 #include "regs-modem.h"
... ... @@ -232,6 +233,7 @@
232 233 s3c64xx_init_io(NULL, 0);
233 234 s3c24xx_init_clocks(12000000);
234 235 s3c24xx_init_uarts(mini6410_uartcfgs, ARRAY_SIZE(mini6410_uartcfgs));
  236 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
235 237  
236 238 /* set the LCD type */
237 239 tmp = __raw_readl(S3C64XX_SPCON);
... ... @@ -354,7 +356,7 @@
354 356 .map_io = mini6410_map_io,
355 357 .init_machine = mini6410_machine_init,
356 358 .init_late = s3c64xx_init_late,
357   - .init_time = s3c24xx_timer_init,
  359 + .init_time = samsung_timer_init,
358 360 .restart = s3c64xx_restart,
359 361 MACHINE_END
arch/arm/mach-s3c64xx/mach-ncp.c
... ... @@ -43,6 +43,7 @@
43 43 #include <plat/clock.h>
44 44 #include <plat/devs.h>
45 45 #include <plat/cpu.h>
  46 +#include <plat/samsung-time.h>
46 47  
47 48 #include "common.h"
48 49  
... ... @@ -87,6 +88,7 @@
87 88 s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
88 89 s3c24xx_init_clocks(12000000);
89 90 s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  91 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
90 92 }
91 93  
92 94 static void __init ncp_machine_init(void)
... ... @@ -103,7 +105,7 @@
103 105 .map_io = ncp_map_io,
104 106 .init_machine = ncp_machine_init,
105 107 .init_late = s3c64xx_init_late,
106   - .init_time = s3c24xx_timer_init,
  108 + .init_time = samsung_timer_init,
107 109 .restart = s3c64xx_restart,
108 110 MACHINE_END
arch/arm/mach-s3c64xx/mach-real6410.c
... ... @@ -42,6 +42,7 @@
42 42  
43 43 #include <video/platform_lcd.h>
44 44 #include <video/samsung_fimd.h>
  45 +#include <plat/samsung-time.h>
45 46  
46 47 #include "common.h"
47 48 #include "regs-modem.h"
... ... @@ -211,6 +212,7 @@
211 212 s3c64xx_init_io(NULL, 0);
212 213 s3c24xx_init_clocks(12000000);
213 214 s3c24xx_init_uarts(real6410_uartcfgs, ARRAY_SIZE(real6410_uartcfgs));
  215 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
214 216  
215 217 /* set the LCD type */
216 218 tmp = __raw_readl(S3C64XX_SPCON);
... ... @@ -333,7 +335,7 @@
333 335 .map_io = real6410_map_io,
334 336 .init_machine = real6410_machine_init,
335 337 .init_late = s3c64xx_init_late,
336   - .init_time = s3c24xx_timer_init,
  338 + .init_time = samsung_timer_init,
337 339 .restart = s3c64xx_restart,
338 340 MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq.c
... ... @@ -38,6 +38,7 @@
38 38 #include <linux/platform_data/touchscreen-s3c2410.h>
39 39  
40 40 #include <video/platform_lcd.h>
  41 +#include <plat/samsung-time.h>
41 42  
42 43 #include "common.h"
43 44 #include "regs-modem.h"
... ... @@ -378,6 +379,7 @@
378 379 s3c64xx_init_io(smartq_iodesc, ARRAY_SIZE(smartq_iodesc));
379 380 s3c24xx_init_clocks(12000000);
380 381 s3c24xx_init_uarts(smartq_uartcfgs, ARRAY_SIZE(smartq_uartcfgs));
  382 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
381 383  
382 384 smartq_lcd_mode_set();
383 385 }
arch/arm/mach-s3c64xx/mach-smartq5.c
... ... @@ -28,6 +28,7 @@
28 28 #include <plat/devs.h>
29 29 #include <plat/fb.h>
30 30 #include <plat/gpio-cfg.h>
  31 +#include <plat/samsung-time.h>
31 32  
32 33 #include "common.h"
33 34 #include "mach-smartq.h"
... ... @@ -155,7 +156,7 @@
155 156 .map_io = smartq_map_io,
156 157 .init_machine = smartq5_machine_init,
157 158 .init_late = s3c64xx_init_late,
158   - .init_time = s3c24xx_timer_init,
  159 + .init_time = samsung_timer_init,
159 160 .restart = s3c64xx_restart,
160 161 MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq7.c
... ... @@ -28,6 +28,7 @@
28 28 #include <plat/devs.h>
29 29 #include <plat/fb.h>
30 30 #include <plat/gpio-cfg.h>
  31 +#include <plat/samsung-time.h>
31 32  
32 33 #include "common.h"
33 34 #include "mach-smartq.h"
... ... @@ -171,7 +172,7 @@
171 172 .map_io = smartq_map_io,
172 173 .init_machine = smartq7_machine_init,
173 174 .init_late = s3c64xx_init_late,
174   - .init_time = s3c24xx_timer_init,
  175 + .init_time = samsung_timer_init,
175 176 .restart = s3c64xx_restart,
176 177 MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6400.c
... ... @@ -35,6 +35,7 @@
35 35 #include <plat/devs.h>
36 36 #include <plat/cpu.h>
37 37 #include <linux/platform_data/i2c-s3c2410.h>
  38 +#include <plat/samsung-time.h>
38 39  
39 40 #include "common.h"
40 41  
... ... @@ -66,6 +67,7 @@
66 67 s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
67 68 s3c24xx_init_clocks(12000000);
68 69 s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
  70 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
69 71 }
70 72  
71 73 static struct platform_device *smdk6400_devices[] __initdata = {
... ... @@ -92,7 +94,7 @@
92 94 .map_io = smdk6400_map_io,
93 95 .init_machine = smdk6400_machine_init,
94 96 .init_late = s3c64xx_init_late,
95   - .init_time = s3c24xx_timer_init,
  97 + .init_time = samsung_timer_init,
96 98 .restart = s3c64xx_restart,
97 99 MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6410.c
... ... @@ -69,6 +69,7 @@
69 69 #include <linux/platform_data/touchscreen-s3c2410.h>
70 70 #include <plat/keypad.h>
71 71 #include <plat/backlight.h>
  72 +#include <plat/samsung-time.h>
72 73  
73 74 #include "common.h"
74 75 #include "regs-modem.h"
... ... @@ -634,6 +635,7 @@
634 635 s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
635 636 s3c24xx_init_clocks(12000000);
636 637 s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs));
  638 + samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
637 639  
638 640 /* set the LCD type */
639 641  
... ... @@ -702,7 +704,7 @@
702 704 .map_io = smdk6410_map_io,
703 705 .init_machine = smdk6410_machine_init,
704 706 .init_late = s3c64xx_init_late,
705   - .init_time = s3c24xx_timer_init,
  707 + .init_time = samsung_timer_init,
706 708 .restart = s3c64xx_restart,
707 709 MACHINE_END