aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Figa <tomasz.figa@gmail.com>2013-04-27 20:25:01 -0400
committerTomasz Figa <tomasz.figa@gmail.com>2013-08-05 19:21:46 -0400
commit4280506ac9bb17f2450cf1042edf929d26d24a8e (patch)
tree363304c12a68b8066c1f52caa46e6070603f446b
parent1c161fd0d453ff63c8bb3a703d46d10ac5eba7a4 (diff)
ARM: SAMSUNG: Move all platforms to new clocksource driver
This patch moves all Samsung platforms using PWM clocksource from legacy samsung-time to new samsung-pwm-timer driver. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Mark Brown <broonie@linaro.org> Tested-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/Kconfig10
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig6
-rw-r--r--arch/arm/mach-s3c24xx/common.c16
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig2
-rw-r--r--arch/arm/mach-s3c64xx/common.c21
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig2
-rw-r--r--arch/arm/mach-s5p64x0/common.c17
-rw-r--r--arch/arm/mach-s5pc100/Kconfig1
-rw-r--r--arch/arm/mach-s5pc100/common.c17
-rw-r--r--arch/arm/mach-s5pv210/Kconfig1
-rw-r--r--arch/arm/mach-s5pv210/common.c17
-rw-r--r--arch/arm/plat-samsung/s5p-irq.c3
12 files changed, 89 insertions, 24 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43594d5116ef..341b756508c5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -700,7 +700,7 @@ config ARCH_S3C24XX
700 select ARCH_HAS_CPUFREQ 700 select ARCH_HAS_CPUFREQ
701 select ARCH_REQUIRE_GPIOLIB 701 select ARCH_REQUIRE_GPIOLIB
702 select CLKDEV_LOOKUP 702 select CLKDEV_LOOKUP
703 select CLKSRC_MMIO 703 select CLKSRC_SAMSUNG_PWM
704 select GENERIC_CLOCKEVENTS 704 select GENERIC_CLOCKEVENTS
705 select GPIO_SAMSUNG 705 select GPIO_SAMSUNG
706 select HAVE_CLK 706 select HAVE_CLK
@@ -723,7 +723,7 @@ config ARCH_S3C64XX
723 select ARCH_REQUIRE_GPIOLIB 723 select ARCH_REQUIRE_GPIOLIB
724 select ARM_VIC 724 select ARM_VIC
725 select CLKDEV_LOOKUP 725 select CLKDEV_LOOKUP
726 select CLKSRC_MMIO 726 select CLKSRC_SAMSUNG_PWM
727 select CPU_V6 727 select CPU_V6
728 select GENERIC_CLOCKEVENTS 728 select GENERIC_CLOCKEVENTS
729 select GPIO_SAMSUNG 729 select GPIO_SAMSUNG
@@ -748,7 +748,7 @@ config ARCH_S3C64XX
748config ARCH_S5P64X0 748config ARCH_S5P64X0
749 bool "Samsung S5P6440 S5P6450" 749 bool "Samsung S5P6440 S5P6450"
750 select CLKDEV_LOOKUP 750 select CLKDEV_LOOKUP
751 select CLKSRC_MMIO 751 select CLKSRC_SAMSUNG_PWM
752 select CPU_V6 752 select CPU_V6
753 select GENERIC_CLOCKEVENTS 753 select GENERIC_CLOCKEVENTS
754 select GPIO_SAMSUNG 754 select GPIO_SAMSUNG
@@ -767,7 +767,7 @@ config ARCH_S5PC100
767 bool "Samsung S5PC100" 767 bool "Samsung S5PC100"
768 select ARCH_REQUIRE_GPIOLIB 768 select ARCH_REQUIRE_GPIOLIB
769 select CLKDEV_LOOKUP 769 select CLKDEV_LOOKUP
770 select CLKSRC_MMIO 770 select CLKSRC_SAMSUNG_PWM
771 select CPU_V7 771 select CPU_V7
772 select GENERIC_CLOCKEVENTS 772 select GENERIC_CLOCKEVENTS
773 select GPIO_SAMSUNG 773 select GPIO_SAMSUNG
@@ -787,7 +787,7 @@ config ARCH_S5PV210
787 select ARCH_HAS_HOLES_MEMORYMODEL 787 select ARCH_HAS_HOLES_MEMORYMODEL
788 select ARCH_SPARSEMEM_ENABLE 788 select ARCH_SPARSEMEM_ENABLE
789 select CLKDEV_LOOKUP 789 select CLKDEV_LOOKUP
790 select CLKSRC_MMIO 790 select CLKSRC_SAMSUNG_PWM
791 select CPU_V7 791 select CPU_V7
792 select GENERIC_CLOCKEVENTS 792 select GENERIC_CLOCKEVENTS
793 select GPIO_SAMSUNG 793 select GPIO_SAMSUNG
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 7791ac76f945..dba2173e70f3 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -30,7 +30,6 @@ config CPU_S3C2410
30 select S3C2410_CLOCK 30 select S3C2410_CLOCK
31 select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ 31 select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ
32 select S3C2410_PM if PM 32 select S3C2410_PM if PM
33 select SAMSUNG_HRT
34 select SAMSUNG_WDT_RESET 33 select SAMSUNG_WDT_RESET
35 help 34 help
36 Support for S3C2410 and S3C2410A family from the S3C24XX line 35 Support for S3C2410 and S3C2410A family from the S3C24XX line
@@ -42,7 +41,6 @@ config CPU_S3C2412
42 select CPU_LLSERIAL_S3C2440 41 select CPU_LLSERIAL_S3C2440
43 select S3C2412_DMA if S3C24XX_DMA 42 select S3C2412_DMA if S3C24XX_DMA
44 select S3C2412_PM if PM 43 select S3C2412_PM if PM
45 select SAMSUNG_HRT
46 help 44 help
47 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line 45 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
48 46
@@ -54,7 +52,6 @@ config CPU_S3C2416
54 select S3C2443_COMMON 52 select S3C2443_COMMON
55 select S3C2443_DMA if S3C24XX_DMA 53 select S3C2443_DMA if S3C24XX_DMA
56 select SAMSUNG_CLKSRC 54 select SAMSUNG_CLKSRC
57 select SAMSUNG_HRT
58 help 55 help
59 Support for the S3C2416 SoC from the S3C24XX line 56 Support for the S3C2416 SoC from the S3C24XX line
60 57
@@ -65,7 +62,6 @@ config CPU_S3C2440
65 select S3C2410_CLOCK 62 select S3C2410_CLOCK
66 select S3C2410_PM if PM 63 select S3C2410_PM if PM
67 select S3C2440_DMA if S3C24XX_DMA 64 select S3C2440_DMA if S3C24XX_DMA
68 select SAMSUNG_HRT
69 help 65 help
70 Support for S3C2440 Samsung Mobile CPU based systems. 66 Support for S3C2440 Samsung Mobile CPU based systems.
71 67
@@ -75,7 +71,6 @@ config CPU_S3C2442
75 select CPU_LLSERIAL_S3C2440 71 select CPU_LLSERIAL_S3C2440
76 select S3C2410_CLOCK 72 select S3C2410_CLOCK
77 select S3C2410_PM if PM 73 select S3C2410_PM if PM
78 select SAMSUNG_HRT
79 help 74 help
80 Support for S3C2442 Samsung Mobile CPU based systems. 75 Support for S3C2442 Samsung Mobile CPU based systems.
81 76
@@ -91,7 +86,6 @@ config CPU_S3C2443
91 select S3C2443_COMMON 86 select S3C2443_COMMON
92 select S3C2443_DMA if S3C24XX_DMA 87 select S3C2443_DMA if S3C24XX_DMA
93 select SAMSUNG_CLKSRC 88 select SAMSUNG_CLKSRC
94 select SAMSUNG_HRT
95 help 89 help
96 Support for the S3C2443 SoC from the S3C24XX line 90 Support for the S3C2443 SoC from the S3C24XX line
97 91
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
index e5e7d7dee6f2..457261c98433 100644
--- a/arch/arm/mach-s3c24xx/common.c
+++ b/arch/arm/mach-s3c24xx/common.c
@@ -245,6 +245,22 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
245 samsung_pwm_set_platdata(&s3c24xx_pwm_variant); 245 samsung_pwm_set_platdata(&s3c24xx_pwm_variant);
246} 246}
247 247
248void __init samsung_set_timer_source(unsigned int event, unsigned int source)
249{
250 s3c24xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
251 s3c24xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
252}
253
254void __init samsung_timer_init(void)
255{
256 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
257 IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, IRQ_TIMER3, IRQ_TIMER4,
258 };
259
260 samsung_pwm_clocksource_init(S3C_VA_TIMER,
261 timer_irqs, &s3c24xx_pwm_variant);
262}
263
248/* Serial port registrations */ 264/* Serial port registrations */
249 265
250#define S3C2410_PA_UART0 (S3C24XX_PA_UART) 266#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 20578536aec7..041da5172423 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -17,13 +17,11 @@ config PLAT_S3C64XX
17# Configuration options for the S3C6410 CPU 17# Configuration options for the S3C6410 CPU
18 18
19config CPU_S3C6400 19config CPU_S3C6400
20 select SAMSUNG_HRT
21 bool 20 bool
22 help 21 help
23 Enable S3C6400 CPU support 22 Enable S3C6400 CPU support
24 23
25config CPU_S3C6410 24config CPU_S3C6410
26 select SAMSUNG_HRT
27 bool 25 bool
28 help 26 help
29 Enable S3C6410 CPU support 27 Enable S3C6410 CPU support
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index ca05e61f401c..73d79cf5e141 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -43,7 +43,6 @@
43#include <plat/pm.h> 43#include <plat/pm.h>
44#include <plat/gpio-cfg.h> 44#include <plat/gpio-cfg.h>
45#include <plat/irq-uart.h> 45#include <plat/irq-uart.h>
46#include <plat/irq-vic-timer.h>
47#include <plat/pwm-core.h> 46#include <plat/pwm-core.h>
48#include <plat/regs-irqtype.h> 47#include <plat/regs-irqtype.h>
49#include <plat/regs-serial.h> 48#include <plat/regs-serial.h>
@@ -158,6 +157,23 @@ static struct samsung_pwm_variant s3c64xx_pwm_variant = {
158 .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5), 157 .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5),
159}; 158};
160 159
160void __init samsung_set_timer_source(unsigned int event, unsigned int source)
161{
162 s3c64xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
163 s3c64xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
164}
165
166void __init samsung_timer_init(void)
167{
168 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
169 IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
170 IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
171 };
172
173 samsung_pwm_clocksource_init(S3C_VA_TIMER,
174 timer_irqs, &s3c64xx_pwm_variant);
175}
176
161/* read cpu identification code */ 177/* read cpu identification code */
162 178
163void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) 179void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
@@ -206,9 +222,6 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
206 /* initialise the pair of VICs */ 222 /* initialise the pair of VICs */
207 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME); 223 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
208 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME); 224 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
209
210 /* add the timer sub-irqs */
211 s3c_init_vic_timer_irq(5, IRQ_TIMER0);
212} 225}
213 226
214#define eint_offset(irq) ((irq) - IRQ_EINT(0)) 227#define eint_offset(irq) ((irq) - IRQ_EINT(0))
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 5a707bdb9ea0..bb2111b3751e 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -11,14 +11,12 @@ config CPU_S5P6440
11 bool 11 bool
12 select S5P_SLEEP if PM 12 select S5P_SLEEP if PM
13 select SAMSUNG_DMADEV 13 select SAMSUNG_DMADEV
14 select SAMSUNG_HRT
15 select SAMSUNG_WAKEMASK if PM 14 select SAMSUNG_WAKEMASK if PM
16 help 15 help
17 Enable S5P6440 CPU support 16 Enable S5P6440 CPU support
18 17
19config CPU_S5P6450 18config CPU_S5P6450
20 bool 19 bool
21 select SAMSUNG_HRT
22 select S5P_SLEEP if PM 20 select S5P_SLEEP if PM
23 select SAMSUNG_DMADEV 21 select SAMSUNG_DMADEV
24 select SAMSUNG_WAKEMASK if PM 22 select SAMSUNG_WAKEMASK if PM
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index 49687f277108..42e14f2e7ca7 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -166,6 +166,23 @@ static struct samsung_pwm_variant s5p64x0_pwm_variant = {
166 .tclk_mask = 0, 166 .tclk_mask = 0,
167}; 167};
168 168
169void __init samsung_set_timer_source(unsigned int event, unsigned int source)
170{
171 s5p64x0_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
172 s5p64x0_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
173}
174
175void __init samsung_timer_init(void)
176{
177 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
178 IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
179 IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
180 };
181
182 samsung_pwm_clocksource_init(S3C_VA_TIMER,
183 timer_irqs, &s5p64x0_pwm_variant);
184}
185
169/* 186/*
170 * s5p64x0_map_io 187 * s5p64x0_map_io
171 * 188 *
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 2f456a4533ba..15170be97a74 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -11,7 +11,6 @@ config CPU_S5PC100
11 bool 11 bool
12 select S5P_EXT_INT 12 select S5P_EXT_INT
13 select SAMSUNG_DMADEV 13 select SAMSUNG_DMADEV
14 select SAMSUNG_HRT
15 help 14 help
16 Enable S5PC100 CPU support 15 Enable S5PC100 CPU support
17 16
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c
index e0600afc587e..c5a8eeacf81c 100644
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -141,6 +141,23 @@ static struct samsung_pwm_variant s5pc100_pwm_variant = {
141 .tclk_mask = (1 << 5), 141 .tclk_mask = (1 << 5),
142}; 142};
143 143
144void __init samsung_set_timer_source(unsigned int event, unsigned int source)
145{
146 s5pc100_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
147 s5pc100_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
148}
149
150void __init samsung_timer_init(void)
151{
152 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
153 IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
154 IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
155 };
156
157 samsung_pwm_clocksource_init(S3C_VA_TIMER,
158 timer_irqs, &s5pc100_pwm_variant);
159}
160
144/* 161/*
145 * s5pc100_map_io 162 * s5pc100_map_io
146 * 163 *
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 0963283a7c5d..caaedafbbf5f 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -15,7 +15,6 @@ config CPU_S5PV210
15 select S5P_PM if PM 15 select S5P_PM if PM
16 select S5P_SLEEP if PM 16 select S5P_SLEEP if PM
17 select SAMSUNG_DMADEV 17 select SAMSUNG_DMADEV
18 select SAMSUNG_HRT
19 help 18 help
20 Enable S5PV210 CPU support 19 Enable S5PV210 CPU support
21 20
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c
index 306b29aa58bc..26027a29b8a1 100644
--- a/arch/arm/mach-s5pv210/common.c
+++ b/arch/arm/mach-s5pv210/common.c
@@ -157,6 +157,23 @@ static struct samsung_pwm_variant s5pv210_pwm_variant = {
157 .tclk_mask = (1 << 5), 157 .tclk_mask = (1 << 5),
158}; 158};
159 159
160void __init samsung_set_timer_source(unsigned int event, unsigned int source)
161{
162 s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
163 s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
164}
165
166void __init samsung_timer_init(void)
167{
168 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
169 IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
170 IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
171 };
172
173 samsung_pwm_clocksource_init(S3C_VA_TIMER,
174 timer_irqs, &s5pv210_pwm_variant);
175}
176
160/* 177/*
161 * s5pv210_map_io 178 * s5pv210_map_io
162 * 179 *
diff --git a/arch/arm/plat-samsung/s5p-irq.c b/arch/arm/plat-samsung/s5p-irq.c
index ff1a76011b1e..6729cb2aab56 100644
--- a/arch/arm/plat-samsung/s5p-irq.c
+++ b/arch/arm/plat-samsung/s5p-irq.c
@@ -19,7 +19,6 @@
19#include <mach/map.h> 19#include <mach/map.h>
20#include <plat/regs-timer.h> 20#include <plat/regs-timer.h>
21#include <plat/cpu.h> 21#include <plat/cpu.h>
22#include <plat/irq-vic-timer.h>
23 22
24void __init s5p_init_irq(u32 *vic, u32 num_vic) 23void __init s5p_init_irq(u32 *vic, u32 num_vic)
25{ 24{
@@ -30,6 +29,4 @@ void __init s5p_init_irq(u32 *vic, u32 num_vic)
30 for (irq = 0; irq < num_vic; irq++) 29 for (irq = 0; irq < num_vic; irq++)
31 vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); 30 vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0);
32#endif 31#endif
33
34 s3c_init_vic_timer_irq(5, IRQ_TIMER0);
35} 32}