S3C24XX: add clockevent/clocksource support
Subsystems (4)
PATCH 1/1 S3C24XX: add clockevent/clocksource support
Hi,
This patch converts the s3c24xx timer driver to the clocksource/clockevent API.
I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough.
As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Also, I created a new file (s3c24xx_time.c) to avoid impacting the s3c64xx.
Kernel rev v3.7-rc1
Do you have any comments on this patch ?
--- arch/arm/Kconfig | 3 +- arch/arm/plat-s3c24xx/Makefile | 1 + arch/arm/plat-s3c24xx/s3c24xx_time.c | 374 +++++++++++++++++++++++++++++++++++ 3 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 arch/arm/plat-s3c24xx/s3c24xx_time.c
arch/arm/Kconfig +2 -1
@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLK
arch/arm/plat-s3c24xx/Makefile +1 -0
@@ -14,6 +14,7 @@ obj- := obj-y += irq.o obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o +obj-$(CONFIG_GENERIC_CLOCKEVENTS) += s3c24xx_time.o obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpu-freq.o obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o
arch/arm/plat-s3c24xx/s3c24xx_time.c new file +374 -0
374 lines not on this page · raw message
Signature · 1 line
1.8.0
Hi Romain,
Quoted 13 lines · On Wednesday 24 of October 2012 22:56:40 Romain Naour wrote:
Hi,
This patch converts the s3c24xx timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it. Also, I created a new file (
s3c24xx_time.c) to avoid impacting the s3c64xx. Kernel rev v3.7-rc1
Quoted 1 line
Do you have any comments on this patch ?
Generally looks fine, but I have some doubts:
- Isn't 64ms still way too little for overflow period? Someone who is more into Linux time keeping should comment on this.
- Much of the code is duplicated from s5p-time, maybe s5p-time could be made a generic samsung-time instead? It could be also used for S3C64xx.
CC'ing Heiko and Sylwester, as they might find this patch interesting.
Best regards,
Tomasz Figa
Hi Tomasz,
Thank you for your reply.
Quoted 16 lines · Tomasz Figa
Hi Romain,
Quoted 13 lines · On Wednesday 24 of October 2012 22:56:40 Romain Naour wrote:
Hi,
This patch converts the s3c24xx timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it. Also, I created a new file (
s3c24xx_time.c) to avoid impacting the s3c64xx. Kernel rev v3.7-rc1
Quoted 6 lines
Quoted 1 line
Do you have any comments on this patch ?
Generally looks fine, but I have some doubts:
- Isn't 64ms still way too little for overflow period? Someone who is more into Linux time keeping should comment on this.
It seems to work correctly with 64ms.
Actually, it start to work with 15,5ms (timer's frequency = 4,21MHz)
Quoted 3 lines
- Much of the code is duplicated from s5p-time, maybe s5p-time could be made a generic samsung-time instead? It could be also used for S3C64xx.
I'm agree, It would be great if we can use hrtimer on s3c64xx too :)
I made another patch following your advice, but I'm not sure if we really need to rename sp5-time.c and s5p_* functions. I tested this patch with and without hrtimer enabled on my mini2440.
But, I need a confirmation for the frequency of pclk for each cpu.
Normally it is between 70MHz and 50MHz.
Also, we may need to define specific TSCALER_DIV TDIV value for s3c64xx. (samsung-time.h)
Quoted 6 lines
CC'ing Heiko and Sylwester, as they might find this patch interesting.
Best regards,
Tomasz Figa
Regards,
Romain Naour
Here is the new patch:
--- arch/arm/Kconfig | 6 +- arch/arm/mach-exynos/mach-universal_c210.c | 4 +- arch/arm/mach-s3c24xx/Kconfig | 6 + arch/arm/mach-s3c24xx/mach-amlm5900.c | 3 + arch/arm/mach-s3c24xx/mach-anubis.c | 2 + arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 + arch/arm/mach-s3c24xx/mach-bast.c | 2 + arch/arm/mach-s3c24xx/mach-gta02.c | 2 + arch/arm/mach-s3c24xx/mach-h1940.c | 2 + arch/arm/mach-s3c24xx/mach-jive.c | 2 + arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +- arch/arm/mach-s3c24xx/mach-n30.c | 2 + arch/arm/mach-s3c24xx/mach-nexcoder.c | 2 + arch/arm/mach-s3c24xx/mach-osiris.c | 2 + arch/arm/mach-s3c24xx/mach-otom.c | 2 + arch/arm/mach-s3c24xx/mach-qt2410.c | 2 + arch/arm/mach-s3c24xx/mach-rx1950.c | 2 + arch/arm/mach-s3c24xx/mach-rx3715.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2410.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2413.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2416.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2440.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2443.c | 2 + arch/arm/mach-s3c24xx/mach-tct_hammer.c | 2 + arch/arm/mach-s3c24xx/mach-vr1000.c | 2 + arch/arm/mach-s3c24xx/mach-vstms.c | 3 +- arch/arm/mach-s3c64xx/mach-anw6410.c | 2 + arch/arm/mach-s3c64xx/mach-crag6410.c | 2 + arch/arm/mach-s3c64xx/mach-hmt.c | 2 + arch/arm/mach-s3c64xx/mach-mini6410.c | 2 + arch/arm/mach-s3c64xx/mach-ncp.c | 2 + arch/arm/mach-s3c64xx/mach-real6410.c | 2 + arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 1 + arch/arm/mach-s3c64xx/mach-smartq7.c | 1 + arch/arm/mach-s3c64xx/mach-smdk6400.c | 2 + arch/arm/mach-s3c64xx/mach-smdk6410.c | 2 + arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 4 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 4 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 4 +- arch/arm/mach-s5pv210/mach-goni.c | 4 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 4 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 4 +- arch/arm/mach-s5pv210/mach-torbreck.c | 4 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 51 +++ arch/arm/plat-samsung/s5p-time.c | 405 ---------------------- arch/arm/plat-samsung/samsung-time.c | 405 ++++++++++++++++++++++ 52 files changed, 555 insertions(+), 470 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.c
arch/arm/Kconfig +4 -2
@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLK
@@ -756,7 +757,8 @@ config ARCH_S3C64XX bool "Samsung S3C64XX" select ARCH_HAS_CPUFREQ select ARCH_REQUIRE_GPIOLIB - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select ARM_VIC select CLKDEV_LOOKUP select CPU_V6
arch/arm/mach-exynos/mach-universal_c210.c +2 -2
@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h>
@@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); }static void s5p_tv_setup (void )
arch/arm/mach-s3c24xx/Kconfig +6 -0
@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.
@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line
@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.
@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.
@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX line
arch/arm/mach-s3c24xx/mach-amlm5900.c +3 -0
@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =
@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef CONFIG_FB_S3C2410
arch/arm/mach-s3c24xx/mach-anubis.c +2 -0
@@ -54,6 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -414,6 +415,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
arch/arm/mach-s3c24xx/mach-at2440evb.c +2 -0
@@ -48,6 +48,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -192,6 +193,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init at2440evb_init (void )
arch/arm/mach-s3c24xx/mach-bast.c +2 -0
@@ -63,6 +63,7 @@#include <plat/cpu-freq.h> #include <plat/gpio-cfg.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -583,6 +584,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )
arch/arm/mach-s3c24xx/mach-gta02.c +2 -0
@@ -88,6 +88,7 @@#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -507,6 +508,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }
arch/arm/mach-s3c24xx/mach-h1940.c +2 -0
@@ -67,6 +67,7 @@#include <plat/pm.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h>
@@ -652,6 +653,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
arch/arm/mach-s3c24xx/mach-jive.c +2 -0
@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };
@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )
arch/arm/mach-s3c24xx/mach-mini2440.c +3 -1
@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h>
@@ -527,6 +528,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/*
@@ -689,6 +691,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-n30.c +2 -0
@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */
arch/arm/mach-s3c24xx/mach-nexcoder.c +2 -0
@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init (); }
arch/arm/mach-s3c24xx/mach-osiris.c +2 -0
@@ -53,6 +53,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -386,6 +387,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
arch/arm/mach-s3c24xx/mach-otom.c +2 -0
@@ -37,6 +37,7 @@#include <plat/devs.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -104,6 +105,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )
arch/arm/mach-s3c24xx/mach-qt2410.c +2 -0
@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init qt2410_machine_init (void )
arch/arm/mach-s3c24xx/mach-rx1950.c +2 -0
@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/irq.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h>
@@ -743,6 +744,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
arch/arm/mach-s3c24xx/mach-rx3715.c +2 -0
@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */
arch/arm/mach-s3c24xx/mach-smdk2410.c +2 -0
@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2410_init (void )
arch/arm/mach-s3c24xx/mach-smdk2413.c +2 -0
@@ -47,6 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -107,6 +108,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2413_machine_init (void )
arch/arm/mach-s3c24xx/mach-smdk2416.c +2 -0
@@ -52,6 +52,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h>
@@ -222,6 +223,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2416_machine_init (void )
arch/arm/mach-s3c24xx/mach-smdk2440.c +2 -0
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -164,6 +165,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2440_machine_init (void )
arch/arm/mach-s3c24xx/mach-smdk2443.c +2 -0
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -123,6 +124,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2443_machine_init (void )
arch/arm/mach-s3c24xx/mach-tct_hammer.c +2 -0
@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init tct_hammer_init (void )
arch/arm/mach-s3c24xx/mach-vr1000.c +2 -0
@@ -50,6 +50,7 @@#include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -335,6 +336,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )
arch/arm/mach-s3c24xx/mach-vstms.c +2 -1
@@ -47,7 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };
@@ -144,6 +144,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )
arch/arm/mach-s3c64xx/mach-anw6410.c +2 -0
@@ -51,6 +51,7 @@#include <plat/cpu.h> #include <mach/regs-gpio.h> #include <mach/regs-modem.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -209,6 +210,7 @@ static void __init anw6410_map_io(void)s3c64xx_init_io (anw6410_iodesc,ARRAY_SIZE (anw6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (anw6410_uartcfgs,ARRAY_SIZE (anw6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );anw6410_lcd_mode_set (); }
arch/arm/mach-s3c64xx/mach-crag6410.c +2 -0
@@ -70,6 +70,7 @@#include <plat/adc.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -704,6 +705,7 @@ static void __init crag6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (crag6410_uartcfgs,ARRAY_SIZE (crag6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* LCD type and Bypass set by bootloader */ }
arch/arm/mach-s3c64xx/mach-hmt.c +2 -0
@@ -42,6 +42,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -249,6 +250,7 @@ static void __init hmt_map_io(void)s3c64xx_init_io (hmt_iodesc,ARRAY_SIZE (hmt_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (hmt_uartcfgs,ARRAY_SIZE (hmt_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init hmt_machine_init (void )
arch/arm/mach-s3c64xx/mach-mini6410.c +2 -0
@@ -44,6 +44,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -233,6 +234,7 @@ static void __init mini6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini6410_uartcfgs,ARRAY_SIZE (mini6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
arch/arm/mach-s3c64xx/mach-ncp.c +2 -0
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -88,6 +89,7 @@ static void __init ncp_map_io(void)s3c64xx_init_io (ncp_iodesc,ARRAY_SIZE (ncp_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (ncp_uartcfgs,ARRAY_SIZE (ncp_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init ncp_machine_init (void )
arch/arm/mach-s3c64xx/mach-real6410.c +2 -0
@@ -45,6 +45,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -212,6 +213,7 @@ static void __init real6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (real6410_uartcfgs,ARRAY_SIZE (real6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
arch/arm/mach-s3c64xx/mach-smartq.c +2 -0
@@ -39,6 +39,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <video/platform_lcd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -378,6 +379,7 @@ void __init smartq_map_io(void)s3c64xx_init_io (smartq_iodesc,ARRAY_SIZE (smartq_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smartq_uartcfgs,ARRAY_SIZE (smartq_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );smartq_lcd_mode_set (); }
arch/arm/mach-s3c64xx/mach-smartq5.c +1 -0
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
arch/arm/mach-s3c64xx/mach-smartq7.c +1 -0
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
arch/arm/mach-s3c64xx/mach-smdk6400.c +2 -0
@@ -36,6 +36,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -67,6 +68,7 @@ static void __init smdk6400_map_io(void)s3c64xx_init_io (smdk6400_iodesc,ARRAY_SIZE (smdk6400_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6400_uartcfgs,ARRAY_SIZE (smdk6400_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static struct platform_device *smdk6400_devices[]__initdata = {
arch/arm/mach-s3c64xx/mach-smdk6410.c +2 -0
@@ -73,6 +73,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <plat/keypad.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -636,6 +637,7 @@ static void __init smdk6410_map_io(void)s3c64xx_init_io (smdk6410_iodesc,ARRAY_SIZE (smdk6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6410_uartcfgs,ARRAY_SIZE (smdk6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */
arch/arm/mach-s5p64x0/Kconfig +2 -2
@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
arch/arm/mach-s5p64x0/mach-smdk6440.c +2 -2
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void s5p6440_set_lcd_interface (void )
arch/arm/mach-s5p64x0/mach-smdk6450.c +2 -2
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void s5p6450_set_lcd_interface (void )
arch/arm/mach-s5pv210/Kconfig +1 -1
@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV
arch/arm/mach-s5pv210/mach-aquila.c +2 -2
@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init aquila_machine_init (void )
arch/arm/mach-s5pv210/mach-goni.c +2 -2
@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h>
@@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init goni_reserve (void )
arch/arm/mach-s5pv210/mach-smdkc110.c +2 -2
@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h"
@@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init smdkc110_reserve (void )
arch/arm/mach-s5pv210/mach-smdkv210.c +2 -2
@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h>
@@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); }static void __init smdkv210_reserve (void )
arch/arm/mach-s5pv210/mach-torbreck.c +2 -2
@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init torbreck_machine_init (void )
arch/arm/plat-samsung/Kconfig +1 -1
@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help
arch/arm/plat-samsung/Makefile +1 -1
@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o
arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */
arch/arm/plat-samsung/include/plat/samsung-time.h new file +51 -0
51 lines not on this page · raw message
arch/arm/plat-samsung/s5p-time.c deleted +0 -405
405 lines not on this page · raw message
arch/arm/plat-samsung/samsung-time.c new file +405 -0
405 lines not on this page · raw message
Signature · 1 line
1.8.0
Quoted 1 line · Romain Naour
[...]
Basically, looks good to me but need to edit commit message :-)
And since this touches many files so would be better if this could be applied early -rc not now. It can provide more time to test for many boards. Is it ok to you?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Quoted 46 lines
Here is the new patch:
--- arch/arm/Kconfig | 6 +- arch/arm/mach-exynos/mach-universal_c210.c | 4 +- arch/arm/mach-s3c24xx/Kconfig | 6 + arch/arm/mach-s3c24xx/mach-amlm5900.c | 3 + arch/arm/mach-s3c24xx/mach-anubis.c | 2 + arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 + arch/arm/mach-s3c24xx/mach-bast.c | 2 + arch/arm/mach-s3c24xx/mach-gta02.c | 2 + arch/arm/mach-s3c24xx/mach-h1940.c | 2 + arch/arm/mach-s3c24xx/mach-jive.c | 2 + arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +- arch/arm/mach-s3c24xx/mach-n30.c | 2 + arch/arm/mach-s3c24xx/mach-nexcoder.c | 2 + arch/arm/mach-s3c24xx/mach-osiris.c | 2 + arch/arm/mach-s3c24xx/mach-otom.c | 2 + arch/arm/mach-s3c24xx/mach-qt2410.c | 2 + arch/arm/mach-s3c24xx/mach-rx1950.c | 2 + arch/arm/mach-s3c24xx/mach-rx3715.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2410.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2413.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2416.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2440.c | 2 + arch/arm/mach-s3c24xx/mach-smdk2443.c | 2 + arch/arm/mach-s3c24xx/mach-tct_hammer.c | 2 + arch/arm/mach-s3c24xx/mach-vr1000.c | 2 + arch/arm/mach-s3c24xx/mach-vstms.c | 3 +- arch/arm/mach-s3c64xx/mach-anw6410.c | 2 + arch/arm/mach-s3c64xx/mach-crag6410.c | 2 + arch/arm/mach-s3c64xx/mach-hmt.c | 2 + arch/arm/mach-s3c64xx/mach-mini6410.c | 2 + arch/arm/mach-s3c64xx/mach-ncp.c | 2 + arch/arm/mach-s3c64xx/mach-real6410.c | 2 + arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 1 + arch/arm/mach-s3c64xx/mach-smartq7.c | 1 + arch/arm/mach-s3c64xx/mach-smdk6400.c | 2 + arch/arm/mach-s3c64xx/mach-smdk6410.c | 2 + arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 4 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 4 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 4 +- arch/arm/mach-s5pv210/mach-goni.c | 4 +-
Quoted 8 lines
arch/arm/mach-s5pv210/mach-smdkc110.c | 4 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 4 +- arch/arm/mach-s5pv210/mach-torbreck.c | 4 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 51 +++ arch/arm/plat-samsung/s5p-time.c | 405
---------------------
Quoted 1,153 lines
(quoted diff) +1
-1- arch/arm/plat-samsung/samsung-time.c | 405 ++++++++++++++++++++++ 52 files changed, 555 insertions(+), 470 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.carch/arm/Kconfig +4
-2@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLK@@ -756,7 +757,8 @@ config ARCH_S3C64XX bool "Samsung S3C64XX" select ARCH_HAS_CPUFREQ select ARCH_REQUIRE_GPIOLIB - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select ARM_VIC select CLKDEV_LOOKUP select CPU_V6arch/arm/mach- renamed from arch/arm/mach-exynos/mach-universal_c210.c +0
-0
exynos/mach-universal_c210.c
index ebc9dd3..3b9ec1c 100644arch/arm/mach-exynos/mach-universal_c210.c +2
-2@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h> @@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); }static void
s5p_tv_setup(void)arch/arm/mach-s3c24xx/Kconfig +6
-0@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX linearch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-amlm5900.c +0
-0
s3c24xx/mach-amlm5900.c
index f4ad99c..5d5a07c 100644arch/arm/mach-s3c24xx/mach-amlm5900.c +3
-0@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef
CONFIG_FB_S3C2410arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-anubis.c +0
-0
s3c24xx/mach-anubis.c
index 1ee8c46..7d323ed 100644arch/arm/mach-s3c24xx/mach-anubis.c +2
-0@@ -54,6 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -414,6 +415,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-at2440evb.c +0
-0
s3c24xx/mach-at2440evb.c
index 00381fe..1e93cb3 100644arch/arm/mach-s3c24xx/mach-at2440evb.c +2
-0@@ -48,6 +48,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h" @@ -192,6 +193,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initat2440evb_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-bast.c +0
-0
s3c24xx/mach-bast.c
index 6a30ce7..be3cc7a 100644arch/arm/mach-s3c24xx/mach-bast.c +2
-0@@ -63,6 +63,7 @@#include <plat/cpu-freq.h> #include <plat/gpio-cfg.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -583,6 +584,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-gta02.c +0
-0
s3c24xx/mach-gta02.c
index 4a96346..3f83412 100644arch/arm/mach-s3c24xx/mach-gta02.c +2
-0@@ -88,6 +88,7 @@#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h" @@ -507,6 +508,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-h1940.c +0
-0
s3c24xx/mach-h1940.c
index 63aaf07..1455779 100644arch/arm/mach-s3c24xx/mach-h1940.c +2
-0@@ -67,6 +67,7 @@#include <plat/pm.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -652,6 +653,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-jive.c +0
-0
s3c24xx/mach-jive.c
index c9954e2..9671c42 100644arch/arm/mach-s3c24xx/mach-jive.c +2
-0@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-mini2440.c +0
-0
s3c24xx/mach-mini2440.c
index 393c0f1..a96efcd 100644arch/arm/mach-s3c24xx/mach-mini2440.c +2
-0@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h> @@ -527,6 +528,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/*
arch/arm/mach-s3c24xx/mach-mini2440.c +1
-1@@ -689,6 +691,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-n30.c +0
-0
s3c24xx/mach-n30.c
index c53a9bf..ea80658 100644arch/arm/mach-s3c24xx/mach-n30.c +2
-0@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h" @@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-nexcoder.c +0
-0
s3c24xx/mach-nexcoder.c
index a2b92b0..76acb5a 100644arch/arm/mach-s3c24xx/mach-nexcoder.c +2
-0@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init ();}
arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-osiris.c +0
-0
s3c24xx/mach-osiris.c
index bb36d83..60a5f92 100644arch/arm/mach-s3c24xx/mach-osiris.c +2
-0@@ -53,6 +53,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -386,6 +387,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-otom.c +0
-0
s3c24xx/mach-otom.c
index bca39f0..24e7d70 100644arch/arm/mach-s3c24xx/mach-otom.c +2
-0@@ -37,6 +37,7 @@#include <plat/devs.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -104,6 +105,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-qt2410.c +0
-0
s3c24xx/mach-qt2410.c
index 7b6ba13..b68ff2a 100644arch/arm/mach-s3c24xx/mach-qt2410.c +2
-0@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initqt2410_machine_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-rx1950.c +0
-0
s3c24xx/mach-rx1950.c
index 379fde5..fc03bb80 100644arch/arm/mach-s3c24xx/mach-rx1950.c +2
-0@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/irq.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -743,6 +744,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-rx3715.c +0
-0
s3c24xx/mach-rx3715.c
index dacbb9a..772e275 100644arch/arm/mach-s3c24xx/mach-rx3715.c +2
-0@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */ arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2410.c +0
-0
s3c24xx/mach-smdk2410.c
index 82796b9..76aa704 100644arch/arm/mach-s3c24xx/mach-smdk2410.c +2
-0@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h" @@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initsmdk2410_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2413.c +0
-0
s3c24xx/mach-smdk2413.c
index ce99fd8..128dc88 100644arch/arm/mach-s3c24xx/mach-smdk2413.c +2
-0@@ -47,6 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -107,6 +108,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initsmdk2413_machine_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2416.c +0
-0
s3c24xx/mach-smdk2416.c
index f30d7fc..ee5fcaf 100644arch/arm/mach-s3c24xx/mach-smdk2416.c +2
-0@@ -52,6 +52,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h> @@ -222,6 +223,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initsmdk2416_machine_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2440.c +0
-0
s3c24xx/mach-smdk2440.c
index b7ff882..bc443da 100644arch/arm/mach-s3c24xx/mach-smdk2440.c +2
-0@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -164,6 +165,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initsmdk2440_machine_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-smdk2443.c +0
-0
s3c24xx/mach-smdk2443.c
index 2568656..b5b128f 100644arch/arm/mach-s3c24xx/mach-smdk2443.c +2
-0@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -123,6 +124,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__initsmdk2443_machine_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-tct_hammer.c +0
-0
s3c24xx/mach-tct_hammer.c
index 495bf5c..c6351a8 100644arch/arm/mach-s3c24xx/mach-tct_hammer.c +2
-0@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h" @@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void
__inittct_hammer_init(void)arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-vr1000.c +0
-0
s3c24xx/mach-vr1000.c
index 14d5b12..0c3d863 100644arch/arm/mach-s3c24xx/mach-vr1000.c +2
-0@@ -50,6 +50,7 @@#include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -335,6 +336,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-vstms.c +0
-0
s3c24xx/mach-vstms.c
index f1d44ae..1741d00 100644arch/arm/mach-s3c24xx/mach-vstms.c +2
-1@@ -47,7 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };@@ -144,6 +144,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-anw6410.c +0
-0
s3c64xx/mach-anw6410.c
index 99e82ac..717daaa 100644arch/arm/mach-s3c64xx/mach-anw6410.c +2
-0@@ -51,6 +51,7 @@#include <plat/cpu.h> #include <mach/regs-gpio.h> #include <mach/regs-modem.h> +#include <plat/samsung-time.h> #include "common.h" @@ -209,6 +210,7 @@ static void __init anw6410_map_io(void)s3c64xx_init_io (anw6410_iodesc,ARRAY_SIZE (anw6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (anw6410_uartcfgs,ARRAY_SIZE (anw6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );anw6410_lcd_mode_set (); }arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-crag6410.c +0
-0
s3c64xx/mach-crag6410.c
index 13b7eaa..0d41166 100644arch/arm/mach-s3c64xx/mach-crag6410.c +2
-0@@ -70,6 +70,7 @@#include <plat/adc.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -704,6 +705,7 @@ static void __init crag6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (crag6410_uartcfgs,ARRAY_SIZE (crag6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* LCD type and Bypass set by bootloader */ }
arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-hmt.c +0
-0
s3c64xx/mach-hmt.c
index 2b14489..30c0424 100644arch/arm/mach-s3c64xx/mach-hmt.c +2
-0@@ -42,6 +42,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -249,6 +250,7 @@ static void __init hmt_map_io(void)s3c64xx_init_io (hmt_iodesc,ARRAY_SIZE (hmt_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (hmt_uartcfgs,ARRAY_SIZE (hmt_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init hmt_machine_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-mini6410.c +0
-0
s3c64xx/mach-mini6410.c
index 07c349c..758f5708 100644arch/arm/mach-s3c64xx/mach-mini6410.c +2
-0@@ -44,6 +44,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h" @@ -233,6 +234,7 @@ static void __init mini6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini6410_uartcfgs,ARRAY_SIZE (mini6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ arch/arm/mach-s3c64xx/mach-mini6410.c +0
-0tmp =__raw_readl (S3C64XX_SPCON );arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-ncp.c +0
-0
s3c64xx/mach-ncp.c
index e5f9a79..edfdd9f 100644arch/arm/mach-s3c64xx/mach-ncp.c +2
-0@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -88,6 +89,7 @@ static void __init ncp_map_io(void)s3c64xx_init_io (ncp_iodesc,ARRAY_SIZE (ncp_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (ncp_uartcfgs,ARRAY_SIZE (ncp_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init ncp_machine_init (void )arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-real6410.c +0
-0
s3c64xx/mach-real6410.c
index 7476f7c..dd9980d 100644arch/arm/mach-s3c64xx/mach-real6410.c +2
-0@@ -45,6 +45,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h" @@ -212,6 +213,7 @@ static void __init real6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (real6410_uartcfgs,ARRAY_SIZE (real6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ arch/arm/mach-s3c64xx/mach-real6410.c +0
-0tmp =__raw_readl (S3C64XX_SPCON );arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-smartq.c +0
-0
s3c64xx/mach-smartq.c
index c6d7390..df314f1 100644arch/arm/mach-s3c64xx/mach-smartq.c +2
-0@@ -39,6 +39,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <video/platform_lcd.h> +#include <plat/samsung-time.h> #include "common.h" @@ -378,6 +379,7 @@ void __init smartq_map_io(void)s3c64xx_init_io (smartq_iodesc,ARRAY_SIZE (smartq_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smartq_uartcfgs,ARRAY_SIZE (smartq_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );smartq_lcd_mode_set (); }arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-smartq5.c +0
-0
s3c64xx/mach-smartq5.c
index 96d6da2..1a6baf2 100644arch/arm/mach-s3c64xx/mach-smartq5.c +1
-0@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h" arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-smartq7.c +0
-0
s3c64xx/mach-smartq7.c
index 7d1167b..e193866 100644arch/arm/mach-s3c64xx/mach-smartq7.c +1
-0@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h" arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-smdk6400.c +0
-0
s3c64xx/mach-smdk6400.c
index a928fae..b2bac82 100644arch/arm/mach-s3c64xx/mach-smdk6400.c +2
-0@@ -36,6 +36,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h" @@ -67,6 +68,7 @@ static void __init smdk6400_map_io(void)s3c64xx_init_io (smdk6400_iodesc,ARRAY_SIZE (smdk6400_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6400_uartcfgs,ARRAY_SIZE (smdk6400_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static struct
platform_device*smdk6400_devices[]__initdata= {arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-smdk6410.c +0
-0
s3c64xx/mach-smdk6410.c
index da1a771..d8fe796 100644arch/arm/mach-s3c64xx/mach-smdk6410.c +2
-0@@ -73,6 +73,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <plat/keypad.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h" @@ -636,6 +637,7 @@ static void __init smdk6410_map_io(void)s3c64xx_init_io (smdk6410_iodesc,ARRAY_SIZE (smdk6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6410_uartcfgs,ARRAY_SIZE (smdk6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ arch/arm/mach-s5p64x0/Kconfig +2
-2@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PMarch/arm/mach- renamed from arch/arm/mach-s5p64x0/mach-smdk6440.c +0
-0
s5p64x0/mach-smdk6440.c
index 96ea1fe..35c3fd3 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +2
-2@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void
s5p6440_set_lcd_interface(void)arch/arm/mach- renamed from arch/arm/mach-s5p64x0/mach-smdk6450.c +0
-0
s5p64x0/mach-smdk6450.c
index 12748b6..b06fa83 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +2
-2@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void
s5p6450_set_lcd_interface(void)arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEVarch/arm/mach- renamed from arch/arm/mach-s5pv210/mach-aquila.c +0
-0
s5pv210/mach-aquila.c
index ee9fa5c..46b2842 100644arch/arm/mach-s5pv210/mach-aquila.c +2
-2@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init aquila_machine_init (void )arch/arm/mach- renamed from arch/arm/mach-s5pv210/mach-goni.c +0
-0
s5pv210/mach-goni.c
index 55e1dba..6efcc19 100644arch/arm/mach-s5pv210/mach-goni.c +2
-2@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h> @@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void __init goni_reserve (void )arch/arm/mach- renamed from arch/arm/mach-s5pv210/mach-smdkc110.c +0
-0
s5pv210/mach-smdkc110.c
index d9c99fc..213b3a3 100644arch/arm/mach-s5pv210/mach-smdkc110.c +2
-2@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h" @@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void
__initsmdkc110_reserve(void)arch/arm/mach- renamed from arch/arm/mach-s5pv210/mach-smdkv210.c +0
-0
s5pv210/mach-smdkv210.c
index 4cdb5bb..00806de 100644arch/arm/mach-s5pv210/mach-smdkv210.c +2
-2@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h> @@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); }static void
__initsmdkv210_reserve(void)arch/arm/mach- renamed from arch/arm/mach-s5pv210/mach-torbreck.c +0
-0
s5pv210/mach-torbreck.c
index 18785cb..1b01f05 100644arch/arm/mach-s5pv210/mach-torbreck.c +2
-2@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); }static void
__inittorbreck_machine_init(void)arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM helparch/arm/plat- renamed from arch/arm/plat-samsung/Makefile +0
-0samsung/Makefile
index 9e40e8d..06f2312 100644arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.oarch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ arch/arm/plat-samsung/include/plat/samsung-time.h new file +38
-0@@ -0,0 +1,51 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#ifdef CONFIG_ARCH_S3C24XX +#define TCNT_MAX 0xffff +#define TSCALER_DIV 25 +#define TDIV 50 +#define TSIZE 16 +#else
arch/arm/plat-samsung/include/plat/samsung-time.h line 48
Quoted 10 lines
arch/arm/plat-samsung/include/plat/samsung-time.h new file +10
-0+#define TCNT_MAX 0xffffffff +#define TSCALER_DIV 2 +#define TDIV 2 +#define TSIZE 32 +#endif + +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source(enum samsung_timer_mode
event,
Quoted 352 lines
arch/arm/plat-samsung/include/plat/samsung-time.h new file +3
-0+ enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ arch/arm/plat-samsung/s5p- renamed from arch/arm/plat-samsung/s5p-time.c +0
-0
time.c
deleted file mode 100644
index 028b6e8..0000000arch/arm/plat-samsung/s5p-time.c deleted +0
-308@@ -1,405 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* S5P - Common hr-timer support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#include <linux/interrupt.h> -#include <linux/irq.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/clockchips.h> -#include <linux/platform_device.h> - -#include <asm/smp_twd.h> -#include <asm/mach/time.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/sched_clock.h> - -#include <mach/map.h> -#include <plat/devs.h> -#include <plat/regs-timer.h> -#include <plat/s5p-time.h> - -static struct clk *tin_event; -static struct clk *tin_source; -static struct clk *tdiv_event; -static struct clk *tdiv_source; -static struct clk *timerclk; -static struct s5p_timer_source timer_source; -static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); - -static void s5p_time_stop (enum s5p_timer_mode mode) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon &= ~S3C2410_TCON_T0START ; -break ; - -case S5P_PWM1 : - tcon &= ~S3C2410_TCON_T1START ; -break ; - -case S5P_PWM2 : - tcon &= ~S3C2410_TCON_T2START ; -break ; - -case S5P_PWM3 : - tcon &= ~S3C2410_TCON_T3START ; -break ; - -case S5P_PWM4 : - tcon &= ~S3C2410_TCON_T4START ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_setup (enum s5p_timer_mode mode,unsigned long tcnt) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - - tcnt--; - -switch (mode) { -case S5P_PWM0 : - tcon &= ~(0x0f <<0 ); - tcon |=S3C2410_TCON_T0MANUALUPD ; -break ; - -case S5P_PWM1 : - tcon &= ~(0x0f <<8 ); - tcon |=S3C2410_TCON_T1MANUALUPD ; -break ; - -case S5P_PWM2 : - tcon &= ~(0x0f <<12 ); - tcon |=S3C2410_TCON_T2MANUALUPD ; -break ; - -case S5P_PWM3 : - tcon &= ~(0x0f <<16 ); - tcon |=S3C2410_TCON_T3MANUALUPD ; -break ; - -case S5P_PWM4 : - tcon &= ~(0x07 <<20 ); - tcon |=S3C2410_TCON_T4MANUALUPD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } - -__raw_writel (tcnt,S3C2410_TCNTB (mode)); -__raw_writel (tcnt,S3C2410_TCMPB (mode)); -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon |=S3C2410_TCON_T0START ; - tcon &= ~S3C2410_TCON_T0MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T0RELOAD ; -else - tcon &= ~S3C2410_TCON_T0RELOAD ; -break ; - -case S5P_PWM1 : - tcon |=S3C2410_TCON_T1START ; - tcon &= ~S3C2410_TCON_T1MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T1RELOAD ; -else - tcon &= ~S3C2410_TCON_T1RELOAD ; -break ; - -case S5P_PWM2 : - tcon |=S3C2410_TCON_T2START ; - tcon &= ~S3C2410_TCON_T2MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T2RELOAD ; -else - tcon &= ~S3C2410_TCON_T2RELOAD ; -break ; - -case S5P_PWM3 : - tcon |=S3C2410_TCON_T3START ; - tcon &= ~S3C2410_TCON_T3MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T3RELOAD ; -else - tcon &= ~S3C2410_TCON_T3RELOAD ; -break ; - -case S5P_PWM4 : - tcon |=S3C2410_TCON_T4START ; - tcon &= ~S3C2410_TCON_T4MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T4RELOAD ; -else - tcon &= ~S3C2410_TCON_T4RELOAD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static int s5p_set_next_event (unsigned long cycles, -struct clock_event_device *evt) -{ -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); - -return 0 ; -} - -static void s5p_set_mode (enum clock_event_mode mode, -struct clock_event_device *evt) -{ -s5p_time_stop (timer_source.event_id); - -switch (mode) { -case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); -break ; - -case CLOCK_EVT_MODE_ONESHOT : -break ; - -case CLOCK_EVT_MODE_UNUSED : -case CLOCK_EVT_MODE_SHUTDOWN : -break ; - -case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); -break ; - } -} - -static void s5p_timer_resume (void ) -{ -/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); - -/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); -} - -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) -{ - s3c_device_timer[event].dev.bus = &platform_bus_type; - s3c_device_timer[source].dev.bus = &platform_bus_type; - - timer_source.event_id = event; - timer_source.source_id = source; -} - -static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , - .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , - .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, -}; - -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) -{ -struct clock_event_device *evt = dev_id; - - evt->event_handler (evt); - -return IRQ_HANDLED ; -} - -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , - .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, - .dev_id = &time_event_device, -}; - -static void __init s5p_clockevent_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; -unsigned int irq_number; -struct clk *tscaler; - - pclk =clk_get_rate (timerclk); - - tscaler =clk_get_parent (tdiv_event); - -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); -clk_set_parent (tin_event, tdiv_event); - - clock_rate =clk_get_rate (tin_event); - clock_count_per_tick = clock_rate /HZ ; - -clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); - time_event_device.max_delta_ns = -clockevent_delta2ns (-1 , &time_event_device); - time_event_device.min_delta_ns = -clockevent_delta2ns (1 , &time_event_device); - - time_event_device.cpumask =cpumask_of (0 ); -clockevents_register_device (&time_event_device); - - irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); -} - -static void __iomem *s5p_timer_reg (void ) -{ -unsigned long offset =0 ; - -switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : - offset = (timer_source.source_id *0x0c ) +0x14 ; -break ; - -case S5P_PWM4 : - offset =0x40 ; -break ; - -default : - printk(KERN_ERR "Invalid Timer %d\n",timer_source.source_id);
arch/arm/plat-samsung/s5p-time.c deleted +0
-33-return NULL ; - } - -return S3C_TIMERREG (offset); -} - -/* -* Override the global weak sched_clock symbol with this -* local implementation which uses the clocksource to get some -* better resolution when scheduling the kernel. We accept that -* this wraps around for now, since it is just a relative time -* stamp. (Inspired by U300 implementation.) -*/ -static u32 notrace s5p_read_sched_clock(void) -{ -void __iomem *reg =s5p_timer_reg (); - -if (!reg) -return 0 ; - -return ~__raw_readl (reg); -} - -static void __init s5p_clocksource_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; - - pclk =clk_get_rate (timerclk); - -clk_set_rate (tdiv_source, pclk /2 ); -clk_set_parent (tin_source, tdiv_source); -
arch/arm/plat-samsung/s5p-time.c
Quoted 10 lines
arch/arm/plat-samsung/s5p-time.c deleted +0
-10- clock_rate =clk_get_rate (tin_source); - -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); - -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); - -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) - panic("s5p_clocksource_timer: can't register
clocksource\n");
Quoted 415 lines
arch/arm/plat-samsung/s5p-time.c deleted +0
-54-} - -static void __init s5p_timer_resources (void ) -{ - -unsigned long event_id = timer_source.event_id; -unsigned long source_id = timer_source.source_id; -char devname[15 ]; - - timerclk =clk_get (NULL ,"timers" ); -if (IS_ERR (timerclk)) -panic ("failed to get timers clock for timer" ); - -clk_enable (timerclk); - -sprintf (devname,"s3c24xx-pwm.%lu" , event_id); - s3c_device_timer[event_id].id = event_id; - s3c_device_timer[event_id].dev.init_name = devname; - - tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); -if (IS_ERR (tin_event)) -panic ("failed to get pwm-tin clock for event timer" ); - - tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_event)) -panic ("failed to get pwm-tdiv clock for event timer" ); - -clk_enable (tin_event); - -sprintf (devname,"s3c24xx-pwm.%lu" , source_id); - s3c_device_timer[source_id].id = source_id; - s3c_device_timer[source_id].dev.init_name = devname; - - tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); -if (IS_ERR (tin_source)) -panic ("failed to get pwm-tin clock for source timer" ); - - tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_source)) -panic ("failed to get pwm-tdiv clock for source timer" ); - -clk_enable (tin_source); -} - -static void __init s5p_timer_init (void ) -{ -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); -} - -struct sys_timer s5p_timer = { - .init = s5p_timer_init, -};arch/arm/plat- renamed from arch/arm/plat-samsung/samsung-time.c +0
-0
samsung/samsung-time.c
new file mode 100644
index 0000000..6d63fcaarch/arm/plat-samsung/samsung-time.c new file +73
-0@@ -0,0 +1,405 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* samsung - Common hr-timer support (s3c and s5p) +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/clockchips.h> +#include <linux/platform_device.h> + +#include <asm/smp_twd.h> +#include <asm/mach/time.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/sched_clock.h> + +#include <mach/map.h> +#include <plat/devs.h> +#include <plat/regs-timer.h> +#include <plat/samsung-time.h> + +static struct clk *tin_event; +static struct clk *tin_source; +static struct clk *tdiv_event; +static struct clk *tdiv_source; +static struct clk *timerclk; +static struct samsung_timer_source timer_source; +static unsigned long clock_count_per_tick; +static void samsung_timer_resume (void ); + +static void samsung_time_stop (enum samsung_timer_mode mode) +{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~S3C2410_TCON_T0START ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~S3C2410_TCON_T1START ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~S3C2410_TCON_T2START ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~S3C2410_TCON_T3START ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~S3C2410_TCON_T4START ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_setup(enum samsung_timer_mode mode, unsignedlong tcnt)
arch/arm/plat-samsung/samsung-time.c new file +44
-0+{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + + tcnt--; + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~(0x0f <<0 ); + tcon |=S3C2410_TCON_T0MANUALUPD ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~(0x0f <<8 ); + tcon |=S3C2410_TCON_T1MANUALUPD ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~(0x0f <<12 ); + tcon |=S3C2410_TCON_T2MANUALUPD ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~(0x0f <<16 ); + tcon |=S3C2410_TCON_T3MANUALUPD ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~(0x07 <<20 ); + tcon |=S3C2410_TCON_T4MANUALUPD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } + +__raw_writel (tcnt,S3C2410_TCNTB (mode)); +__raw_writel (tcnt,S3C2410_TCMPB (mode)); +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_start(enum samsung_timer_mode mode, boolperiodic)
arch/arm/plat-samsung/samsung-time.c new file +80
-0+{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon |=S3C2410_TCON_T0START ; + tcon &= ~S3C2410_TCON_T0MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T0RELOAD ; +else + tcon &= ~S3C2410_TCON_T0RELOAD ; +break ; + +case SAMSUNG_PWM1 : + tcon |=S3C2410_TCON_T1START ; + tcon &= ~S3C2410_TCON_T1MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T1RELOAD ; +else + tcon &= ~S3C2410_TCON_T1RELOAD ; +break ; + +case SAMSUNG_PWM2 : + tcon |=S3C2410_TCON_T2START ; + tcon &= ~S3C2410_TCON_T2MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T2RELOAD ; +else + tcon &= ~S3C2410_TCON_T2RELOAD ; +break ; + +case SAMSUNG_PWM3 : + tcon |=S3C2410_TCON_T3START ; + tcon &= ~S3C2410_TCON_T3MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T3RELOAD ; +else + tcon &= ~S3C2410_TCON_T3RELOAD ; +break ; + +case SAMSUNG_PWM4 : + tcon |=S3C2410_TCON_T4START ; + tcon &= ~S3C2410_TCON_T4MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T4RELOAD ; +else + tcon &= ~S3C2410_TCON_T4RELOAD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static int samsung_set_next_event (unsigned long cycles, +struct clock_event_device *evt) +{ +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC ); + +return 0 ; +} + +static void samsung_set_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{ +samsung_time_stop (timer_source.event_id); + +switch (mode) { +case CLOCK_EVT_MODE_PERIODIC : + samsung_time_setup(timer_source.event_id,
clock_count_per_tick);arch/arm/plat-samsung/samsung-time.c new file +111
-0+samsung_time_start (timer_source.event_id,PERIODIC ); +break ; + +case CLOCK_EVT_MODE_ONESHOT : +break ; + +case CLOCK_EVT_MODE_UNUSED : +case CLOCK_EVT_MODE_SHUTDOWN : +break ; + +case CLOCK_EVT_MODE_RESUME : +samsung_timer_resume (); +break ; + } +} + +static void samsung_timer_resume (void ) +{ +/* event timer restart */ +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); + +/* source timer restart */ +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); +} + +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) +{ + s3c_device_timer[event].dev.bus = &platform_bus_type; + s3c_device_timer[source].dev.bus = &platform_bus_type; + + timer_source.event_id = event; + timer_source.source_id = source; +} + +static struct clock_event_device time_event_device = { + .name ="samsung_event_timer" , + .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , + .rating =200 , + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, +}; + +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) +{ +struct clock_event_device *evt = dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , + .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , + .handler = samsung_clock_event_isr, + .dev_id = &time_event_device, +}; + +static void __init samsung_clockevent_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; +unsigned int irq_number; +struct clk *tscaler; + + pclk =clk_get_rate (timerclk); + + tscaler =clk_get_parent (tdiv_event); + +clk_set_rate (tscaler, pclk /TSCALER_DIV ); +clk_set_rate (tdiv_event, pclk /TDIV ); +clk_set_parent (tin_event, tdiv_event); + + clock_rate =clk_get_rate (tin_event); + clock_count_per_tick = clock_rate /HZ ; + +clockevents_calc_mult_shift (&time_event_device, + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); + time_event_device.max_delta_ns = +clockevent_delta2ns (-1 , &time_event_device); + time_event_device.min_delta_ns = +clockevent_delta2ns (1 , &time_event_device); + + time_event_device.cpumask =cpumask_of (0 ); +clockevents_register_device (&time_event_device); + + irq_number = timer_source.event_id +IRQ_TIMER0 ; +setup_irq (irq_number, &samsung_clock_event_irq); +} + +static void __iomem *samsung_timer_reg (void ) +{ +unsigned long offset =0 ; + +switch (timer_source.source_id) { +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : + offset = (timer_source.source_id *0x0c ) +0x14 ; +break ; + +case SAMSUNG_PWM4 : + offset =0x40 ; +break ; + +default : + printk(KERN_ERR "Invalid Timer %d\n",timer_source.source_id);
arch/arm/plat-samsung/samsung-time.c new file +41
-0+return NULL ; + } + +return S3C_TIMERREG (offset); +} + +/* +* Override the global weak sched_clock symbol with this +* local implementation which uses the clocksource to get some +* better resolution when scheduling the kernel. We accept that +* this wraps around for now, since it is just a relative time +* stamp. (Inspired by U300 implementation.) +*/ +static u32 notrace samsung_read_sched_clock(void) +{ +void __iomem *reg =samsung_timer_reg (); + +if (!reg) +return 0 ; + +return ~__raw_readl (reg); +} + +static void __init samsung_clocksource_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; + + pclk =clk_get_rate (timerclk); + +clk_set_rate (tdiv_source, pclk /TDIV ); +clk_set_parent (tin_source, tdiv_source); + + clock_rate =clk_get_rate (tin_source); + +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); + +setup_sched_clock (samsung_read_sched_clock,TSIZE , clock_rate); + + if (clocksource_mmio_init(samsung_timer_reg(),"
samsung_clocksource_timer",
arch/arm/plat-samsung/samsung-time.c
Quoted 1 line
arch/arm/plat-samsung/samsung-time.c new file +1
-0+ clock_rate, 250, TSIZE,
clocksource_mmio_readl_down))
Quoted 58 lines
arch/arm/plat-samsung/samsung-time.c new file +1
-0+ panic("samsung_clocksource_timer: can't registerclocksource\n");
arch/arm/plat-samsung/samsung-time.c new file +54
-1+} + +static void __init samsung_timer_resources (void ) +{ + +unsigned long event_id = timer_source.event_id; +unsigned long source_id = timer_source.source_id; +char devname[15 ]; + + timerclk =clk_get (NULL ,"timers" ); +if (IS_ERR (timerclk)) +panic ("failed to get timers clock for timer" ); + +clk_enable (timerclk); + +sprintf (devname,"s3c24xx-pwm.%lu" , event_id); + s3c_device_timer[event_id].id = event_id; + s3c_device_timer[event_id].dev.init_name = devname; + + tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); +if (IS_ERR (tin_event)) +panic ("failed to get pwm-tin clock for event timer" ); + + tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_event)) +panic ("failed to get pwm-tdiv clock for event timer" ); + +clk_enable (tin_event); + +sprintf (devname,"s3c24xx-pwm.%lu" , source_id); + s3c_device_timer[source_id].id = source_id; + s3c_device_timer[source_id].dev.init_name = devname; + + tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); +if (IS_ERR (tin_source)) +panic ("failed to get pwm-tin clock for source timer" ); + + tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_source)) +panic ("failed to get pwm-tdiv clock for source timer" ); + +clk_enable (tin_source); +} + +static void __init samsung_timer_init (void ) +{ +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); +} + +struct sys_timer samsung_timer = { + .init = samsung_timer_init, +}; --1.8.0
Romain Naour
AppliedQuoted 2 lines · Kukjin Kim
Basically, looks good to me but need to edit commit message :-)
I will correct that.
Quoted 3 lines
And since this touches many files so would be better if this could be applied early -rc not now. It can provide more time to test for many boards. Is it ok to you?
I'm ok :-)
Quoted 8 lines
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
This patch was applied to 3.7-rc1 and tested only on s3c2440 (mini2440). I could re-apply this patch for the next 3.8-rc if you prefer.
I proposed this patch because I need to have clockevent / clocksource support to use Xenomai or Linux-rt on mini2440.
Since API clockevent/clocksource is enabled, we can use High Resolution Timer and Tickless mode. This can be interesting for the Linux side too.
Most of the work is already done in s5p-time.c (renamed samsung-time.c). I add some #define for s3c24xx case.
Thank you.
Romain
Hi Romain, Kgene,
Quoted 22 lines · On Sunday 25 of November 2012 03:54:51 Romain Naour wrote:
Quoted 1 line · Kukjin Kim
Basically, looks good to me but need to edit commit message :-)
I will correct that.
Quoted 3 lines
And since this touches many files so would be better if this could be applied early -rc not now. It can provide more time to test for many boards. Is it ok to you?
I'm ok :-)
Quoted 7 lines
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.This patch was applied to 3.7-rc1 and tested only on s3c2440 (mini2440). I could re-apply this patch for the next 3.8-rc if you prefer.
Quoted 8 lines
I proposed this patch because I need to have clockevent / clocksource support to use Xenomai or Linux-rt on mini2440.
Since API clockevent/clocksource is enabled, we can use High Resolution Timer and Tickless mode. This can be interesting for the Linux side too.
Most of the work is already done in
s5p-time.c(renamedsamsung-time.c). I add some #define for s3c24xx case.
I would also suggest splitting this huge patch into a series of several smaller, possibly:
1) Rename s5p-time to samsung-time (and correct any platforms using it currently)
2) Add samsung-time support for s3c24xx
3) Add samsung-time support for s3c64xx
What do you think?
Best regards,
Tomasz Figa
PATCH 1/3 Rename s5p-time to samsung-time
In reply to Romain NaourHi Tomasz, Kgene
Quoted 8 lines
I would also suggest splitting this huge patch into a series of several smaller, possibly:
1) Rename s5p-time to samsung-time (and correct any platforms using it currently)
2) Add samsung-time support for s3c24xx
3) Add samsung-time support for s3c64xx
Quoted 5 lines
What do you think?
Best regards,
Tomasz Figa
I have separated the patch into three parts, as you said. And also, I corrected some oversights ;-)
These patches are for 3.7-rc6.
Here is the first one:
This patch rename s5p-time to samsung-time.
There is no functional change.
--- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 40 +++ arch/arm/plat-samsung/s5p-time.c | 405 ---------------------- arch/arm/plat-samsung/samsung-time.c | 405 ++++++++++++++++++++++ 17 files changed, 475 insertions(+), 475 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.c
arch/arm/mach-exynos/Kconfig +1 -1
@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference
arch/arm/mach-exynos/mach-universal_c210.c +3 -3
@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h>
@@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )
@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END
arch/arm/mach-s5p64x0/Kconfig +2 -2
@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
arch/arm/mach-s5p64x0/mach-smdk6440.c +3 -3
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )
@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5p64x0/mach-smdk6450.c +3 -3
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )
@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5pv210/Kconfig +1 -1
@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV
arch/arm/mach-s5pv210/mach-aquila.c +3 -3
@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )
@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-goni.c +3 -3
@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h>
@@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )
@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkc110.c +3 -3
@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h"
@@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )
@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkv210.c +3 -3
@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h>
@@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )
@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-torbreck.c +3 -3
@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )
@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/plat-samsung/Kconfig +1 -1
@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help
arch/arm/plat-samsung/Makefile +1 -1
@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o
arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */
arch/arm/plat-samsung/include/plat/samsung-time.h new file +40 -0
@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */
arch/arm/plat-samsung/s5p-time.c deleted +0 -405
405 lines not on this page · raw message
arch/arm/plat-samsung/samsung-time.c new file +405 -0
405 lines not on this page · raw message
Re: [PATCH 1/3] Rename s5p-time to samsung-time
Hi Romain,
Am Mittwoch, 28. November 2012, 00:27:36 schrieb Romain Naour:
Quoted 14 lines
Hi Tomasz, Kgene
Quoted 11 lines
I would also suggest splitting this huge patch into a series of several smaller, possibly:
1) Rename s5p-time to samsung-time (and correct any platforms using it currently)
2) Add samsung-time support for s3c24xx
3) Add samsung-time support for s3c64xxWhat do you think?
Best regards,
Tomasz Figa
Quoted 6 lines
I have separated the patch into three parts, as you said. And also, I corrected some oversights ;-)
These patches are for 3.7-rc6.
Here is the first one:
Comments like this should either be in the comment section (below the three dashes) or in a cover-letter (git format-patch --cover-letter), but not in the commit message of the patch itself.
Otherwise the patches look very cool. Hopefully I'll find a bit of time to test them tomorrow.
But I do have some quick comments:
What happens to s3c24xx_timer? It seems you changed every user of it but did not remove the old timer code. Might be interesting as a 4th patch, or is it still used somewhere?
Please use the -M option to "git format-patch" which minimizes the impact of moved files in the patch itself.
Thanks for doing this change
Heiko
Quoted 1,262 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>--- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 40 +++ arch/arm/plat-samsung/s5p-time.c | 405 ---------------------- arch/arm/plat-samsung/samsung-time.c | 405 ++++++++++++++++++++++ 17 files changed, 475 insertions(+), 475 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.carch/arm/mach-exynos/Kconfig +1
-1@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference(quoted diff) +0
-0
b/arch/arm/mach-exynos/mach-universal_c210.cindex ebc9dd3..325bfe9 100644arch/arm/mach-exynos/mach-universal_c210.c +3
-3@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h> @@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END arch/arm/mach-s5p64x0/Kconfig +2
-2@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM(quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6440.cindex 96ea1fe..587fec5 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6450.cindex 12748b6..714cd8a 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-aquila.cindex ee9fa5c..7c7d89b 100644arch/arm/mach-s5pv210/mach-aquila.c +3
-3@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-goni.cindex 55e1dba..2740001 100644arch/arm/mach-s5pv210/mach-goni.c +3
-3@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h> @@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkc110.cindex d9c99fc..d2e93b7 100644arch/arm/mach-s5pv210/mach-smdkc110.c +3
-3@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h" @@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkv210.cindex 4cdb5bb..cd28725 100644arch/arm/mach-s5pv210/mach-smdkv210.c +3
-3@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h> @@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-torbreck.cindex 18785cb..aec668c 100644arch/arm/mach-s5pv210/mach-torbreck.c +3
-3@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile index 9e40e8d..06f2312 100644
arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/s5p-time.hdeleted file mode 100644 index 3a70aeb..0000000arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hnew file mode 100644 index 0000000..9d6d622arch/arm/plat-samsung/include/plat/samsung-time.h new file +40
-0@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/s5p-time.cdeleted file mode 100644 index 028b6e8..0000000arch/arm/plat-samsung/s5p-time.c deleted +0
-405@@ -1,405 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* S5P - Common hr-timer support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#include <linux/interrupt.h> -#include <linux/irq.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/clockchips.h> -#include <linux/platform_device.h> - -#include <asm/smp_twd.h> -#include <asm/mach/time.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/sched_clock.h> - -#include <mach/map.h> -#include <plat/devs.h> -#include <plat/regs-timer.h> -#include <plat/s5p-time.h> - -static struct clk *tin_event; -static struct clk *tin_source; -static struct clk *tdiv_event; -static struct clk *tdiv_source; -static struct clk *timerclk; -static struct s5p_timer_source timer_source; -static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); - -static void s5p_time_stop (enum s5p_timer_mode mode) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon &= ~S3C2410_TCON_T0START ; -break ; - -case S5P_PWM1 : - tcon &= ~S3C2410_TCON_T1START ; -break ; - -case S5P_PWM2 : - tcon &= ~S3C2410_TCON_T2START ; -break ; - -case S5P_PWM3 : - tcon &= ~S3C2410_TCON_T3START ; -break ; - -case S5P_PWM4 : - tcon &= ~S3C2410_TCON_T4START ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_setup (enum s5p_timer_mode mode,unsigned long tcnt) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - - tcnt--; - -switch (mode) { -case S5P_PWM0 : - tcon &= ~(0x0f <<0 ); - tcon |=S3C2410_TCON_T0MANUALUPD ; -break ; - -case S5P_PWM1 : - tcon &= ~(0x0f <<8 ); - tcon |=S3C2410_TCON_T1MANUALUPD ; -break ; - -case S5P_PWM2 : - tcon &= ~(0x0f <<12 ); - tcon |=S3C2410_TCON_T2MANUALUPD ; -break ; - -case S5P_PWM3 : - tcon &= ~(0x0f <<16 ); - tcon |=S3C2410_TCON_T3MANUALUPD ; -break ; - -case S5P_PWM4 : - tcon &= ~(0x07 <<20 ); - tcon |=S3C2410_TCON_T4MANUALUPD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } - -__raw_writel (tcnt,S3C2410_TCNTB (mode)); -__raw_writel (tcnt,S3C2410_TCMPB (mode)); -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon |=S3C2410_TCON_T0START ; - tcon &= ~S3C2410_TCON_T0MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T0RELOAD ; -else - tcon &= ~S3C2410_TCON_T0RELOAD ; -break ; - -case S5P_PWM1 : - tcon |=S3C2410_TCON_T1START ; - tcon &= ~S3C2410_TCON_T1MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T1RELOAD ; -else - tcon &= ~S3C2410_TCON_T1RELOAD ; -break ; - -case S5P_PWM2 : - tcon |=S3C2410_TCON_T2START ; - tcon &= ~S3C2410_TCON_T2MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T2RELOAD ; -else - tcon &= ~S3C2410_TCON_T2RELOAD ; -break ; - -case S5P_PWM3 : - tcon |=S3C2410_TCON_T3START ; - tcon &= ~S3C2410_TCON_T3MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T3RELOAD ; -else - tcon &= ~S3C2410_TCON_T3RELOAD ; -break ; - -case S5P_PWM4 : - tcon |=S3C2410_TCON_T4START ; - tcon &= ~S3C2410_TCON_T4MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T4RELOAD ; -else - tcon &= ~S3C2410_TCON_T4RELOAD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static int s5p_set_next_event (unsigned long cycles, -struct clock_event_device *evt) -{ -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); - -return 0 ; -} - -static void s5p_set_mode (enum clock_event_mode mode, -struct clock_event_device *evt) -{ -s5p_time_stop (timer_source.event_id); - -switch (mode) { -case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); -break ; - -case CLOCK_EVT_MODE_ONESHOT : -break ; - -case CLOCK_EVT_MODE_UNUSED : -case CLOCK_EVT_MODE_SHUTDOWN : -break ; - -case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); -break ; - } -} - -static void s5p_timer_resume (void ) -{ -/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); - -/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); -} - -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) -{ - s3c_device_timer[event].dev.bus = &platform_bus_type; - s3c_device_timer[source].dev.bus = &platform_bus_type; - - timer_source.event_id = event; - timer_source.source_id = source; -} - -static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , - .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , - .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, -}; - -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) -{ -struct clock_event_device *evt = dev_id; - - evt->event_handler (evt); - -return IRQ_HANDLED ; -} - -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , - .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, - .dev_id = &time_event_device, -}; - -static void __init s5p_clockevent_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; -unsigned int irq_number; -struct clk *tscaler; - - pclk =clk_get_rate (timerclk); - - tscaler =clk_get_parent (tdiv_event); - -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); -clk_set_parent (tin_event, tdiv_event); - - clock_rate =clk_get_rate (tin_event); - clock_count_per_tick = clock_rate /HZ ; - -clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); - time_event_device.max_delta_ns = -clockevent_delta2ns (-1 , &time_event_device); - time_event_device.min_delta_ns = -clockevent_delta2ns (1 , &time_event_device); - - time_event_device.cpumask =cpumask_of (0 ); -clockevents_register_device (&time_event_device); - - irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); -} - -static void __iomem *s5p_timer_reg (void ) -{ -unsigned long offset =0 ; - -switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : - offset = (timer_source.source_id *0x0c ) +0x14 ; -break ; - -case S5P_PWM4 : - offset =0x40 ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); -return NULL ; - } - -return S3C_TIMERREG (offset); -} - -/* -* Override the global weak sched_clock symbol with this -* local implementation which uses the clocksource to get some -* better resolution when scheduling the kernel. We accept that -* this wraps around for now, since it is just a relative time -* stamp. (Inspired by U300 implementation.) -*/ -static u32 notrace s5p_read_sched_clock(void) -{ -void __iomem *reg =s5p_timer_reg (); - -if (!reg) -return 0 ; - -return ~__raw_readl (reg); -} - -static void __init s5p_clocksource_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; - - pclk =clk_get_rate (timerclk); - -clk_set_rate (tdiv_source, pclk /2 ); -clk_set_parent (tin_source, tdiv_source); - - clock_rate =clk_get_rate (tin_source); - -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); - -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); - -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) -panic ("s5p_clocksource_timer: can't register clocksource\n" ); -} - -static void __init s5p_timer_resources (void ) -{ - -unsigned long event_id = timer_source.event_id; -unsigned long source_id = timer_source.source_id; -char devname[15 ]; - - timerclk =clk_get (NULL ,"timers" ); -if (IS_ERR (timerclk)) -panic ("failed to get timers clock for timer" ); - -clk_enable (timerclk); - -sprintf (devname,"s3c24xx-pwm.%lu" , event_id); - s3c_device_timer[event_id].id = event_id; - s3c_device_timer[event_id].dev.init_name = devname; - - tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); -if (IS_ERR (tin_event)) -panic ("failed to get pwm-tin clock for event timer" ); - - tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_event)) -panic ("failed to get pwm-tdiv clock for event timer" ); - -clk_enable (tin_event); - -sprintf (devname,"s3c24xx-pwm.%lu" , source_id); - s3c_device_timer[source_id].id = source_id; - s3c_device_timer[source_id].dev.init_name = devname; - - tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); -if (IS_ERR (tin_source)) -panic ("failed to get pwm-tin clock for source timer" ); - - tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_source)) -panic ("failed to get pwm-tdiv clock for source timer" ); - -clk_enable (tin_source); -} - -static void __init s5p_timer_init (void ) -{ -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); -} - -struct sys_timer s5p_timer = { - .init = s5p_timer_init, -};(quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.cnew file mode 100644 index 0000000..91773bfarch/arm/plat-samsung/samsung-time.c new file +73
-0@@ -0,0 +1,405 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* SAMSUNG - Common hr-timer support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/clockchips.h> +#include <linux/platform_device.h> + +#include <asm/smp_twd.h> +#include <asm/mach/time.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/sched_clock.h> + +#include <mach/map.h> +#include <plat/devs.h> +#include <plat/regs-timer.h> +#include <plat/samsung-time.h> + +static struct clk *tin_event; +static struct clk *tin_source; +static struct clk *tdiv_event; +static struct clk *tdiv_source; +static struct clk *timerclk; +static struct samsung_timer_source timer_source; +static unsigned long clock_count_per_tick; +static void samsung_timer_resume (void ); + +static void samsung_time_stop (enum samsung_timer_mode mode) +{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~S3C2410_TCON_T0START ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~S3C2410_TCON_T1START ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~S3C2410_TCON_T2START ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~S3C2410_TCON_T3START ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~S3C2410_TCON_T4START ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_setup(enum samsung_timer_mode mode, unsigned longtcnt) +{
arch/arm/plat-samsung/samsung-time.c new file +43
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + + tcnt--; + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~(0x0f <<0 ); + tcon |=S3C2410_TCON_T0MANUALUPD ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~(0x0f <<8 ); + tcon |=S3C2410_TCON_T1MANUALUPD ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~(0x0f <<12 ); + tcon |=S3C2410_TCON_T2MANUALUPD ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~(0x0f <<16 ); + tcon |=S3C2410_TCON_T3MANUALUPD ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~(0x07 <<20 ); + tcon |=S3C2410_TCON_T4MANUALUPD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } + +__raw_writel (tcnt,S3C2410_TCNTB (mode)); +__raw_writel (tcnt,S3C2410_TCMPB (mode)); +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_start(enum samsung_timer_mode mode, boolperiodic) +{
arch/arm/plat-samsung/samsung-time.c new file +231
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon |=S3C2410_TCON_T0START ; + tcon &= ~S3C2410_TCON_T0MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T0RELOAD ; +else + tcon &= ~S3C2410_TCON_T0RELOAD ; +break ; + +case SAMSUNG_PWM1 : + tcon |=S3C2410_TCON_T1START ; + tcon &= ~S3C2410_TCON_T1MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T1RELOAD ; +else + tcon &= ~S3C2410_TCON_T1RELOAD ; +break ; + +case SAMSUNG_PWM2 : + tcon |=S3C2410_TCON_T2START ; + tcon &= ~S3C2410_TCON_T2MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T2RELOAD ; +else + tcon &= ~S3C2410_TCON_T2RELOAD ; +break ; + +case SAMSUNG_PWM3 : + tcon |=S3C2410_TCON_T3START ; + tcon &= ~S3C2410_TCON_T3MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T3RELOAD ; +else + tcon &= ~S3C2410_TCON_T3RELOAD ; +break ; + +case SAMSUNG_PWM4 : + tcon |=S3C2410_TCON_T4START ; + tcon &= ~S3C2410_TCON_T4MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T4RELOAD ; +else + tcon &= ~S3C2410_TCON_T4RELOAD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static int samsung_set_next_event (unsigned long cycles, +struct clock_event_device *evt) +{ +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC ); + +return 0 ; +} + +static void samsung_set_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{ +samsung_time_stop (timer_source.event_id); + +switch (mode) { +case CLOCK_EVT_MODE_PERIODIC : +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); +break ; + +case CLOCK_EVT_MODE_ONESHOT : +break ; + +case CLOCK_EVT_MODE_UNUSED : +case CLOCK_EVT_MODE_SHUTDOWN : +break ; + +case CLOCK_EVT_MODE_RESUME : +samsung_timer_resume (); +break ; + } +} + +static void samsung_timer_resume (void ) +{ +/* event timer restart */ +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); + +/* source timer restart */ +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); +} + +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) +{ + s3c_device_timer[event].dev.bus = &platform_bus_type; + s3c_device_timer[source].dev.bus = &platform_bus_type; + + timer_source.event_id = event; + timer_source.source_id = source; +} + +static struct clock_event_device time_event_device = { + .name ="samsung_event_timer" , + .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , + .rating =200 , + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, +}; + +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) +{ +struct clock_event_device *evt = dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , + .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , + .handler = samsung_clock_event_isr, + .dev_id = &time_event_device, +}; + +static void __init samsung_clockevent_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; +unsigned int irq_number; +struct clk *tscaler; + + pclk =clk_get_rate (timerclk); + + tscaler =clk_get_parent (tdiv_event); + +clk_set_rate (tscaler, pclk /2 ); +clk_set_rate (tdiv_event, pclk /2 ); +clk_set_parent (tin_event, tdiv_event); + + clock_rate =clk_get_rate (tin_event); + clock_count_per_tick = clock_rate /HZ ; + +clockevents_calc_mult_shift (&time_event_device, + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); + time_event_device.max_delta_ns = +clockevent_delta2ns (-1 , &time_event_device); + time_event_device.min_delta_ns = +clockevent_delta2ns (1 , &time_event_device); + + time_event_device.cpumask =cpumask_of (0 ); +clockevents_register_device (&time_event_device); + + irq_number = timer_source.event_id +IRQ_TIMER0 ; +setup_irq (irq_number, &samsung_clock_event_irq); +} + +static void __iomem *samsung_timer_reg (void ) +{ +unsigned long offset =0 ; + +switch (timer_source.source_id) { +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : + offset = (timer_source.source_id *0x0c ) +0x14 ; +break ; + +case SAMSUNG_PWM4 : + offset =0x40 ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); +return NULL ; + } + +return S3C_TIMERREG (offset); +} + +/* +* Override the global weak sched_clock symbol with this +* local implementation which uses the clocksource to get some +* better resolution when scheduling the kernel. We accept that +* this wraps around for now, since it is just a relative time +* stamp. (Inspired by U300 implementation.) +*/ +static u32 notrace samsung_read_sched_clock(void) +{ +void __iomem *reg =samsung_timer_reg (); + +if (!reg) +return 0 ; + +return ~__raw_readl (reg); +} + +static void __init samsung_clocksource_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; + + pclk =clk_get_rate (timerclk); + +clk_set_rate (tdiv_source, pclk /2 ); +clk_set_parent (tin_source, tdiv_source); + + clock_rate =clk_get_rate (tin_source); + +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); + +setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); + + if (clocksource_mmio_init(samsung_timer_reg(),"
samsung_clocksource_timer", +clock_rate, 250, 32,clocksource_mmio_readl_down))arch/arm/plat-samsung/samsung-time.c new file +55
-0+panic ("samsung_clocksource_timer: can't register clocksource\n" ); +} + +static void __init samsung_timer_resources (void ) +{ + +unsigned long event_id = timer_source.event_id; +unsigned long source_id = timer_source.source_id; +char devname[15 ]; + + timerclk =clk_get (NULL ,"timers" ); +if (IS_ERR (timerclk)) +panic ("failed to get timers clock for timer" ); + +clk_enable (timerclk); + +sprintf (devname,"s3c24xx-pwm.%lu" , event_id); + s3c_device_timer[event_id].id = event_id; + s3c_device_timer[event_id].dev.init_name = devname; + + tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); +if (IS_ERR (tin_event)) +panic ("failed to get pwm-tin clock for event timer" ); + + tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_event)) +panic ("failed to get pwm-tdiv clock for event timer" ); + +clk_enable (tin_event); + +sprintf (devname,"s3c24xx-pwm.%lu" , source_id); + s3c_device_timer[source_id].id = source_id; + s3c_device_timer[source_id].dev.init_name = devname; + + tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); +if (IS_ERR (tin_source)) +panic ("failed to get pwm-tin clock for source timer" ); + + tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_source)) +panic ("failed to get pwm-tdiv clock for source timer" ); + +clk_enable (tin_source); +} + +static void __init samsung_timer_init (void ) +{ +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); +} + +struct sys_timer samsung_timer = { + .init = samsung_timer_init, +};
Re: [PATCH 1/3] Rename s5p-time to samsung-time
Hi Heiko,
Quoted 20 lines · Heiko Stübner
Hi Romain,
Am Mittwoch, 28. November 2012, 00:27:36 schrieb Romain Naour:
Quoted 17 lines
Hi Tomasz, Kgene
Quoted 11 lines
I would also suggest splitting this huge patch into a series of several smaller, possibly:
1) Rename s5p-time to samsung-time (and correct any platforms using it currently)
2) Add samsung-time support for s3c24xx
3) Add samsung-time support for s3c64xxWhat do you think?
Best regards,
Tomasz FigaI have separated the patch into three parts, as you said. And also, I corrected some oversights ;-)
Quoted 8 lines
Quoted 3 lines
These patches are for 3.7-rc6.
Here is the first one:
Comments like this should either be in the comment section (below the three dashes) or in a cover-letter (git format-patch --cover-letter), but not in the commit message of the patch itself.
Thank you for your advice :)
Quoted 3 lines
Otherwise the patches look very cool. Hopefully I'll find a bit of time to test them tomorrow.
On which processor can you test these patches ?
Quoted 6 lines
But I do have some quick comments:
What happens to
s3c24xx_timer? It seems you changed every user of it but did not remove the old timer code. Might be interesting as a 4th patch, or is it still used somewhere?
s3c24xx_timer is still used by s5pc100 CPUs.
That's why I didn't remove plat-samsung/time.c
I do not have the datasheet, but s5pc100 timers seem to be similar to s3c24xx timers. (16bis) Can someone test on a processor s5pc100 ?
Quoted 4 lines
Please use the -M option to "git format-patch" which minimizes the impact of moved files in the patch itself.
Do you want I resends these patches, plus one for s5pc100 ?
Quoted 4 lines
Thanks for doing this change
Heiko
Thank you for your comments :)
Romain
Quoted 1,264 lines
Quoted 1,263 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>--- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 40 +++ arch/arm/plat-samsung/s5p-time.c | 405 ---------------------- arch/arm/plat-samsung/samsung-time.c | 405 ++++++++++++++++++++++ 17 files changed, 475 insertions(+), 475 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.carch/arm/mach-exynos/Kconfig +1
-1@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference(quoted diff) +0
-0
b/arch/arm/mach-exynos/mach-universal_c210.cindex ebc9dd3..325bfe9 100644arch/arm/mach-exynos/mach-universal_c210.c +3
-3@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h> @@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END arch/arm/mach-s5p64x0/Kconfig +2
-2@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM(quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6440.cindex 96ea1fe..587fec5 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6450.cindex 12748b6..714cd8a 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-aquila.cindex ee9fa5c..7c7d89b 100644arch/arm/mach-s5pv210/mach-aquila.c +3
-3@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-goni.cindex 55e1dba..2740001 100644arch/arm/mach-s5pv210/mach-goni.c +3
-3@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h> @@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkc110.cindex d9c99fc..d2e93b7 100644arch/arm/mach-s5pv210/mach-smdkc110.c +3
-3@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h" @@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkv210.cindex 4cdb5bb..cd28725 100644arch/arm/mach-s5pv210/mach-smdkv210.c +3
-3@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h> @@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-torbreck.cindex 18785cb..aec668c 100644arch/arm/mach-s5pv210/mach-torbreck.c +3
-3@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile index 9e40e8d..06f2312 100644
arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/s5p-time.hdeleted file mode 100644 index 3a70aeb..0000000arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hnew file mode 100644 index 0000000..9d6d622arch/arm/plat-samsung/include/plat/samsung-time.h new file +40
-0@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/s5p-time.cdeleted file mode 100644 index 028b6e8..0000000arch/arm/plat-samsung/s5p-time.c deleted +0
-405@@ -1,405 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* S5P - Common hr-timer support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#include <linux/interrupt.h> -#include <linux/irq.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/clockchips.h> -#include <linux/platform_device.h> - -#include <asm/smp_twd.h> -#include <asm/mach/time.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/sched_clock.h> - -#include <mach/map.h> -#include <plat/devs.h> -#include <plat/regs-timer.h> -#include <plat/s5p-time.h> - -static struct clk *tin_event; -static struct clk *tin_source; -static struct clk *tdiv_event; -static struct clk *tdiv_source; -static struct clk *timerclk; -static struct s5p_timer_source timer_source; -static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); - -static void s5p_time_stop (enum s5p_timer_mode mode) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon &= ~S3C2410_TCON_T0START ; -break ; - -case S5P_PWM1 : - tcon &= ~S3C2410_TCON_T1START ; -break ; - -case S5P_PWM2 : - tcon &= ~S3C2410_TCON_T2START ; -break ; - -case S5P_PWM3 : - tcon &= ~S3C2410_TCON_T3START ; -break ; - -case S5P_PWM4 : - tcon &= ~S3C2410_TCON_T4START ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_setup (enum s5p_timer_mode mode,unsigned long tcnt) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - - tcnt--; - -switch (mode) { -case S5P_PWM0 : - tcon &= ~(0x0f <<0 ); - tcon |=S3C2410_TCON_T0MANUALUPD ; -break ; - -case S5P_PWM1 : - tcon &= ~(0x0f <<8 ); - tcon |=S3C2410_TCON_T1MANUALUPD ; -break ; - -case S5P_PWM2 : - tcon &= ~(0x0f <<12 ); - tcon |=S3C2410_TCON_T2MANUALUPD ; -break ; - -case S5P_PWM3 : - tcon &= ~(0x0f <<16 ); - tcon |=S3C2410_TCON_T3MANUALUPD ; -break ; - -case S5P_PWM4 : - tcon &= ~(0x07 <<20 ); - tcon |=S3C2410_TCON_T4MANUALUPD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } - -__raw_writel (tcnt,S3C2410_TCNTB (mode)); -__raw_writel (tcnt,S3C2410_TCMPB (mode)); -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon |=S3C2410_TCON_T0START ; - tcon &= ~S3C2410_TCON_T0MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T0RELOAD ; -else - tcon &= ~S3C2410_TCON_T0RELOAD ; -break ; - -case S5P_PWM1 : - tcon |=S3C2410_TCON_T1START ; - tcon &= ~S3C2410_TCON_T1MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T1RELOAD ; -else - tcon &= ~S3C2410_TCON_T1RELOAD ; -break ; - -case S5P_PWM2 : - tcon |=S3C2410_TCON_T2START ; - tcon &= ~S3C2410_TCON_T2MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T2RELOAD ; -else - tcon &= ~S3C2410_TCON_T2RELOAD ; -break ; - -case S5P_PWM3 : - tcon |=S3C2410_TCON_T3START ; - tcon &= ~S3C2410_TCON_T3MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T3RELOAD ; -else - tcon &= ~S3C2410_TCON_T3RELOAD ; -break ; - -case S5P_PWM4 : - tcon |=S3C2410_TCON_T4START ; - tcon &= ~S3C2410_TCON_T4MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T4RELOAD ; -else - tcon &= ~S3C2410_TCON_T4RELOAD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static int s5p_set_next_event (unsigned long cycles, -struct clock_event_device *evt) -{ -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); - -return 0 ; -} - -static void s5p_set_mode (enum clock_event_mode mode, -struct clock_event_device *evt) -{ -s5p_time_stop (timer_source.event_id); - -switch (mode) { -case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); -break ; - -case CLOCK_EVT_MODE_ONESHOT : -break ; - -case CLOCK_EVT_MODE_UNUSED : -case CLOCK_EVT_MODE_SHUTDOWN : -break ; - -case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); -break ; - } -} - -static void s5p_timer_resume (void ) -{ -/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); - -/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); -} - -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) -{ - s3c_device_timer[event].dev.bus = &platform_bus_type; - s3c_device_timer[source].dev.bus = &platform_bus_type; - - timer_source.event_id = event; - timer_source.source_id = source; -} - -static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , - .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , - .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, -}; - -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) -{ -struct clock_event_device *evt = dev_id; - - evt->event_handler (evt); - -return IRQ_HANDLED ; -} - -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , - .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, - .dev_id = &time_event_device, -}; - -static void __init s5p_clockevent_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; -unsigned int irq_number; -struct clk *tscaler; - - pclk =clk_get_rate (timerclk); - - tscaler =clk_get_parent (tdiv_event); - -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); -clk_set_parent (tin_event, tdiv_event); - - clock_rate =clk_get_rate (tin_event); - clock_count_per_tick = clock_rate /HZ ; - -clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); - time_event_device.max_delta_ns = -clockevent_delta2ns (-1 , &time_event_device); - time_event_device.min_delta_ns = -clockevent_delta2ns (1 , &time_event_device); - - time_event_device.cpumask =cpumask_of (0 ); -clockevents_register_device (&time_event_device); - - irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); -} - -static void __iomem *s5p_timer_reg (void ) -{ -unsigned long offset =0 ; - -switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : - offset = (timer_source.source_id *0x0c ) +0x14 ; -break ; - -case S5P_PWM4 : - offset =0x40 ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); -return NULL ; - } - -return S3C_TIMERREG (offset); -} - -/* -* Override the global weak sched_clock symbol with this -* local implementation which uses the clocksource to get some -* better resolution when scheduling the kernel. We accept that -* this wraps around for now, since it is just a relative time -* stamp. (Inspired by U300 implementation.) -*/ -static u32 notrace s5p_read_sched_clock(void) -{ -void __iomem *reg =s5p_timer_reg (); - -if (!reg) -return 0 ; - -return ~__raw_readl (reg); -} - -static void __init s5p_clocksource_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; - - pclk =clk_get_rate (timerclk); - -clk_set_rate (tdiv_source, pclk /2 ); -clk_set_parent (tin_source, tdiv_source); - - clock_rate =clk_get_rate (tin_source); - -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); - -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); - -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) -panic ("s5p_clocksource_timer: can't register clocksource\n" ); -} - -static void __init s5p_timer_resources (void ) -{ - -unsigned long event_id = timer_source.event_id; -unsigned long source_id = timer_source.source_id; -char devname[15 ]; - - timerclk =clk_get (NULL ,"timers" ); -if (IS_ERR (timerclk)) -panic ("failed to get timers clock for timer" ); - -clk_enable (timerclk); - -sprintf (devname,"s3c24xx-pwm.%lu" , event_id); - s3c_device_timer[event_id].id = event_id; - s3c_device_timer[event_id].dev.init_name = devname; - - tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); -if (IS_ERR (tin_event)) -panic ("failed to get pwm-tin clock for event timer" ); - - tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_event)) -panic ("failed to get pwm-tdiv clock for event timer" ); - -clk_enable (tin_event); - -sprintf (devname,"s3c24xx-pwm.%lu" , source_id); - s3c_device_timer[source_id].id = source_id; - s3c_device_timer[source_id].dev.init_name = devname; - - tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); -if (IS_ERR (tin_source)) -panic ("failed to get pwm-tin clock for source timer" ); - - tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_source)) -panic ("failed to get pwm-tdiv clock for source timer" ); - -clk_enable (tin_source); -} - -static void __init s5p_timer_init (void ) -{ -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); -} - -struct sys_timer s5p_timer = { - .init = s5p_timer_init, -};(quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.cnew file mode 100644 index 0000000..91773bfarch/arm/plat-samsung/samsung-time.c new file +73
-0@@ -0,0 +1,405 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* SAMSUNG - Common hr-timer support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/clockchips.h> +#include <linux/platform_device.h> + +#include <asm/smp_twd.h> +#include <asm/mach/time.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/sched_clock.h> + +#include <mach/map.h> +#include <plat/devs.h> +#include <plat/regs-timer.h> +#include <plat/samsung-time.h> + +static struct clk *tin_event; +static struct clk *tin_source; +static struct clk *tdiv_event; +static struct clk *tdiv_source; +static struct clk *timerclk; +static struct samsung_timer_source timer_source; +static unsigned long clock_count_per_tick; +static void samsung_timer_resume (void ); + +static void samsung_time_stop (enum samsung_timer_mode mode) +{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~S3C2410_TCON_T0START ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~S3C2410_TCON_T1START ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~S3C2410_TCON_T2START ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~S3C2410_TCON_T3START ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~S3C2410_TCON_T4START ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_setup(enum samsung_timer_mode mode, unsigned longtcnt) +{
arch/arm/plat-samsung/samsung-time.c new file +43
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + + tcnt--; + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~(0x0f <<0 ); + tcon |=S3C2410_TCON_T0MANUALUPD ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~(0x0f <<8 ); + tcon |=S3C2410_TCON_T1MANUALUPD ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~(0x0f <<12 ); + tcon |=S3C2410_TCON_T2MANUALUPD ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~(0x0f <<16 ); + tcon |=S3C2410_TCON_T3MANUALUPD ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~(0x07 <<20 ); + tcon |=S3C2410_TCON_T4MANUALUPD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } + +__raw_writel (tcnt,S3C2410_TCNTB (mode)); +__raw_writel (tcnt,S3C2410_TCMPB (mode)); +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_start(enum samsung_timer_mode mode, boolperiodic) +{
arch/arm/plat-samsung/samsung-time.c new file +231
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon |=S3C2410_TCON_T0START ; + tcon &= ~S3C2410_TCON_T0MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T0RELOAD ; +else + tcon &= ~S3C2410_TCON_T0RELOAD ; +break ; + +case SAMSUNG_PWM1 : + tcon |=S3C2410_TCON_T1START ; + tcon &= ~S3C2410_TCON_T1MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T1RELOAD ; +else + tcon &= ~S3C2410_TCON_T1RELOAD ; +break ; + +case SAMSUNG_PWM2 : + tcon |=S3C2410_TCON_T2START ; + tcon &= ~S3C2410_TCON_T2MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T2RELOAD ; +else + tcon &= ~S3C2410_TCON_T2RELOAD ; +break ; + +case SAMSUNG_PWM3 : + tcon |=S3C2410_TCON_T3START ; + tcon &= ~S3C2410_TCON_T3MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T3RELOAD ; +else + tcon &= ~S3C2410_TCON_T3RELOAD ; +break ; + +case SAMSUNG_PWM4 : + tcon |=S3C2410_TCON_T4START ; + tcon &= ~S3C2410_TCON_T4MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T4RELOAD ; +else + tcon &= ~S3C2410_TCON_T4RELOAD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static int samsung_set_next_event (unsigned long cycles, +struct clock_event_device *evt) +{ +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC ); + +return 0 ; +} + +static void samsung_set_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{ +samsung_time_stop (timer_source.event_id); + +switch (mode) { +case CLOCK_EVT_MODE_PERIODIC : +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); +break ; + +case CLOCK_EVT_MODE_ONESHOT : +break ; + +case CLOCK_EVT_MODE_UNUSED : +case CLOCK_EVT_MODE_SHUTDOWN : +break ; + +case CLOCK_EVT_MODE_RESUME : +samsung_timer_resume (); +break ; + } +} + +static void samsung_timer_resume (void ) +{ +/* event timer restart */ +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); + +/* source timer restart */ +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); +} + +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) +{ + s3c_device_timer[event].dev.bus = &platform_bus_type; + s3c_device_timer[source].dev.bus = &platform_bus_type; + + timer_source.event_id = event; + timer_source.source_id = source; +} + +static struct clock_event_device time_event_device = { + .name ="samsung_event_timer" , + .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , + .rating =200 , + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, +}; + +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) +{ +struct clock_event_device *evt = dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , + .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , + .handler = samsung_clock_event_isr, + .dev_id = &time_event_device, +}; + +static void __init samsung_clockevent_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; +unsigned int irq_number; +struct clk *tscaler; + + pclk =clk_get_rate (timerclk); + + tscaler =clk_get_parent (tdiv_event); + +clk_set_rate (tscaler, pclk /2 ); +clk_set_rate (tdiv_event, pclk /2 ); +clk_set_parent (tin_event, tdiv_event); + + clock_rate =clk_get_rate (tin_event); + clock_count_per_tick = clock_rate /HZ ; + +clockevents_calc_mult_shift (&time_event_device, + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); + time_event_device.max_delta_ns = +clockevent_delta2ns (-1 , &time_event_device); + time_event_device.min_delta_ns = +clockevent_delta2ns (1 , &time_event_device); + + time_event_device.cpumask =cpumask_of (0 ); +clockevents_register_device (&time_event_device); + + irq_number = timer_source.event_id +IRQ_TIMER0 ; +setup_irq (irq_number, &samsung_clock_event_irq); +} + +static void __iomem *samsung_timer_reg (void ) +{ +unsigned long offset =0 ; + +switch (timer_source.source_id) { +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : + offset = (timer_source.source_id *0x0c ) +0x14 ; +break ; + +case SAMSUNG_PWM4 : + offset =0x40 ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); +return NULL ; + } + +return S3C_TIMERREG (offset); +} + +/* +* Override the global weak sched_clock symbol with this +* local implementation which uses the clocksource to get some +* better resolution when scheduling the kernel. We accept that +* this wraps around for now, since it is just a relative time +* stamp. (Inspired by U300 implementation.) +*/ +static u32 notrace samsung_read_sched_clock(void) +{ +void __iomem *reg =samsung_timer_reg (); + +if (!reg) +return 0 ; + +return ~__raw_readl (reg); +} + +static void __init samsung_clocksource_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; + + pclk =clk_get_rate (timerclk); + +clk_set_rate (tdiv_source, pclk /2 ); +clk_set_parent (tin_source, tdiv_source); + + clock_rate =clk_get_rate (tin_source); + +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); + +setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); + + if (clocksource_mmio_init(samsung_timer_reg(),"
samsung_clocksource_timer", +clock_rate, 250, 32,clocksource_mmio_readl_down))arch/arm/plat-samsung/samsung-time.c new file +55
-0+panic ("samsung_clocksource_timer: can't register clocksource\n" ); +} + +static void __init samsung_timer_resources (void ) +{ + +unsigned long event_id = timer_source.event_id; +unsigned long source_id = timer_source.source_id; +char devname[15 ]; + + timerclk =clk_get (NULL ,"timers" ); +if (IS_ERR (timerclk)) +panic ("failed to get timers clock for timer" ); + +clk_enable (timerclk); + +sprintf (devname,"s3c24xx-pwm.%lu" , event_id); + s3c_device_timer[event_id].id = event_id; + s3c_device_timer[event_id].dev.init_name = devname; + + tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); +if (IS_ERR (tin_event)) +panic ("failed to get pwm-tin clock for event timer" ); + + tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_event)) +panic ("failed to get pwm-tdiv clock for event timer" ); + +clk_enable (tin_event); + +sprintf (devname,"s3c24xx-pwm.%lu" , source_id); + s3c_device_timer[source_id].id = source_id; + s3c_device_timer[source_id].dev.init_name = devname; + + tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); +if (IS_ERR (tin_source)) +panic ("failed to get pwm-tin clock for source timer" ); + + tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_source)) +panic ("failed to get pwm-tdiv clock for source timer" ); + +clk_enable (tin_source); +} + +static void __init samsung_timer_init (void ) +{ +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); +} + +struct sys_timer samsung_timer = { + .init = samsung_timer_init, +};
Re: [PATCH 1/3] Rename s5p-time to samsung-time
Hi Romain,
Am Freitag, 30. November 2012, 00:18:08 schrieb Romain Naour:
Quoted 30 lines
Hi Heiko,
Quoted 20 lines · Heiko Stübner
Hi Romain,
Am Mittwoch, 28. November 2012, 00:27:36 schrieb Romain Naour:
Quoted 17 lines
Hi Tomasz, Kgene
Quoted 11 lines
I would also suggest splitting this huge patch into a series of several smaller, possibly:
1) Rename s5p-time to samsung-time (and correct any platforms using it currently)
2) Add samsung-time support for s3c24xx
3) Add samsung-time support for s3c64xxWhat do you think?
Best regards,
Tomasz FigaI have separated the patch into three parts, as you said. And also, I corrected some oversights ;-)
Quoted 6 lines
Quoted 3 lines
These patches are for 3.7-rc6.
Here is the first one:
Comments like this should either be in the comment section (below the three dashes) or in a cover-letter (git format-patch --cover-letter), but not in the commit message of the patch itself.
Quoted 6 lines
Thank you for your advice :)
Quoted 2 lines
Otherwise the patches look very cool. Hopefully I'll find a bit of time to test them tomorrow.
On which processor can you test these patches ?
A S3C2416. It should just work, but I'm very curious to see a tick-less kernel on it ;-)
Quoted 11 lines
Quoted 5 lines
But I do have some quick comments:
What happens to
s3c24xx_timer? It seems you changed every user of it but did not remove the old timer code. Might be interesting as a 4th patch, or is it still used somewhere?
s3c24xx_timeris still used by s5pc100 CPUs.
That's why I didn't removeplat-samsung/time.c
I do not have the datasheet, but s5pc100 timers seem to be similar to s3c24xx timers. (16bis) Can someone test on a processor s5pc100 ?
Quoted 4 lines
Quoted 2 lines
Please use the -M option to "git format-patch" which minimizes the impact of moved files in the patch itself.
Do you want I resends these patches, plus one for s5pc100 ?
That might be helpful. Especially to get tests on the s5pc100. If you provide a test-ready patch, chances are a lot higher someone finds the time to test it.
So, as you wrote you could resend the series with
- the three original patches
- a 4th converting s5pc100
- a 5th removing the then unused s3c24xx-timer
Heiko
Quoted 1,392 lines
Quoted 2 lines
Thanks for doing this change
HeikoThank you for your comments :)
RomainQuoted 1,386 lines
Quoted 1,386 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>---
arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 2 +- arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 40 +++ arch/arm/plat-samsung/s5p-time.c | 405----------------------
arch/arm/plat-samsung/samsung-time.c| 405 ++++++++++++++++++++++ 17 files changed, 475 insertions(+), 475 deletions(-)delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h delete mode 100644 arch/arm/plat-samsung/s5p-time.c create mode 100644 arch/arm/plat-samsung/samsung-time.carch/arm/mach-exynos/Kconfig +1
-1@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRTarch/arm/mach-exynos/Kconfig +0
-0select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference(quoted diff) +0
-0
b/arch/arm/mach-exynos/mach-universal_c210.cindex ebc9dd3..325bfe9 100644 ---a/arch/arm/mach-exynos/mach-universal_c210.c+++b/arch/arm/mach-exynos/mach-universal_c210.carch/arm/mach-exynos/mach-universal_c210.c +1
-1@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/camport.h>
#include <linux/platform_data/mipi-csis.h>arch/arm/mach-exynos/mach-universal_c210.c +1
-1@@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 );}
static void
s5p_tv_setup(void)arch/arm/mach-exynos/mach-universal_c210.c +1
-1@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-exynos/mach-universal_c210.c +0
-0.reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END (quoted diff) +0
-0b/arch/arm/mach-s5p64x0/Kconfig index e8742cb..f0ec535 100644
arch/arm/mach-s5p64x0/Kconfig +1
-1@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRTarch/arm/mach-s5p64x0/Kconfig +1
-1select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRTarch/arm/mach-s5p64x0/Kconfig +0
-0select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM(quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6440.cindex 96ea1fe..587fec5 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +1
-1@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/backlight.h>
#include <plat/fb.h>
#include <plat/sdhci.h>arch/arm/mach-s5p64x0/mach-smdk6440.c +1
-1@@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
s5p6440_set_lcd_interface(void)arch/arm/mach-s5p64x0/mach-smdk6440.c +1
-1@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5p64x0/mach-smdk6440.c +0
-0.restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6450.cindex 12748b6..714cd8a 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +1
-1@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/backlight.h>
#include <plat/fb.h>
#include <plat/sdhci.h>arch/arm/mach-s5p64x0/mach-smdk6450.c +1
-1@@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
s5p6450_set_lcd_interface(void)arch/arm/mach-s5p64x0/mach-smdk6450.c +1
-1@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5p64x0/mach-smdk6450.c +0
-0.restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0b/arch/arm/mach-s5pv210/Kconfig index 92ad72f..01018ef 100644
arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRTarch/arm/mach-s5pv210/Kconfig +0
-0select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-aquila.cindex ee9fa5c..7c7d89b 100644arch/arm/mach-s5pv210/mach-aquila.c +1
-1@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "
common.h"arch/arm/mach-s5pv210/mach-aquila.c +1
-1@@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
__initaquila_machine_init(void)arch/arm/mach-s5pv210/mach-aquila.c +1
-1@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5pv210/mach-aquila.c +0
-0.restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-goni.cindex 55e1dba..2740001 100644arch/arm/mach-s5pv210/mach-goni.c +1
-1@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/mfc.h>
#include <plat/camport.h>arch/arm/mach-s5pv210/mach-goni.c +1
-1@@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
__initgoni_reserve(void)arch/arm/mach-s5pv210/mach-goni.c +1
-1@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5pv210/mach-goni.c +0
-0.reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkc110.cindex d9c99fc..d2e93b7 100644arch/arm/mach-s5pv210/mach-smdkc110.c +1
-1@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/mfc.h>#include "
common.h"arch/arm/mach-s5pv210/mach-smdkc110.c +1
-1@@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
__initsmdkc110_reserve(void)arch/arm/mach-s5pv210/mach-smdkc110.c +1
-1@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5pv210/mach-smdkc110.c +0
-0.restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkv210.cindex 4cdb5bb..cd28725 100644arch/arm/mach-s5pv210/mach-smdkv210.c +1
-1@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <
plat/backlight.h>
#include <plat/mfc.h>
#include <plat/clock.h>arch/arm/mach-s5pv210/mach-smdkv210.c +1
-1@@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 );}
static void
__initsmdkv210_reserve(void)arch/arm/mach-s5pv210/mach-smdkv210.c +1
-1@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5pv210/mach-smdkv210.c +0
-0.restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-torbreck.cindex 18785cb..aec668c 100644arch/arm/mach-s5pv210/mach-torbreck.c +1
-1@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "
common.h"arch/arm/mach-s5pv210/mach-torbreck.c +1
-1@@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );}
static void
__inittorbreck_machine_init(void)arch/arm/mach-s5pv210/mach-torbreck.c +1
-1@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer,arch/arm/mach-s5pv210/mach-torbreck.c +0
-0.restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0b/arch/arm/plat-samsung/Kconfig index 59401e1..5278795 100644
arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWMarch/arm/plat-samsung/Kconfig +0
-0help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile index 9e40e8d..06f2312 100644
arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.oobj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o
(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/s5p-time.hdeleted file mode 100644 index 3a70aeb..0000000arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hnew file mode 100644 index 0000000..9d6d622arch/arm/plat-samsung/include/plat/samsung-time.h new file +37
-0@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source(enum samsung_timer_modeevent, + enum
samsung_timer_modesource);arch/arm/plat-samsung/include/plat/samsung-time.h new file +2
-0+extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/s5p-time.cdeleted file mode 100644 index 028b6e8..0000000arch/arm/plat-samsung/s5p-time.c deleted +0
-73@@ -1,405 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* S5P - Common hr-timer support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#include <linux/interrupt.h> -#include <linux/irq.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/clockchips.h> -#include <linux/platform_device.h> - -#include <asm/smp_twd.h> -#include <asm/mach/time.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/sched_clock.h> - -#include <mach/map.h> -#include <plat/devs.h> -#include <plat/regs-timer.h> -#include <plat/s5p-time.h> - -static struct clk *tin_event; -static struct clk *tin_source; -static struct clk *tdiv_event; -static struct clk *tdiv_source; -static struct clk *timerclk; -static struct s5p_timer_source timer_source; -static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); - -static void s5p_time_stop (enum s5p_timer_mode mode) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon &= ~S3C2410_TCON_T0START ; -break ; - -case S5P_PWM1 : - tcon &= ~S3C2410_TCON_T1START ; -break ; - -case S5P_PWM2 : - tcon &= ~S3C2410_TCON_T2START ; -break ; - -case S5P_PWM3 : - tcon &= ~S3C2410_TCON_T3START ; -break ; - -case S5P_PWM4 : - tcon &= ~S3C2410_TCON_T4START ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_setup(enum s5p_timer_mode mode, unsigned longtcnt) -{
arch/arm/plat-samsung/s5p-time.c deleted +0
-331-unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - - tcnt--; - -switch (mode) { -case S5P_PWM0 : - tcon &= ~(0x0f <<0 ); - tcon |=S3C2410_TCON_T0MANUALUPD ; -break ; - -case S5P_PWM1 : - tcon &= ~(0x0f <<8 ); - tcon |=S3C2410_TCON_T1MANUALUPD ; -break ; - -case S5P_PWM2 : - tcon &= ~(0x0f <<12 ); - tcon |=S3C2410_TCON_T2MANUALUPD ; -break ; - -case S5P_PWM3 : - tcon &= ~(0x0f <<16 ); - tcon |=S3C2410_TCON_T3MANUALUPD ; -break ; - -case S5P_PWM4 : - tcon &= ~(0x07 <<20 ); - tcon |=S3C2410_TCON_T4MANUALUPD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } - -__raw_writel (tcnt,S3C2410_TCNTB (mode)); -__raw_writel (tcnt,S3C2410_TCMPB (mode)); -__raw_writel (tcon,S3C2410_TCON ); -} - -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) -{ -unsigned long tcon; - - tcon =__raw_readl (S3C2410_TCON ); - -switch (mode) { -case S5P_PWM0 : - tcon |=S3C2410_TCON_T0START ; - tcon &= ~S3C2410_TCON_T0MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T0RELOAD ; -else - tcon &= ~S3C2410_TCON_T0RELOAD ; -break ; - -case S5P_PWM1 : - tcon |=S3C2410_TCON_T1START ; - tcon &= ~S3C2410_TCON_T1MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T1RELOAD ; -else - tcon &= ~S3C2410_TCON_T1RELOAD ; -break ; - -case S5P_PWM2 : - tcon |=S3C2410_TCON_T2START ; - tcon &= ~S3C2410_TCON_T2MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T2RELOAD ; -else - tcon &= ~S3C2410_TCON_T2RELOAD ; -break ; - -case S5P_PWM3 : - tcon |=S3C2410_TCON_T3START ; - tcon &= ~S3C2410_TCON_T3MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T3RELOAD ; -else - tcon &= ~S3C2410_TCON_T3RELOAD ; -break ; - -case S5P_PWM4 : - tcon |=S3C2410_TCON_T4START ; - tcon &= ~S3C2410_TCON_T4MANUALUPD ; - -if (periodic) - tcon |=S3C2410_TCON_T4RELOAD ; -else - tcon &= ~S3C2410_TCON_T4RELOAD ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , mode); -break ; - } -__raw_writel (tcon,S3C2410_TCON ); -} - -static int s5p_set_next_event (unsigned long cycles, -struct clock_event_device *evt) -{ -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); - -return 0 ; -} - -static void s5p_set_mode (enum clock_event_mode mode, -struct clock_event_device *evt) -{ -s5p_time_stop (timer_source.event_id); - -switch (mode) { -case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); -break ; - -case CLOCK_EVT_MODE_ONESHOT : -break ; - -case CLOCK_EVT_MODE_UNUSED : -case CLOCK_EVT_MODE_SHUTDOWN : -break ; - -case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); -break ; - } -} - -static void s5p_timer_resume (void ) -{ -/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); - -/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); -} - -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) -{ - s3c_device_timer[event].dev.bus = &platform_bus_type; - s3c_device_timer[source].dev.bus = &platform_bus_type; - - timer_source.event_id = event; - timer_source.source_id = source; -} - -static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , - .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , - .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, -}; - -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) -{ -struct clock_event_device *evt = dev_id; - - evt->event_handler (evt); - -return IRQ_HANDLED ; -} - -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , - .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, - .dev_id = &time_event_device, -}; - -static void __init s5p_clockevent_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; -unsigned int irq_number; -struct clk *tscaler; - - pclk =clk_get_rate (timerclk); - - tscaler =clk_get_parent (tdiv_event); - -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); -clk_set_parent (tin_event, tdiv_event); - - clock_rate =clk_get_rate (tin_event); - clock_count_per_tick = clock_rate /HZ ; - -clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); - time_event_device.max_delta_ns = -clockevent_delta2ns (-1 , &time_event_device); - time_event_device.min_delta_ns = -clockevent_delta2ns (1 , &time_event_device); - - time_event_device.cpumask =cpumask_of (0 ); -clockevents_register_device (&time_event_device); - - irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); -} - -static void __iomem *s5p_timer_reg (void ) -{ -unsigned long offset =0 ; - -switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : - offset = (timer_source.source_id *0x0c ) +0x14 ; -break ; - -case S5P_PWM4 : - offset =0x40 ; -break ; - -default : -printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); -return NULL ; - } - -return S3C_TIMERREG (offset); -} - -/* -* Override the global weak sched_clock symbol with this -* local implementation which uses the clocksource to get some -* better resolution when scheduling the kernel. We accept that -* this wraps around for now, since it is just a relative time -* stamp. (Inspired by U300 implementation.) -*/ -static u32 notrace s5p_read_sched_clock(void) -{ -void __iomem *reg =s5p_timer_reg (); - -if (!reg) -return 0 ; - -return ~__raw_readl (reg); -} - -static void __init s5p_clocksource_init (void ) -{ -unsigned long pclk; -unsigned long clock_rate; - - pclk =clk_get_rate (timerclk); - -clk_set_rate (tdiv_source, pclk /2 ); -clk_set_parent (tin_source, tdiv_source); - - clock_rate =clk_get_rate (tin_source); - -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); - -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); - -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) -panic ("s5p_clocksource_timer: can't register clocksource\n" ); -} - -static void __init s5p_timer_resources (void ) -{ - -unsigned long event_id = timer_source.event_id; -unsigned long source_id = timer_source.source_id; -char devname[15 ]; - - timerclk =clk_get (NULL ,"timers" ); -if (IS_ERR (timerclk)) -panic ("failed to get timers clock for timer" ); - -clk_enable (timerclk); - -sprintf (devname,"s3c24xx-pwm.%lu" , event_id); - s3c_device_timer[event_id].id = event_id; - s3c_device_timer[event_id].dev.init_name = devname; - - tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); -if (IS_ERR (tin_event)) -panic ("failed to get pwm-tin clock for event timer" ); - - tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_event)) -panic ("failed to get pwm-tdiv clock for event timer" ); - -clk_enable (tin_event); - -sprintf (devname,"s3c24xx-pwm.%lu" , source_id); - s3c_device_timer[source_id].id = source_id; - s3c_device_timer[source_id].dev.init_name = devname; - - tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); -if (IS_ERR (tin_source)) -panic ("failed to get pwm-tin clock for source timer" ); - - tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); -if (IS_ERR (tdiv_source)) -panic ("failed to get pwm-tdiv clock for source timer" ); - -clk_enable (tin_source); -} - -static void __init s5p_timer_init (void ) -{ -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); -} - -struct sys_timer s5p_timer = { - .init = s5p_timer_init, -};(quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.cnew file mode 100644 index 0000000..91773bfarch/arm/plat-samsung/samsung-time.c new file +73
-0@@ -0,0 +1,405 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* SAMSUNG - Common hr-timer support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/clockchips.h> +#include <linux/platform_device.h> + +#include <asm/smp_twd.h> +#include <asm/mach/time.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/sched_clock.h> + +#include <mach/map.h> +#include <plat/devs.h> +#include <plat/regs-timer.h> +#include <plat/samsung-time.h> + +static struct clk *tin_event; +static struct clk *tin_source; +static struct clk *tdiv_event; +static struct clk *tdiv_source; +static struct clk *timerclk; +static struct samsung_timer_source timer_source; +static unsigned long clock_count_per_tick; +static void samsung_timer_resume (void ); + +static void samsung_time_stop (enum samsung_timer_mode mode) +{ +unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~S3C2410_TCON_T0START ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~S3C2410_TCON_T1START ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~S3C2410_TCON_T2START ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~S3C2410_TCON_T3START ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~S3C2410_TCON_T4START ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_setup(enum samsung_timer_mode mode, unsignedlong tcnt) +{
arch/arm/plat-samsung/samsung-time.c new file +43
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + + tcnt--; + +switch (mode) { +case SAMSUNG_PWM0 : + tcon &= ~(0x0f <<0 ); + tcon |=S3C2410_TCON_T0MANUALUPD ; +break ; + +case SAMSUNG_PWM1 : + tcon &= ~(0x0f <<8 ); + tcon |=S3C2410_TCON_T1MANUALUPD ; +break ; + +case SAMSUNG_PWM2 : + tcon &= ~(0x0f <<12 ); + tcon |=S3C2410_TCON_T2MANUALUPD ; +break ; + +case SAMSUNG_PWM3 : + tcon &= ~(0x0f <<16 ); + tcon |=S3C2410_TCON_T3MANUALUPD ; +break ; + +case SAMSUNG_PWM4 : + tcon &= ~(0x07 <<20 ); + tcon |=S3C2410_TCON_T4MANUALUPD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } + +__raw_writel (tcnt,S3C2410_TCNTB (mode)); +__raw_writel (tcnt,S3C2410_TCMPB (mode)); +__raw_writel (tcon,S3C2410_TCON ); +} + +static void samsung_time_start(enum samsung_timer_mode mode, boolperiodic) +{
arch/arm/plat-samsung/samsung-time.c new file +231
-0+unsigned long tcon; + + tcon =__raw_readl (S3C2410_TCON ); + +switch (mode) { +case SAMSUNG_PWM0 : + tcon |=S3C2410_TCON_T0START ; + tcon &= ~S3C2410_TCON_T0MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T0RELOAD ; +else + tcon &= ~S3C2410_TCON_T0RELOAD ; +break ; + +case SAMSUNG_PWM1 : + tcon |=S3C2410_TCON_T1START ; + tcon &= ~S3C2410_TCON_T1MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T1RELOAD ; +else + tcon &= ~S3C2410_TCON_T1RELOAD ; +break ; + +case SAMSUNG_PWM2 : + tcon |=S3C2410_TCON_T2START ; + tcon &= ~S3C2410_TCON_T2MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T2RELOAD ; +else + tcon &= ~S3C2410_TCON_T2RELOAD ; +break ; + +case SAMSUNG_PWM3 : + tcon |=S3C2410_TCON_T3START ; + tcon &= ~S3C2410_TCON_T3MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T3RELOAD ; +else + tcon &= ~S3C2410_TCON_T3RELOAD ; +break ; + +case SAMSUNG_PWM4 : + tcon |=S3C2410_TCON_T4START ; + tcon &= ~S3C2410_TCON_T4MANUALUPD ; + +if (periodic) + tcon |=S3C2410_TCON_T4RELOAD ; +else + tcon &= ~S3C2410_TCON_T4RELOAD ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , mode); +break ; + } +__raw_writel (tcon,S3C2410_TCON ); +} + +static int samsung_set_next_event (unsigned long cycles, +struct clock_event_device *evt) +{ +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC ); + +return 0 ; +} + +static void samsung_set_mode (enum clock_event_mode mode, +struct clock_event_device *evt) +{ +samsung_time_stop (timer_source.event_id); + +switch (mode) { +case CLOCK_EVT_MODE_PERIODIC : +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); +break ; + +case CLOCK_EVT_MODE_ONESHOT : +break ; + +case CLOCK_EVT_MODE_UNUSED : +case CLOCK_EVT_MODE_SHUTDOWN : +break ; + +case CLOCK_EVT_MODE_RESUME : +samsung_timer_resume (); +break ; + } +} + +static void samsung_timer_resume (void ) +{ +/* event timer restart */ +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC ); + +/* source timer restart */ +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); +} + +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) +{ + s3c_device_timer[event].dev.bus = &platform_bus_type; + s3c_device_timer[source].dev.bus = &platform_bus_type; + + timer_source.event_id = event; + timer_source.source_id = source; +} + +static struct clock_event_device time_event_device = { + .name ="samsung_event_timer" , + .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , + .rating =200 , + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, +}; + +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) +{ +struct clock_event_device *evt = dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , + .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , + .handler = samsung_clock_event_isr, + .dev_id = &time_event_device, +}; + +static void __init samsung_clockevent_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; +unsigned int irq_number; +struct clk *tscaler; + + pclk =clk_get_rate (timerclk); + + tscaler =clk_get_parent (tdiv_event); + +clk_set_rate (tscaler, pclk /2 ); +clk_set_rate (tdiv_event, pclk /2 ); +clk_set_parent (tin_event, tdiv_event); + + clock_rate =clk_get_rate (tin_event); + clock_count_per_tick = clock_rate /HZ ; + +clockevents_calc_mult_shift (&time_event_device, + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); + time_event_device.max_delta_ns = +clockevent_delta2ns (-1 , &time_event_device); + time_event_device.min_delta_ns = +clockevent_delta2ns (1 , &time_event_device); + + time_event_device.cpumask =cpumask_of (0 ); +clockevents_register_device (&time_event_device); + + irq_number = timer_source.event_id +IRQ_TIMER0 ; +setup_irq (irq_number, &samsung_clock_event_irq); +} + +static void __iomem *samsung_timer_reg (void ) +{ +unsigned long offset =0 ; + +switch (timer_source.source_id) { +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : + offset = (timer_source.source_id *0x0c ) +0x14 ; +break ; + +case SAMSUNG_PWM4 : + offset =0x40 ; +break ; + +default : +printk (KERN_ERR "Invalid Timer %d\n" , timer_source.source_id); +return NULL ; + } + +return S3C_TIMERREG (offset); +} + +/* +* Override the global weak sched_clock symbol with this +* local implementation which uses the clocksource to get some +* better resolution when scheduling the kernel. We accept that +* this wraps around for now, since it is just a relative time +* stamp. (Inspired by U300 implementation.) +*/ +static u32 notrace samsung_read_sched_clock(void) +{ +void __iomem *reg =samsung_timer_reg (); + +if (!reg) +return 0 ; + +return ~__raw_readl (reg); +} + +static void __init samsung_clocksource_init (void ) +{ +unsigned long pclk; +unsigned long clock_rate; + + pclk =clk_get_rate (timerclk); + +clk_set_rate (tdiv_source, pclk /2 ); +clk_set_parent (tin_source, tdiv_source); + + clock_rate =clk_get_rate (tin_source); + +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); + +setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); + + if (clocksource_mmio_init(samsung_timer_reg(),"
samsung_clocksource_timer", +clock_rate, 250, 32,clocksource_mmio_readl_down))arch/arm/plat-samsung/samsung-time.c new file +55
-0+panic ("samsung_clocksource_timer: can't register clocksource\n" ); +} + +static void __init samsung_timer_resources (void ) +{ + +unsigned long event_id = timer_source.event_id; +unsigned long source_id = timer_source.source_id; +char devname[15 ]; + + timerclk =clk_get (NULL ,"timers" ); +if (IS_ERR (timerclk)) +panic ("failed to get timers clock for timer" ); + +clk_enable (timerclk); + +sprintf (devname,"s3c24xx-pwm.%lu" , event_id); + s3c_device_timer[event_id].id = event_id; + s3c_device_timer[event_id].dev.init_name = devname; + + tin_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tin" ); +if (IS_ERR (tin_event)) +panic ("failed to get pwm-tin clock for event timer" ); + + tdiv_event =clk_get (&s3c_device_timer[event_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_event)) +panic ("failed to get pwm-tdiv clock for event timer" ); + +clk_enable (tin_event); + +sprintf (devname,"s3c24xx-pwm.%lu" , source_id); + s3c_device_timer[source_id].id = source_id; + s3c_device_timer[source_id].dev.init_name = devname; + + tin_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tin" ); +if (IS_ERR (tin_source)) +panic ("failed to get pwm-tin clock for source timer" ); + + tdiv_source =clk_get (&s3c_device_timer[source_id].dev,"pwm-tdiv" ); +if (IS_ERR (tdiv_source)) +panic ("failed to get pwm-tdiv clock for source timer" ); + +clk_enable (tin_source); +} + +static void __init samsung_timer_init (void ) +{ +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); +} + +struct sys_timer samsung_timer = { + .init = samsung_timer_init, +};
v2 cover S3C / S5PC100: add clockevent/clocksource support
In reply to Romain NaourThis series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API.
I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough.
As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in s5p-time.c (renamed samsung-time.c). I added some #define for s3c24xx and s5pc100 case.
Kernel rev v3.7-rc6
Naour Romain (5):
Rename s5p-time to samsung-time
Add samsung-time support for s3c24xx
Add samsung-time support for s3c64xx
Add samsung-time support for s5pc100
Remove unused plat-samsung/time.c
arch/arm/Kconfig | 9 +-
arch/arm/mach-exynos/Kconfig | 2 +-
arch/arm/mach-exynos/mach-universal_c210.c | 6 +-
arch/arm/mach-s3c24xx/Kconfig | 6 +
arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 +-
arch/arm/mach-s3c24xx/mach-anubis.c | 4 +-
arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +-
arch/arm/mach-s3c24xx/mach-bast.c | 4 +-
arch/arm/mach-s3c24xx/mach-gta02.c | 4 +-
arch/arm/mach-s3c24xx/mach-h1940.c | 4 +-
arch/arm/mach-s3c24xx/mach-jive.c | 4 +-
arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +-
arch/arm/mach-s3c24xx/mach-n30.c | 6 +-
arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +-
arch/arm/mach-s3c24xx/mach-osiris.c | 4 +-
arch/arm/mach-s3c24xx/mach-otom.c | 4 +-
arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +-
arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +-
arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +-
arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +-
arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +-
arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 5 +-
arch/arm/mach-s3c64xx/Kconfig | 2 +
arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-hmt.c | 4 +-
arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-ncp.c | 4 +-
arch/arm/mach-s3c64xx/mach-real6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-smartq.c | 2 +
arch/arm/mach-s3c64xx/mach-smartq5.c | 3 +-
arch/arm/mach-s3c64xx/mach-smartq7.c | 3 +-
arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +-
arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +-
arch/arm/mach-s5p64x0/Kconfig | 4 +-
arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +-
arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +-
arch/arm/mach-s5pc100/Kconfig | 1 +
arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +-
arch/arm/mach-s5pv210/Kconfig | 2 +-
arch/arm/mach-s5pv210/mach-aquila.c | 6 +-
arch/arm/mach-s5pv210/mach-goni.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +-
arch/arm/mach-s5pv210/mach-torbreck.c | 6 +-
arch/arm/plat-samsung/Kconfig | 2 +-
arch/arm/plat-samsung/Makefile | 3 +-
arch/arm/plat-samsung/include/plat/cpu.h | 5 -
arch/arm/plat-samsung/include/plat/s5p-time.h | 40 ---
arch/arm/plat-samsung/include/plat/samsung-time.h | 51 ++++
.../plat-samsung/{s5p-time.c => samsung-time.c} | 144 +++++------
arch/arm/plat-samsung/time.c | 285 ---------------------
57 files changed, 274 insertions(+), 474 deletions(-)
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (68%)
delete mode 100644 arch/arm/plat-samsung/time.cPATCH v2 1/5 Rename s5p-time to samsung-time
In reply to Heiko StübnerThis patch rename s5p-time to samsung-time.
There is no functional change.
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (70%)arch/arm/mach-exynos/Kconfig +1 -1
@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference
arch/arm/mach-exynos/mach-universal_c210.c +3 -3
@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h>
@@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )
@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END
arch/arm/mach-s5p64x0/Kconfig +2 -2
@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
arch/arm/mach-s5p64x0/mach-smdk6440.c +3 -3
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )
@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5p64x0/mach-smdk6450.c +3 -3
@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )
@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5pv210/Kconfig +1 -1
@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV
arch/arm/mach-s5pv210/mach-aquila.c +3 -3
@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )
@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-goni.c +3 -3
@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h>
@@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )
@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkc110.c +3 -3
@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h"
@@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )
@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkv210.c +3 -3
@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h>
@@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )
@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-torbreck.c +3 -3
@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )
@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/plat-samsung/Kconfig +1 -1
@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help
arch/arm/plat-samsung/Makefile +1 -1
@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o
arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */
arch/arm/plat-samsung/include/plat/samsung-time.h new file +40 -0
@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */
arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +68 -68
343 lines not on this page · raw message
Re: [PATCH 1/5 v2] Rename s5p-time to samsung-time
Am Sonntag, 2. Dezember 2012, 20:44:01 schrieb Romain Naour:
Quoted 5 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>
The patch does not apply to current linux-next, because it has some problem with the exynos-universal board. I've fixed this to test the patch, so
Quoted 4 lines
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (70%)what does this line do in the patch description? It seems your mail client mangled the "--" parting the patch message from the stats/comment section.
Quoted 780 lines
arch/arm/mach-exynos/Kconfig +1
-1@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference(quoted diff) +0
-0
b/arch/arm/mach-exynos/mach-universal_c210.cindex ebc9dd3..325bfe9 100644arch/arm/mach-exynos/mach-universal_c210.c +3
-3@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h> @@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END arch/arm/mach-s5p64x0/Kconfig +2
-2@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM(quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6440.cindex 96ea1fe..587fec5 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6450.cindex 12748b6..714cd8a 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-aquila.cindex ee9fa5c..7c7d89b 100644arch/arm/mach-s5pv210/mach-aquila.c +3
-3@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-goni.cindex 55e1dba..2740001 100644arch/arm/mach-s5pv210/mach-goni.c +3
-3@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h> @@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkc110.cindex d9c99fc..d2e93b7 100644arch/arm/mach-s5pv210/mach-smdkc110.c +3
-3@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h" @@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkv210.cindex 4cdb5bb..cd28725 100644arch/arm/mach-s5pv210/mach-smdkv210.c +3
-3@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h> @@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-torbreck.cindex 18785cb..aec668c 100644arch/arm/mach-s5pv210/mach-torbreck.c +3
-3@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile index 9e40e8d..06f2312 100644
arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/s5p-time.hdeleted file mode 100644 index 3a70aeb..0000000arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hnew file mode 100644 index 0000000..9d6d622arch/arm/plat-samsung/include/plat/samsung-time.h new file +40
-0@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.csimilarity index 70% rename fromarch/arm/plat-samsung/s5p-time.crename toarch/arm/plat-samsung/samsung-time.cindex 028b6e8..91773bf 100644arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +62
-62@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* S5P - Common hr-timer support +* SAMSUNG - Common hr-timer support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -25,41 +25,41 @@#include <mach/map.h> #include <plat/devs.h> #include <plat/regs-timer.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> static struct clk *tin_event;static struct clk *tin_source;static struct clk *tdiv_event;static struct clk *tdiv_source;static struct clk *timerclk; -static struct s5p_timer_source timer_source; +static struct samsung_timer_source timer_source;static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); +static void samsung_timer_resume (void ); -static void s5p_time_stop (enum s5p_timer_mode mode) +static void samsung_time_stop (enum samsung_timer_mode mode) {unsigned long tcon; tcon =__raw_readl (S3C2410_TCON );switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon &= ~S3C2410_TCON_T0START ;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon &= ~S3C2410_TCON_T1START ;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon &= ~S3C2410_TCON_T2START ;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon &= ~S3C2410_TCON_T3START ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon &= ~S3C2410_TCON_T4START ;break ;@@ -70,7 +70,7 @@ static void s5p_time_stop(enum s5p_timer_mode mode)__raw_writel (tcon,S3C2410_TCON ); } -static void s5p_time_setup (enum s5p_timer_mode mode,unsigned long tcnt) +static void samsung_time_setup (enum samsung_timer_mode mode,unsigned long tcnt) {unsigned long tcon;@@ -79,27 +79,27 @@ static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt) tcnt--;switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon &= ~(0x0f <<0 ); tcon |=S3C2410_TCON_T0MANUALUPD ;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon &= ~(0x0f <<8 ); tcon |=S3C2410_TCON_T1MANUALUPD ;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon &= ~(0x0f <<12 ); tcon |=S3C2410_TCON_T2MANUALUPD ;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon &= ~(0x0f <<16 ); tcon |=S3C2410_TCON_T3MANUALUPD ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon &= ~(0x07 <<20 ); tcon |=S3C2410_TCON_T4MANUALUPD ;break ;@@ -114,14 +114,14 @@ static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt) __raw_writel(tcon, S3C2410_TCON); } -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) +static void samsung_time_start (enum samsung_timer_mode mode,bool periodic) {unsigned long tcon; tcon =__raw_readl (S3C2410_TCON );switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon |=S3C2410_TCON_T0START ; tcon &= ~S3C2410_TCON_T0MANUALUPD ;@@ -131,7 +131,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T0RELOAD;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon |=S3C2410_TCON_T1START ; tcon &= ~S3C2410_TCON_T1MANUALUPD ;@@ -141,7 +141,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T1RELOAD;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon |=S3C2410_TCON_T2START ; tcon &= ~S3C2410_TCON_T2MANUALUPD ;@@ -151,7 +151,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T2RELOAD;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon |=S3C2410_TCON_T3START ; tcon &= ~S3C2410_TCON_T3MANUALUPD ;@@ -161,7 +161,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T3RELOAD;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon |=S3C2410_TCON_T4START ; tcon &= ~S3C2410_TCON_T4MANUALUPD ;@@ -178,24 +178,24 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) __raw_writel(tcon, S3C2410_TCON); } -static int s5p_set_next_event (unsigned long cycles, +static int samsung_set_next_event (unsigned long cycles,struct clock_event_device *evt) { -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC );return 0 ; } -static void s5p_set_mode (enum clock_event_mode mode, +static void samsung_set_mode (enum clock_event_mode mode,struct clock_event_device *evt) { -s5p_time_stop (timer_source.event_id); +samsung_time_stop (timer_source.event_id);switch (mode) {case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC );break ;case CLOCK_EVT_MODE_ONESHOT :@@ -206,24 +206,24 @@ static void s5p_set_mode(enum clock_event_mode mode,break ;case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); +samsung_timer_resume ();break ; } } -static void s5p_timer_resume (void ) +static void samsung_timer_resume (void ) {/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC );/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); } -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) { s3c_device_timer[event].dev.bus = &platform_bus_type; s3c_device_timer[source].dev.bus = &platform_bus_type;@@ -233,14 +233,14 @@ void __init s5p_set_timer_source(enum s5p_timer_mode event, }static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , + .name ="samsung_event_timer" , .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, }; -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) {struct clock_event_device *evt = dev_id;@@ -249,14 +249,14 @@ static irqreturn_t s5p_clock_event_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, + .handler = samsung_clock_event_isr, .dev_id = &time_event_device, }; -static void __init s5p_clockevent_init (void ) +static void __init samsung_clockevent_init (void ) {unsigned long pclk;unsigned long clock_rate;@@ -275,7 +275,7 @@ static void __init s5p_clockevent_init(void) clock_count_per_tick = clock_rate /HZ ;clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); time_event_device.max_delta_ns =clockevent_delta2ns (-1 , &time_event_device); time_event_device.min_delta_ns =@@ -285,22 +285,22 @@ static void __init s5p_clockevent_init(void)clockevents_register_device (&time_event_device); irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); +setup_irq (irq_number, &samsung_clock_event_irq); } -static void __iomem *s5p_timer_reg (void ) +static void __iomem *samsung_timer_reg (void ) {unsigned long offset =0 ;switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : offset = (timer_source.source_id *0x0c ) +0x14 ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : offset =0x40 ;break ;@@ -319,9 +319,9 @@ static void __iomem *s5p_timer_reg(void)* this wraps around for now, since it is just a relative time * stamp. (Inspired by U300 implementation.) */ -static u32 notrace s5p_read_sched_clock(void) +static u32 notrace samsung_read_sched_clock(void) { -void __iomem *reg =s5p_timer_reg (); +void __iomem *reg =samsung_timer_reg ();if (!reg)return 0 ;@@ -329,7 +329,7 @@ static u32 notrace s5p_read_sched_clock(void)return ~__raw_readl (reg); } -static void __init s5p_clocksource_init (void ) +static void __init samsung_clocksource_init (void ) {unsigned long pclk;unsigned long clock_rate;@@ -341,17 +341,17 @@ static void __init s5p_clocksource_init(void) clock_rate =clk_get_rate (tin_source); -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , +if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , clock_rate,250 ,32 , clocksource_mmio_readl_down)) -panic ("s5p_clocksource_timer: can't register clocksource\n" ); +panic ("samsung_clocksource_timer: can't register clocksource\n" ); } -static void __init s5p_timer_resources (void ) +static void __init samsung_timer_resources (void ) {arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +6
-6unsigned long event_id = timer_source.event_id;@@ -393,13 +393,13 @@ static void __init s5p_timer_resources(void)clk_enable (tin_source); } -static void __init s5p_timer_init (void ) +static void __init samsung_timer_init (void ) { -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); } -struct sys_timer s5p_timer = { - .init = s5p_timer_init, +struct sys_timer samsung_timer = { + .init = samsung_timer_init, };
Re: [PATCH 1/5 v2] Rename s5p-time to samsung-time
Quoted 11 lines · Heiko Stübner
Am Sonntag, 2. Dezember 2012, 20:44:01 schrieb Romain Naour:
Quoted 5 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>The patch does not apply to current linux-next, because it has some problem with the exynos-universal board. I've fixed this to test the patch, so
Acked-by Heiko Stuebner <[email protected]>
What's wrong with this part of the patch ?
I applied this patch today on linux-next tree, branch next-20121214. (with some hunk but no error)
Thank you for your time.
Quoted 792 lines
Quoted 5 lines
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (70%)what does this line do in the patch description? It seems your mail client mangled the "--" parting the patch message from the stats/comment section.
Quoted 780 lines
arch/arm/mach-exynos/Kconfig +1
-1@@ -274,7 +274,7 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_SETUP_MIPIPHY help Machine support for Samsung Mobile Universal S5PC210 Reference(quoted diff) +0
-0
b/arch/arm/mach-exynos/mach-universal_c210.cindex ebc9dd3..325bfe9 100644arch/arm/mach-exynos/mach-universal_c210.c +3
-3@@ -41,7 +41,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <linux/platform_data/mipi-csis.h> @@ -1099,7 +1099,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )@@ -1158,7 +1158,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END arch/arm/mach-s5p64x0/Kconfig +2
-2@@ -9,7 +9,7 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM@@ -18,7 +18,7 @@ config CPU_S5P6440 config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM(quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6440.cindex 96ea1fe..587fec5 100644arch/arm/mach-s5p64x0/mach-smdk6440.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -231,7 +231,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )@@ -276,6 +276,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5p64x0/mach-smdk6450.cindex 12748b6..714cd8a 100644arch/arm/mach-s5p64x0/mach-smdk6450.c +3
-3@@ -50,7 +50,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h> @@ -250,7 +250,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )@@ -295,6 +295,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END arch/arm/mach-s5pv210/Kconfig +1
-1@@ -12,7 +12,7 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT + select SAMSUNG_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-aquila.cindex ee9fa5c..7c7d89b 100644arch/arm/mach-s5pv210/mach-aquila.c +3
-3@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-goni.cindex 55e1dba..2740001 100644arch/arm/mach-s5pv210/mach-goni.c +3
-3@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h> @@ -910,7 +910,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )@@ -976,7 +976,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkc110.cindex d9c99fc..d2e93b7 100644arch/arm/mach-s5pv210/mach-smdkc110.c +3
-3@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h" @@ -122,7 +122,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )@@ -156,7 +156,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-smdkv210.cindex 4cdb5bb..cd28725 100644arch/arm/mach-s5pv210/mach-smdkv210.c +3
-3@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h> @@ -287,7 +287,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )@@ -332,7 +332,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-torbreck.cindex 18785cb..aec668c 100644arch/arm/mach-s5pv210/mach-torbreck.c +3
-3@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h" @@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END arch/arm/plat-samsung/Kconfig +1
-1@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile index 9e40e8d..06f2312 100644
arch/arm/plat-samsung/Makefile +1
-1@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/s5p-time.hdeleted file mode 100644 index 3a70aeb..0000000arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0
-40@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hnew file mode 100644 index 0000000..9d6d622arch/arm/plat-samsung/include/plat/samsung-time.h new file +40
-0@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */ (quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.csimilarity index 70% rename fromarch/arm/plat-samsung/s5p-time.crename toarch/arm/plat-samsung/samsung-time.cindex 028b6e8..91773bf 100644arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +62
-62@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* S5P - Common hr-timer support +* SAMSUNG - Common hr-timer support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -25,41 +25,41 @@#include <mach/map.h> #include <plat/devs.h> #include <plat/regs-timer.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> static struct clk *tin_event;static struct clk *tin_source;static struct clk *tdiv_event;static struct clk *tdiv_source;static struct clk *timerclk; -static struct s5p_timer_source timer_source; +static struct samsung_timer_source timer_source;static unsigned long clock_count_per_tick; -static void s5p_timer_resume (void ); +static void samsung_timer_resume (void ); -static void s5p_time_stop (enum s5p_timer_mode mode) +static void samsung_time_stop (enum samsung_timer_mode mode) {unsigned long tcon; tcon =__raw_readl (S3C2410_TCON );switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon &= ~S3C2410_TCON_T0START ;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon &= ~S3C2410_TCON_T1START ;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon &= ~S3C2410_TCON_T2START ;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon &= ~S3C2410_TCON_T3START ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon &= ~S3C2410_TCON_T4START ;break ;@@ -70,7 +70,7 @@ static void s5p_time_stop(enum s5p_timer_mode mode)__raw_writel (tcon,S3C2410_TCON ); } -static void s5p_time_setup (enum s5p_timer_mode mode,unsigned long tcnt) +static void samsung_time_setup (enum samsung_timer_mode mode,unsigned long tcnt) {unsigned long tcon;@@ -79,27 +79,27 @@ static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt) tcnt--;switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon &= ~(0x0f <<0 ); tcon |=S3C2410_TCON_T0MANUALUPD ;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon &= ~(0x0f <<8 ); tcon |=S3C2410_TCON_T1MANUALUPD ;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon &= ~(0x0f <<12 ); tcon |=S3C2410_TCON_T2MANUALUPD ;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon &= ~(0x0f <<16 ); tcon |=S3C2410_TCON_T3MANUALUPD ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon &= ~(0x07 <<20 ); tcon |=S3C2410_TCON_T4MANUALUPD ;break ;@@ -114,14 +114,14 @@ static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt) __raw_writel(tcon, S3C2410_TCON); } -static void s5p_time_start (enum s5p_timer_mode mode,bool periodic) +static void samsung_time_start (enum samsung_timer_mode mode,bool periodic) {unsigned long tcon; tcon =__raw_readl (S3C2410_TCON );switch (mode) { -case S5P_PWM0 : +case SAMSUNG_PWM0 : tcon |=S3C2410_TCON_T0START ; tcon &= ~S3C2410_TCON_T0MANUALUPD ;@@ -131,7 +131,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T0RELOAD;break ; -case S5P_PWM1 : +case SAMSUNG_PWM1 : tcon |=S3C2410_TCON_T1START ; tcon &= ~S3C2410_TCON_T1MANUALUPD ;@@ -141,7 +141,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T1RELOAD;break ; -case S5P_PWM2 : +case SAMSUNG_PWM2 : tcon |=S3C2410_TCON_T2START ; tcon &= ~S3C2410_TCON_T2MANUALUPD ;@@ -151,7 +151,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T2RELOAD;break ; -case S5P_PWM3 : +case SAMSUNG_PWM3 : tcon |=S3C2410_TCON_T3START ; tcon &= ~S3C2410_TCON_T3MANUALUPD ;@@ -161,7 +161,7 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) tcon &= ~S3C2410_TCON_T3RELOAD;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : tcon |=S3C2410_TCON_T4START ; tcon &= ~S3C2410_TCON_T4MANUALUPD ;@@ -178,24 +178,24 @@ static void s5p_time_start(enum s5p_timer_mode mode, bool periodic) __raw_writel(tcon, S3C2410_TCON); } -static int s5p_set_next_event (unsigned long cycles, +static int samsung_set_next_event (unsigned long cycles,struct clock_event_device *evt) { -s5p_time_setup (timer_source.event_id, cycles); -s5p_time_start (timer_source.event_id,NON_PERIODIC ); +samsung_time_setup (timer_source.event_id, cycles); +samsung_time_start (timer_source.event_id,NON_PERIODIC );return 0 ; } -static void s5p_set_mode (enum clock_event_mode mode, +static void samsung_set_mode (enum clock_event_mode mode,struct clock_event_device *evt) { -s5p_time_stop (timer_source.event_id); +samsung_time_stop (timer_source.event_id);switch (mode) {case CLOCK_EVT_MODE_PERIODIC : -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC );break ;case CLOCK_EVT_MODE_ONESHOT :@@ -206,24 +206,24 @@ static void s5p_set_mode(enum clock_event_mode mode,break ;case CLOCK_EVT_MODE_RESUME : -s5p_timer_resume (); +samsung_timer_resume ();break ; } } -static void s5p_timer_resume (void ) +static void samsung_timer_resume (void ) {/* event timer restart */ -s5p_time_setup (timer_source.event_id, clock_count_per_tick); -s5p_time_start (timer_source.event_id,PERIODIC ); +samsung_time_setup (timer_source.event_id, clock_count_per_tick); +samsung_time_start (timer_source.event_id,PERIODIC );/* source timer restart */ -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); } -void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source) +void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source) { s3c_device_timer[event].dev.bus = &platform_bus_type; s3c_device_timer[source].dev.bus = &platform_bus_type;@@ -233,14 +233,14 @@ void __init s5p_set_timer_source(enum s5p_timer_mode event, }static struct clock_event_device time_event_device = { - .name ="s5p_event_timer" , + .name ="samsung_event_timer" , .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , .rating =200 , - .set_next_event = s5p_set_next_event, - .set_mode = s5p_set_mode, + .set_next_event = samsung_set_next_event, + .set_mode = samsung_set_mode, }; -static irqreturn_t s5p_clock_event_isr (int irq,void *dev_id) +static irqreturn_t samsung_clock_event_isr (int irq,void *dev_id) {struct clock_event_device *evt = dev_id;@@ -249,14 +249,14 @@ static irqreturn_t s5p_clock_event_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction s5p_clock_event_irq = { - .name ="s5p_time_irq" , +static struct irqaction samsung_clock_event_irq = { + .name ="samsung_time_irq" , .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = s5p_clock_event_isr, + .handler = samsung_clock_event_isr, .dev_id = &time_event_device, }; -static void __init s5p_clockevent_init (void ) +static void __init samsung_clockevent_init (void ) {unsigned long pclk;unsigned long clock_rate;@@ -275,7 +275,7 @@ static void __init s5p_clockevent_init(void) clock_count_per_tick = clock_rate /HZ ;clockevents_calc_mult_shift (&time_event_device, - clock_rate,S5PTIMER_MIN_RANGE ); + clock_rate,SAMSUNG_TIMER_MIN_RANGE ); time_event_device.max_delta_ns =clockevent_delta2ns (-1 , &time_event_device); time_event_device.min_delta_ns =@@ -285,22 +285,22 @@ static void __init s5p_clockevent_init(void)clockevents_register_device (&time_event_device); irq_number = timer_source.event_id +IRQ_TIMER0 ; -setup_irq (irq_number, &s5p_clock_event_irq); +setup_irq (irq_number, &samsung_clock_event_irq); } -static void __iomem *s5p_timer_reg (void ) +static void __iomem *samsung_timer_reg (void ) {unsigned long offset =0 ;switch (timer_source.source_id) { -case S5P_PWM0 : -case S5P_PWM1 : -case S5P_PWM2 : -case S5P_PWM3 : +case SAMSUNG_PWM0 : +case SAMSUNG_PWM1 : +case SAMSUNG_PWM2 : +case SAMSUNG_PWM3 : offset = (timer_source.source_id *0x0c ) +0x14 ;break ; -case S5P_PWM4 : +case SAMSUNG_PWM4 : offset =0x40 ;break ;@@ -319,9 +319,9 @@ static void __iomem *s5p_timer_reg(void)* this wraps around for now, since it is just a relative time * stamp. (Inspired by U300 implementation.) */ -static u32 notrace s5p_read_sched_clock(void) +static u32 notrace samsung_read_sched_clock(void) { -void __iomem *reg =s5p_timer_reg (); +void __iomem *reg =samsung_timer_reg ();if (!reg)return 0 ;@@ -329,7 +329,7 @@ static u32 notrace s5p_read_sched_clock(void)return ~__raw_readl (reg); } -static void __init s5p_clocksource_init (void ) +static void __init samsung_clocksource_init (void ) {unsigned long pclk;unsigned long clock_rate;@@ -341,17 +341,17 @@ static void __init s5p_clocksource_init(void) clock_rate =clk_get_rate (tin_source); -s5p_time_setup (timer_source.source_id,TCNT_MAX ); -s5p_time_start (timer_source.source_id,PERIODIC ); +samsung_time_setup (timer_source.source_id,TCNT_MAX ); +samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (s5p_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); -if (clocksource_mmio_init (s5p_timer_reg (),"s5p_clocksource_timer" , +if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , clock_rate,250 ,32 , clocksource_mmio_readl_down)) -panic ("s5p_clocksource_timer: can't register clocksource\n" ); +panic ("samsung_clocksource_timer: can't register clocksource\n" ); } -static void __init s5p_timer_resources (void ) +static void __init samsung_timer_resources (void ) {arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +6
-6unsigned long event_id = timer_source.event_id;@@ -393,13 +393,13 @@ static void __init s5p_timer_resources(void)clk_enable (tin_source); } -static void __init s5p_timer_init (void ) +static void __init samsung_timer_init (void ) { -s5p_timer_resources (); -s5p_clockevent_init (); -s5p_clocksource_init (); +samsung_timer_resources (); +samsung_clockevent_init (); +samsung_clocksource_init (); } -struct sys_timer s5p_timer = { - .init = s5p_timer_init, +struct sys_timer samsung_timer = { + .init = samsung_timer_init, };
Re: [PATCH 1/5 v2] Rename s5p-time to samsung-time
Hi Romain,
Quoted 12 lines · On Saturday 15 of December 2012 22:43:03 Romain Naour wrote:
Quoted 11 lines · Heiko Stübner
Am Sonntag, 2. Dezember 2012, 20:44:01 schrieb Romain Naour:
Quoted 5 lines
This patch rename s5p-time to samsung-time.
There is no functional change.Signed-off-by Naour Romain <[email protected]>The patch does not apply to current linux-next, because it has some problem with the exynos-universal board. I've fixed this to test the patch, so
Quoted 5 lines
Quoted 1 line
Acked-by Heiko Stuebner <[email protected]>What's wrong with this part of the patch ?
I applied this patch today on linux-next tree, branch next-20121214. (with some hunk but no error)
Patches that are supposed to go through Samsung (Kgene's) tree, should be based on for-next branch of Samsung tree.
Do you have plans to rebase and resubmit this series again? I plan to submit some patches for S3C64xx (partly based on my historical work on this platform) and would be nice to have hrtime support already there, especially when all left is to just merge it.
Best regards,
Tomasz Figa
Re: [PATCH 1/5 v2] Rename s5p-time to samsung-time
Quoted 1 line · Tomasz Figa
Hi Romain,
[...]
Quoted 4 lines
Quoted 3 lines
What's wrong with this part of the patch ?
I applied this patch today on linux-next tree, branch next-20121214. (with some hunk but no error)
Quoted 8 lines
Patches that are supposed to go through Samsung (Kgene's) tree, should be based on for-next branch of Samsung tree.
Do you have plans to rebase and resubmit this series again? I plan to submit some patches for S3C64xx (partly based on my historical work on this platform) and would be nice to have hrtime support already there, especially when all left is to just merge it.
Tomasz, thanks.
As I said, this looks good to me, but, please re-submit this series against on latest my for-next so that I can pick up in Samsung tree. I couldn't apply due to too many conflicts :-(
One more note, please add config option and inclusion by alphabetical order rather than just replacing them.
Thanks.
- Kukjin
Re: [PATCH 1/5 v2] Rename s5p-time to samsung-time
Quoted 23 lines · Kukjin Kim
Quoted 1 line · Tomasz Figa
Hi Romain,
[...]
Quoted 4 lines
Quoted 3 lines
What's wrong with this part of the patch ?
I applied this patch today on linux-next tree, branch next-20121214. (with some hunk but no error)Quoted 8 lines
Patches that are supposed to go through Samsung (Kgene's) tree, should be based on for-next branch of Samsung tree.
Do you have plans to rebase and resubmit this series again? I plan to submit some patches for S3C64xx (partly based on my historical work on this platform) and would be nice to have hrtime support already there, especially when all left is to just merge it.
Tomasz, thanks.
As I said, this looks good to me, but, please re-submit this series against on latest my for-next so that I can pick up in Samsung tree. I couldn't apply due to too many conflicts :-(
Quoted 6 lines
One more note, please add config option and inclusion by alphabetical order rather than just replacing them.
Thanks.
- Kukjin
Hi Kukjin and Tomasz,
I reapplied this series of patches onto for-next branch. So, here are these patches in the following mails :)
Thank you for your help.
Romain
v3 cover S3C / S5PC100: add clockevent/clocksource support
In reply to Tomasz FigaThis series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API.
I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough.
As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in s5p-time.c (renamed samsung-time.c). I added some #define for s3c24xx and s5pc100 case.
Naour Romain (5):
Rename s5p-time to samsung-time
Add samsung-time support for s3c24xx
Add samsung-time support for s3c64xx
Add samsung-time support for s5pc100
Remove unused plat-samsung/time.c
arch/arm/Kconfig | 9 +-
arch/arm/mach-exynos/Kconfig | 2 +-
arch/arm/mach-exynos/mach-universal_c210.c | 6 +-
arch/arm/mach-s3c24xx/Kconfig | 6 +
arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 +-
arch/arm/mach-s3c24xx/mach-anubis.c | 4 +-
arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +-
arch/arm/mach-s3c24xx/mach-bast.c | 4 +-
arch/arm/mach-s3c24xx/mach-gta02.c | 4 +-
arch/arm/mach-s3c24xx/mach-h1940.c | 5 +-
arch/arm/mach-s3c24xx/mach-jive.c | 4 +-
arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +-
arch/arm/mach-s3c24xx/mach-n30.c | 6 +-
arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +-
arch/arm/mach-s3c24xx/mach-osiris.c | 4 +-
arch/arm/mach-s3c24xx/mach-otom.c | 4 +-
arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +-
arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +-
arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +-
arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +-
arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +-
arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +-
arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 5 +-
arch/arm/mach-s3c64xx/Kconfig | 2 +
arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-hmt.c | 4 +-
arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-ncp.c | 4 +-
arch/arm/mach-s3c64xx/mach-real6410.c | 4 +-
arch/arm/mach-s3c64xx/mach-smartq.c | 2 +
arch/arm/mach-s3c64xx/mach-smartq5.c | 3 +-
arch/arm/mach-s3c64xx/mach-smartq7.c | 3 +-
arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +-
arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +-
arch/arm/mach-s5p64x0/Kconfig | 4 +-
arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +-
arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +-
arch/arm/mach-s5pc100/Kconfig | 1 +
arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +-
arch/arm/mach-s5pv210/Kconfig | 2 +-
arch/arm/mach-s5pv210/mach-aquila.c | 6 +-
arch/arm/mach-s5pv210/mach-goni.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +-
arch/arm/mach-s5pv210/mach-torbreck.c | 6 +-
arch/arm/plat-samsung/Kconfig | 2 +-
arch/arm/plat-samsung/Makefile | 3 +-
arch/arm/plat-samsung/include/plat/cpu.h | 5 -
arch/arm/plat-samsung/include/plat/s5p-time.h | 40 ---
arch/arm/plat-samsung/include/plat/samsung-time.h | 51 ++++
.../plat-samsung/{s5p-time.c => samsung-time.c} | 144 +++++------
arch/arm/plat-samsung/time.c | 285 ---------------------
57 files changed, 274 insertions(+), 475 deletions(-)
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (68%)
delete mode 100644 arch/arm/plat-samsung/time.cSignature · 1 line
1.8.0.3
Re: [PATCH 0/5 v3] S3C / S5PC100: add clockevent/clocksource support
Hi Romain, Kukjin,
Quoted 79 lines · On Wednesday 09 of January 2013 23:43:35 Romain Naour wrote:
This series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in
s5p-time.c(renamedsamsung-time.c). I added some #define for s3c24xx and s5pc100 case.Naour Romain (5):
Rename s5p-time to samsung-time
Add samsung-time support for s3c24xx
Add samsung-time support for s3c64xx
Add samsung-time support for s5pc100
Remove unusedplat-samsung/time.carch/arm/Kconfig | 9 +- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s3c24xx/Kconfig | 6 + arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 +- arch/arm/mach-s3c24xx/mach-anubis.c | 4 +- arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +- arch/arm/mach-s3c24xx/mach-bast.c | 4 +- arch/arm/mach-s3c24xx/mach-gta02.c | 4 +- arch/arm/mach-s3c24xx/mach-h1940.c | 5 +- arch/arm/mach-s3c24xx/mach-jive.c | 4 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +- arch/arm/mach-s3c24xx/mach-n30.c | 6 +- arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +- arch/arm/mach-s3c24xx/mach-osiris.c | 4 +- arch/arm/mach-s3c24xx/mach-otom.c | 4 +- arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +- arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +- arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +- arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +- arch/arm/mach-s3c24xx/mach-vstms.c | 5 +- arch/arm/mach-s3c64xx/Kconfig | 2 + arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +- arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +- arch/arm/mach-s3c64xx/mach-hmt.c | 4 +- arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +- arch/arm/mach-s3c64xx/mach-ncp.c | 4 +- arch/arm/mach-s3c64xx/mach-real6410.c | 4 +- arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 3 +- arch/arm/mach-s3c64xx/mach-smartq7.c | 3 +- arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +- arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pc100/Kconfig | 1 + arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 3 +- arch/arm/plat-samsung/include/plat/cpu.h | 5 - arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 51 ++++
Quoted 8 lines
.../plat-samsung/{s5p-time.c => samsung-time.c} | 144 +++++------
arch/arm/plat-samsung/time.c | 285
--------------------- 57 files changed, 274 insertions(+), 475
deletions(-)
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (68%)
delete mode 100644 arch/arm/plat-samsung/time.cThe whole series looks good to me.
Also I tested it on a Tiny6410 (Mini6410-compatible) board.
Best regards,
Tomasz Figa
RE: [PATCH 0/5 v3] S3C / S5PC100: add clockevent/clocksource support
Quoted 92 lines · Tomasz Figa
Hi Romain, Kukjin,
Quoted 79 lines · On Wednesday 09 of January 2013 23:43:35 Romain Naour wrote:
This series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in
s5p-time.c(renamedsamsung-time.c). I added some #define for s3c24xx and s5pc100 case.Naour Romain (5):
Rename s5p-time to samsung-time
Add samsung-time support for s3c24xx
Add samsung-time support for s3c64xx
Add samsung-time support for s5pc100
Remove unusedplat-samsung/time.carch/arm/Kconfig | 9 +- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s3c24xx/Kconfig | 6 + arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 +- arch/arm/mach-s3c24xx/mach-anubis.c | 4 +- arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +- arch/arm/mach-s3c24xx/mach-bast.c | 4 +- arch/arm/mach-s3c24xx/mach-gta02.c | 4 +- arch/arm/mach-s3c24xx/mach-h1940.c | 5 +- arch/arm/mach-s3c24xx/mach-jive.c | 4 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +- arch/arm/mach-s3c24xx/mach-n30.c | 6 +- arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +- arch/arm/mach-s3c24xx/mach-osiris.c | 4 +- arch/arm/mach-s3c24xx/mach-otom.c | 4 +- arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +- arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +- arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +- arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +- arch/arm/mach-s3c24xx/mach-vstms.c | 5 +- arch/arm/mach-s3c64xx/Kconfig | 2 + arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +- arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +- arch/arm/mach-s3c64xx/mach-hmt.c | 4 +- arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +- arch/arm/mach-s3c64xx/mach-ncp.c | 4 +- arch/arm/mach-s3c64xx/mach-real6410.c | 4 +- arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 3 +- arch/arm/mach-s3c64xx/mach-smartq7.c | 3 +- arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +- arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pc100/Kconfig | 1 + arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 3 +- arch/arm/plat-samsung/include/plat/cpu.h | 5 - arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 51 ++++Quoted 8 lines
.../plat-samsung/{s5p-time.c => samsung-time.c} | 144 +++++------ arch/arm/plat-samsung/time.c | 285 --------------------- 57 files changed, 274 insertions(+), 475 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (68%) delete mode 100644 arch/arm/plat-samsung/time.c
Quoted 8 lines
The whole series looks good to me.
Reviewed-by Tomasz Figa <[email protected]>Also I tested it on a Tiny6410 (Mini6410-compatible) board.
Tested-by Tomasz Figa <[email protected]>
Looks good to me, Romain thanks.
BTW, which one is right "Naour Romain" or "Romain Naour"?
I'm looking at your name both "From: Romain Naour..." and "Signed-off-by:
Naour Romain...".
Tomasz, thanks for your review and test on s3c64xx board.
Heiko, can you test this on your s3c24xx board?
- Kukjin
Re: [PATCH 0/5 v3] S3C / S5PC100: add clockevent/clocksource support
In reply to Romain NaourAm Mittwoch, 9. Januar 2013, 23:43:35 schrieb Romain Naour:
Quoted 9 lines
This series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I had to reduce timers frequency to 1MHz in order to produce a timer's overflow every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to produce an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Quoted 5 lines
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in
s5p-time.c(renamedsamsung-time.c). I added some #define for s3c24xx and s5pc100 case.
not sure, if the ack I added to the previous patches will carry thru, so:
The whole series
and tested on a s3c2416 based machine, so
Quoted 71 lines
Naour Romain (5):
Rename s5p-time to samsung-time
Add samsung-time support for s3c24xx
Add samsung-time support for s3c64xx
Add samsung-time support for s5pc100
Remove unusedplat-samsung/time.carch/arm/Kconfig | 9 +- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm/mach-exynos/mach-universal_c210.c | 6 +- arch/arm/mach-s3c24xx/Kconfig | 6 + arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 +- arch/arm/mach-s3c24xx/mach-anubis.c | 4 +- arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +- arch/arm/mach-s3c24xx/mach-bast.c | 4 +- arch/arm/mach-s3c24xx/mach-gta02.c | 4 +- arch/arm/mach-s3c24xx/mach-h1940.c | 5 +- arch/arm/mach-s3c24xx/mach-jive.c | 4 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +- arch/arm/mach-s3c24xx/mach-n30.c | 6 +- arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +- arch/arm/mach-s3c24xx/mach-osiris.c | 4 +- arch/arm/mach-s3c24xx/mach-otom.c | 4 +- arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +- arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +- arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +- arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +- arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +- arch/arm/mach-s3c24xx/mach-vstms.c | 5 +- arch/arm/mach-s3c64xx/Kconfig | 2 + arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +- arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +- arch/arm/mach-s3c64xx/mach-hmt.c | 4 +- arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +- arch/arm/mach-s3c64xx/mach-ncp.c | 4 +- arch/arm/mach-s3c64xx/mach-real6410.c | 4 +- arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 3 +- arch/arm/mach-s3c64xx/mach-smartq7.c | 3 +- arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +- arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +- arch/arm/mach-s5p64x0/Kconfig | 4 +- arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +- arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +- arch/arm/mach-s5pc100/Kconfig | 1 + arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +- arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/mach-aquila.c | 6 +- arch/arm/mach-s5pv210/mach-goni.c | 6 +- arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +- arch/arm/mach-s5pv210/mach-torbreck.c | 6 +- arch/arm/plat-samsung/Kconfig | 2 +- arch/arm/plat-samsung/Makefile | 3 +- arch/arm/plat-samsung/include/plat/cpu.h | 5 - arch/arm/plat-samsung/include/plat/s5p-time.h | 40 --- arch/arm/plat-samsung/include/plat/samsung-time.h | 51 ++++ .../plat-samsung/{s5p-time.c => samsung-time.c} | 144 +++++------ arch/arm/plat-samsung/time.c | 285 --------------------- 57 files changed, 274 insertions(+), 475 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (68%) delete mode 100644 arch/arm/plat-samsung/time.c
RE: [PATCH 0/5 v3] S3C / S5PC100: add clockevent/clocksource support
Quoted 6 lines · Heiko Stübner
Am Mittwoch, 9. Januar 2013, 23:43:35 schrieb Romain Naour:
Quoted 2 lines
This series of patches converts the s3c and s5pc100 timer driver to the clocksource/clockevent API. I made some test on a mini2440 board and I
had
Quoted 1 line
to reduce timers frequency to 1MHz in order to produce a timer's
overflow
Quoted 2 lines
Quoted 2 lines
every 64ms. Initial timer's frequency (8,45MHz) provide only 7ms between each overflow. It is not enough. As timers were previously used to
produce
Quoted 12 lines
Quoted 9 lines
an IRQ at 200Hz, some board (Osiris, Anubis board) use an external 12MHz signal to clock the timers (tclk1). So, I changed their configuration to select internal pclk clock instead, but I can't test it.
Since clockevent/clocksource API becomes available, we can use High Resolution Timer and Tickless mode.
Most of the work is already done in
s5p-time.c(renamedsamsung-time.c). I added some #define for s3c24xx and s5pc100 case.not sure, if the ack I added to the previous patches will carry thru, so:
Quoted 8 lines
The whole series
Acked-by Heiko Stuebner <[email protected]>and tested on a s3c2416 based machine, so
Tested-by Heiko Stuebner <[email protected]>
Thanks for your review and test on s3c2416 board :-)
- Kukjin
PATCH v3 1/5 Rename s5p-time to samsung-time
In reply to Tomasz Figa---
arch/arm/mach-exynos/Kconfig | 2 +-
arch/arm/mach-exynos/mach-universal_c210.c | 6 +-
arch/arm/mach-s5p64x0/Kconfig | 4 +-
arch/arm/mach-s5p64x0/mach-smdk6440.c | 6 +-
arch/arm/mach-s5p64x0/mach-smdk6450.c | 6 +-
arch/arm/mach-s5pv210/Kconfig | 2 +-
arch/arm/mach-s5pv210/mach-aquila.c | 6 +-
arch/arm/mach-s5pv210/mach-goni.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkc110.c | 6 +-
arch/arm/mach-s5pv210/mach-smdkv210.c | 6 +-
arch/arm/mach-s5pv210/mach-torbreck.c | 6 +-
arch/arm/plat-samsung/Kconfig | 2 +-
arch/arm/plat-samsung/Makefile | 2 +-
arch/arm/plat-samsung/include/plat/s5p-time.h | 40 ------
arch/arm/plat-samsung/include/plat/samsung-time.h | 40 ++++++
.../plat-samsung/{s5p-time.c => samsung-time.c} | 136 ++++++++++-----------
16 files changed, 138 insertions(+), 138 deletions(-)
delete mode 100644 arch/arm/plat-samsung/include/plat/s5p-time.h
create mode 100644 arch/arm/plat-samsung/include/plat/samsung-time.h
rename arch/arm/plat-samsung/{s5p-time.c => samsung-time.c} (70%)arch/arm/mach-exynos/Kconfig +1 -1
@@ -281,8 +281,8 @@ config MACH_UNIVERSAL_C210 select S5P_DEV_ONENAND select S5P_DEV_TV select S5P_GPIO_INT - select S5P_HRT select S5P_SETUP_MIPIPHY + select SAMSUNG_HRT help Machine support for Samsung Mobile Universal S5PC210 Reference Board.
arch/arm/mach-exynos/mach-universal_c210.c +3 -3
@@ -42,7 +42,7 @@#include <plat/mfc.h> #include <plat/sdhci.h> #include <plat/fimc-core.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/camport.h> #include <mach/map.h>
@@ -1095,7 +1095,7 @@ static void __init universal_map_io(void)exynos_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (universal_uartcfgs,ARRAY_SIZE (universal_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void s5p_tv_setup (void )
@@ -1154,7 +1154,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") .handle_irq = gic_handle_irq, .init_machine = universal_machine_init, .init_late = exynos_init_late, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &universal_reserve, .restart = exynos4_restart,MACHINE_END
arch/arm/mach-s5p64x0/Kconfig +2 -2
@@ -9,16 +9,16 @@ if ARCH_S5P64X0 config CPU_S5P6440 bool - select S5P_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV + select SAMSUNG_HRT select SAMSUNG_WAKEMASK if PM help Enable S5P6440 CPU support config CPU_S5P6450 bool - select S5P_HRT + select SAMSUNG_HRT select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM
arch/arm/mach-s5p64x0/mach-smdk6440.c +3 -3
@@ -49,7 +49,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -230,7 +230,7 @@ static void __init smdk6440_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6440_uartcfgs,ARRAY_SIZE (smdk6440_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6440_set_lcd_interface (void )
@@ -275,6 +275,6 @@ MACHINE_START(SMDK6440, "SMDK6440") .handle_irq = vic_handle_irq, .map_io = smdk6440_map_io, .init_machine = smdk6440_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5p64x0/mach-smdk6450.c +3 -3
@@ -49,7 +49,7 @@#include <plat/pll.h> #include <plat/adc.h> #include <linux/platform_data/touchscreen-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/fb.h> #include <plat/sdhci.h>
@@ -249,7 +249,7 @@ static void __init smdk6450_map_io(void)s5p64x0_init_io (NULL ,0 );s3c24xx_init_clocks (19200000 );s3c24xx_init_uarts (smdk6450_uartcfgs,ARRAY_SIZE (smdk6450_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void s5p6450_set_lcd_interface (void )
@@ -294,6 +294,6 @@ MACHINE_START(SMDK6450, "SMDK6450") .handle_irq = vic_handle_irq, .map_io = smdk6450_map_io, .init_machine = smdk6450_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5p64x0_restart,MACHINE_END
arch/arm/mach-s5pv210/Kconfig +1 -1
@@ -12,10 +12,10 @@ if ARCH_S5PV210 config CPU_S5PV210 bool select S5P_EXT_INT - select S5P_HRT select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV + select SAMSUNG_HRT help Enable S5PV210 CPU support
arch/arm/mach-s5pv210/mach-aquila.c +3 -3
@@ -39,7 +39,7 @@#include <plat/fb.h> #include <plat/fimc-core.h> #include <plat/sdhci.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -652,7 +652,7 @@ static void __init aquila_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (aquila_uartcfgs,ARRAY_SIZE (aquila_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init aquila_machine_init (void )
@@ -688,6 +688,6 @@ MACHINE_START(AQUILA, "Aquila") .handle_irq = vic_handle_irq, .map_io = aquila_map_io, .init_machine = aquila_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-goni.c +3 -3
@@ -48,7 +48,7 @@#include <plat/keypad.h> #include <plat/sdhci.h> #include <plat/clock.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include <plat/camport.h>
@@ -909,7 +909,7 @@ static void __init goni_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (goni_uartcfgs,ARRAY_SIZE (goni_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init goni_reserve (void )
@@ -975,7 +975,7 @@ MACHINE_START(GONI, "GONI") .handle_irq = vic_handle_irq, .map_io = goni_map_io, .init_machine = goni_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .reserve = &goni_reserve, .restart = s5pv210_restart,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkc110.c +3 -3
@@ -30,7 +30,7 @@#include <linux/platform_data/ata-samsung_cf.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/mfc.h> #include "common.h"
@@ -121,7 +121,7 @@ static void __init smdkc110_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc110_reserve (void )
@@ -155,7 +155,7 @@ MACHINE_START(SMDKC110, "SMDKC110") .handle_irq = vic_handle_irq, .map_io = smdkc110_map_io, .init_machine = smdkc110_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkc110_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-smdkv210.c +3 -3
@@ -45,7 +45,7 @@#include <plat/keypad.h> #include <plat/pm.h> #include <plat/fb.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include <plat/backlight.h> #include <plat/mfc.h> #include <plat/clock.h>
@@ -286,7 +286,7 @@ static void __init smdkv210_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (clk_xusbxti.rate);s3c24xx_init_uarts (smdkv210_uartcfgs,ARRAY_SIZE (smdkv210_uartcfgs)); -s5p_set_timer_source (S5P_PWM2 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM2 ,SAMSUNG_PWM4 ); }static void __init smdkv210_reserve (void )
@@ -331,7 +331,7 @@ MACHINE_START(SMDKV210, "SMDKV210") .handle_irq = vic_handle_irq, .map_io = smdkv210_map_io, .init_machine = smdkv210_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart, .reserve = &smdkv210_reserve,MACHINE_END
arch/arm/mach-s5pv210/mach-torbreck.c +3 -3
@@ -27,7 +27,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> -#include <plat/s5p-time.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -107,7 +107,7 @@ static void __init torbreck_map_io(void)s5pv210_init_io (NULL ,0 );s3c24xx_init_clocks (24000000 );s3c24xx_init_uarts (torbreck_uartcfgs,ARRAY_SIZE (torbreck_uartcfgs)); -s5p_set_timer_source (S5P_PWM3 ,S5P_PWM4 ); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init torbreck_machine_init (void )
@@ -132,6 +132,6 @@ MACHINE_START(TORBRECK, "TORBRECK") .handle_irq = vic_handle_irq, .map_io = torbreck_map_io, .init_machine = torbreck_machine_init, - .timer = &s5p_timer, + .timer = &samsung_timer, .restart = s5pv210_restart,MACHINE_END
arch/arm/plat-samsung/Kconfig +1 -1
@@ -70,7 +70,7 @@ config S3C_LOWLEVEL_UART_PORT # timer options -config S5P_HRT +config SAMSUNG_HRT bool select SAMSUNG_DEV_PWM help
arch/arm/plat-samsung/Makefile +1 -1
@@ -13,7 +13,7 @@ obj- := obj-y += init.o cpu.o obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o -obj-$(CONFIG_S5P_HRT) += s5p-time.o +obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o
arch/arm/plat-samsung/include/plat/s5p-time.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h -* -* Copyright 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com/ -* -* Header file for s5p time support -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_PLAT_S5P_TIME_H -#define __ASM_PLAT_S5P_TIME_H __FILE__ - -/* S5P HR-Timer Clock mode */ -enum s5p_timer_mode { -S5P_PWM0 , -S5P_PWM1 , -S5P_PWM2 , -S5P_PWM3 , -S5P_PWM4 , -}; - -struct s5p_timer_source { -unsigned int event_id; -unsigned int source_id; -}; - -/* Be able to sleep for atleast 4 seconds (usually more) */ -#define S5PTIMER_MIN_RANGE 4 - -#define TCNT_MAX 0xffffffff -#define NON_PERIODIC 0 -#define PERIODIC 1 - -extern void __init s5p_set_timer_source (enum s5p_timer_mode event, -enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; -#endif /* __ASM_PLAT_S5P_TIME_H */
arch/arm/plat-samsung/include/plat/samsung-time.h new file +40 -0
@@ -0,0 +1,40 @@ +/* linux/arch/arm/plat-samsung/include/plat/samsung-time.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Header file for samsung s3c and s5p time support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_PLAT_SAMSUNG_TIME_H +#define __ASM_PLAT_SAMSUNG_TIME_H __FILE__ + +/* SAMSUNG HR-Timer Clock mode */ +enum samsung_timer_mode { +SAMSUNG_PWM0 , +SAMSUNG_PWM1 , +SAMSUNG_PWM2 , +SAMSUNG_PWM3 , +SAMSUNG_PWM4 , +}; + +struct samsung_timer_source { +unsigned int event_id; +unsigned int source_id; +}; + +/* Be able to sleep for atleast 4 seconds (usually more) */ +#define SAMSUNG_TIMER_MIN_RANGE 4 + +#define TCNT_MAX 0xffffffff +#define NON_PERIODIC 0 +#define PERIODIC 1 + +extern void __init samsung_set_timer_source (enum samsung_timer_mode event, +enum samsung_timer_mode source); +extern struct sys_timer samsung_timer; +#endif /* __ASM_PLAT_SAMSUNG_TIME_H */
arch/arm/plat-samsung/samsung-time.c renamed from arch/arm/plat-samsung/s5p-time.c +68 -68
343 lines not on this page · raw message
Signature · 1 line
1.8.0.3
PATCH v3 2/5 Add samsung-time support for s3c24xx
In reply to Tomasz Figa--- arch/arm/Kconfig | 3 ++- arch/arm/mach-s3c24xx/Kconfig | 6 ++++++ arch/arm/mach-s3c24xx/mach-amlm5900.c | 5 ++++- arch/arm/mach-s3c24xx/mach-anubis.c | 4 +++- arch/arm/mach-s3c24xx/mach-at2440evb.c | 4 +++- arch/arm/mach-s3c24xx/mach-bast.c | 4 +++- arch/arm/mach-s3c24xx/mach-gta02.c | 4 +++- arch/arm/mach-s3c24xx/mach-h1940.c | 5 +++-- arch/arm/mach-s3c24xx/mach-jive.c | 4 +++- arch/arm/mach-s3c24xx/mach-mini2440.c | 4 +++- arch/arm/mach-s3c24xx/mach-n30.c | 6 ++++-- arch/arm/mach-s3c24xx/mach-nexcoder.c | 4 +++- arch/arm/mach-s3c24xx/mach-osiris.c | 4 +++- arch/arm/mach-s3c24xx/mach-otom.c | 4 +++- arch/arm/mach-s3c24xx/mach-qt2410.c | 4 +++- arch/arm/mach-s3c24xx/mach-rx1950.c | 4 +++- arch/arm/mach-s3c24xx/mach-rx3715.c | 4 +++- arch/arm/mach-s3c24xx/mach-smdk2410.c | 4 +++- arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +++++--- arch/arm/mach-s3c24xx/mach-smdk2416.c | 4 +++- arch/arm/mach-s3c24xx/mach-smdk2440.c | 4 +++- arch/arm/mach-s3c24xx/mach-smdk2443.c | 4 +++- arch/arm/mach-s3c24xx/mach-tct_hammer.c | 4 +++- arch/arm/mach-s3c24xx/mach-vr1000.c | 4 +++- arch/arm/mach-s3c24xx/mach-vstms.c | 5 +++-- arch/arm/plat-samsung/include/plat/cpu.h | 2 +- arch/arm/plat-samsung/include/plat/samsung-time.h | 11 +++++++++++ arch/arm/plat-samsung/samsung-time.c | 12 ++++++------ 28 files changed, 99 insertions(+), 36 deletions(-)
arch/arm/Kconfig +2 -1
@@ -743,8 +743,9 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET select CLKDEV_LOOKUP + select CLKSRC_MMIO + select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK select HAVE_S3C2410_I2C if I2C
arch/arm/mach-s3c24xx/Kconfig +6 -0
@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.
@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line
@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.
@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.
@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX line
arch/arm/mach-s3c24xx/mach-amlm5900.c +4 -1
@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =
@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef CONFIG_FB_S3C2410
@@ -237,6 +240,6 @@ MACHINE_START(AML_M5900, "AML_M5900") .map_io = amlm5900_map_io, .init_irq = s3c24xx_init_irq, .init_machine = amlm5900_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-anubis.c +3 -1
@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "anubis.h" #include "common.h"
@@ -411,6 +412,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
@@ -445,6 +447,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") .map_io = anubis_map_io, .init_machine = anubis_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-at2440evb.c +3 -1
@@ -49,6 +49,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -193,6 +194,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init at2440evb_init (void )
@@ -211,6 +213,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB") .map_io = at2440evb_map_io, .init_machine = at2440evb_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-bast.c +3 -1
@@ -56,6 +56,7 @@#include <plat/devs.h> #include <plat/gpio-cfg.h> #include <plat/regs-serial.h> +#include <plat/samsung-time.h> #include "bast.h" #include "common.h"
@@ -577,6 +578,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )
@@ -606,6 +608,6 @@ MACHINE_START(BAST, "Simtec-BAST") .map_io = bast_map_io, .init_irq = s3c24xx_init_irq, .init_machine = bast_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-gta02.c +3 -1
@@ -82,6 +82,7 @@#include <plat/gpio-cfg.h> #include <plat/pm.h> #include <plat/regs-serial.h> +#include <plat/samsung-time.h> #include "common.h" #include "gta02.h"
@@ -502,6 +503,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }
@@ -590,6 +592,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02") .map_io = gta02_map_io, .init_irq = s3c24xx_init_irq, .init_machine = gta02_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-h1940.c +3 -2
@@ -62,7 +62,7 @@#include <plat/pll.h> #include <plat/pm.h> #include <plat/regs-serial.h> - +#include <plat/samsung-time.h> #include "common.h" #include "h1940.h"
@@ -646,6 +646,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
@@ -741,6 +742,6 @@ MACHINE_START(H1940, "IPAQ-H1940") .reserve = h1940_reserve, .init_irq = h1940_init_irq, .init_machine = h1940_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-jive.c +3 -1
@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };
@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )
@@ -661,6 +663,6 @@ MACHINE_START(JIVE, "JIVE") .init_irq = s3c24xx_init_irq, .map_io = jive_map_io, .init_machine = jive_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-mini2440.c +3 -1
@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h>
@@ -526,6 +527,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/*
@@ -688,6 +690,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-n30.c +4 -2
@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */
@@ -589,7 +591,7 @@ MACHINE_START(N30, "Acer-N30")Ben Dooks <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,
@@ -600,7 +602,7 @@ MACHINE_START(N35, "Acer-N35")/* Maintainer: Christer Weinigel <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,
arch/arm/mach-s3c24xx/mach-nexcoder.c +3 -1
@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init (); }
@@ -153,6 +155,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") .map_io = nexcoder_map_io, .init_machine = nexcoder_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-osiris.c +3 -1
@@ -44,6 +44,7 @@#include <plat/devs.h> #include <plat/gpio-cfg.h> #include <plat/regs-serial.h> +#include <plat/samsung-timer.h> #include <mach/hardware.h> #include <mach/regs-gpio.h>
@@ -383,6 +384,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
@@ -425,6 +427,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .map_io = osiris_map_io, .init_irq = s3c24xx_init_irq, .init_machine = osiris_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-otom.c +3 -1
@@ -34,6 +34,7 @@#include <plat/devs.h> #include <plat/regs-serial.h> #include <plat/s3c2410.h> +#include <plat/samsung-time.h> #include "common.h" #include "otom.h"
@@ -102,6 +103,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )
@@ -116,6 +118,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") .map_io = otom11_map_io, .init_machine = otom11_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-qt2410.c +3 -1
@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init qt2410_machine_init (void )
@@ -343,6 +345,6 @@ MACHINE_START(QT2410, "QT2410") .map_io = qt2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = qt2410_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx1950.c +3 -1
@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/regs-iic.h> #include <plat/regs-serial.h> +#include <plat/samsung-time.h> #include "common.h" #include "h1940.h"
@@ -741,6 +742,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
@@ -813,6 +815,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") .reserve = rx1950_reserve, .init_irq = s3c24xx_init_irq, .init_machine = rx1950_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx3715.c +3 -1
@@ -49,6 +49,7 @@#include <plat/devs.h> #include <plat/pm.h> #include <plat/regs-serial.h> +#include <plat/samsung-time.h> #include "common.h" #include "h1940.h"
@@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */
@@ -212,6 +214,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715") .reserve = rx3715_reserve, .init_irq = rx3715_init_irq, .init_machine = rx3715_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2410.c +3 -1
@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2410_init (void )
@@ -117,6 +119,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc .map_io = smdk2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = smdk2410_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2413.c +5 -3
@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -106,6 +107,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2413_machine_init (void )
@@ -132,7 +134,7 @@ MACHINE_START(S3C2413, "S3C2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
@@ -144,7 +146,7 @@ MACHINE_START(SMDK2412, "SMDK2412") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
@@ -156,6 +158,6 @@ MACHINE_START(SMDK2413, "SMDK2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2416.c +3 -1
@@ -51,6 +51,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h>
@@ -221,6 +222,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2416_machine_init (void )
@@ -253,6 +255,6 @@ MACHINE_START(SMDK2416, "SMDK2416") .init_irq = s3c24xx_init_irq, .map_io = smdk2416_map_io, .init_machine = smdk2416_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2416_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2440.c +3 -1
@@ -43,6 +43,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -163,6 +164,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2440_machine_init (void )
@@ -181,6 +183,6 @@ MACHINE_START(S3C2440, "SMDK2440") .init_irq = s3c24xx_init_irq, .map_io = smdk2440_map_io, .init_machine = smdk2440_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2443.c +3 -1
@@ -43,6 +43,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -122,6 +123,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2443_machine_init (void )
@@ -143,6 +145,6 @@ MACHINE_START(SMDK2443, "SMDK2443") .init_irq = s3c24xx_init_irq, .map_io = smdk2443_map_io, .init_machine = smdk2443_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2443_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-tct_hammer.c +3 -1
@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init tct_hammer_init (void )
@@ -149,6 +151,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") .map_io = tct_hammer_map_io, .init_irq = s3c24xx_init_irq, .init_machine = tct_hammer_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vr1000.c +3 -1
@@ -45,6 +45,7 @@#include <plat/cpu.h> #include <plat/devs.h> #include <plat/regs-serial.h> +#include <plat/samsung-time.h> #include "bast.h" #include "common.h"
@@ -332,6 +333,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )
@@ -354,6 +356,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000") .map_io = vr1000_map_io, .init_machine = vr1000_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vstms.c +3 -2
@@ -46,7 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };
@@ -143,6 +143,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )
@@ -160,6 +161,6 @@ MACHINE_START(VSTMS, "VSTMS") .init_irq = s3c24xx_init_irq, .init_machine = vstms_init, .map_io = vstms_map_io, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/plat-samsung/include/plat/cpu.h +1 -1
@@ -192,7 +192,7 @@ extern void s3c24xx_init_uartdevs(char *name,struct s3c24xx_uart_resources *res, struct s3c2410_uartcfg *cfg, int no); -/* timer for 2410/2440 */ +/* timer for s5pc100 only */ struct sys_timer ;extern struct sys_timer s3c24xx_timer;
arch/arm/plat-samsung/include/plat/samsung-time.h +11 -0
@@ -30,7 +30,18 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 +#ifdef CONFIG_ARCH_S3C24XX +#define TCNT_MAX 0xffff +#define TSCALER_DIV 25 +#define TDIV 50 +#define TSIZE 16 +#else #define TCNT_MAX 0xffffffff +#define TSCALER_DIV 2 +#define TDIV 2 +#define TSIZE 32 +#endif +#define NON_PERIODIC 0#define PERIODIC 1
arch/arm/plat-samsung/samsung-time.c +6 -6
@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* SAMSUNG - Common hr-timer support +* samsung - Common hr-timer support (s3c and s5p) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -267,8 +267,8 @@ static void __init samsung_clockevent_init(void) tscaler =clk_get_parent (tdiv_event); -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); +clk_set_rate (tscaler, pclk /TSCALER_DIV ); +clk_set_rate (tdiv_event, pclk /TDIV );clk_set_parent (tin_event, tdiv_event); clock_rate =clk_get_rate (tin_event);
@@ -336,7 +336,7 @@ static void __init samsung_clocksource_init(void) pclk =clk_get_rate (timerclk); -clk_set_rate (tdiv_source, pclk /2 ); +clk_set_rate (tdiv_source, pclk /TDIV );clk_set_parent (tin_source, tdiv_source); clock_rate =clk_get_rate (tin_source);
@@ -344,10 +344,10 @@ static void __init samsung_clocksource_init(void)samsung_time_setup (timer_source.source_id,TCNT_MAX );samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,TSIZE , clock_rate);if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) + clock_rate,250 ,TSIZE , clocksource_mmio_readl_down))panic ("samsung_clocksource_timer: can't register clocksource\n" ); }
Signature · 1 line
1.8.0.3
RE: [PATCH 2/5 v3] Add samsung-time support for s3c24xx
Romain Naour wrote:
[...]
arch/arm/mach-s3c24xx/mach-osiris.c line 47
Quoted 10 lines
arch/arm/mach- renamed from arch/arm/mach-s3c24xx/mach-osiris.c +0
-0
s3c24xx/mach-osiris.c
index 1eeeee4..c9bd133 100644arch/arm/mach-s3c24xx/mach-osiris.c +1
-0@@ -44,6 +44,7 @@#include <plat/devs.h> #include <plat/gpio-cfg.h> #include <plat/regs-serial.h> +#include <plat/samsung-timer.h>
Just note,
Happens build error:
arch/arm/mach-s3c24xx/mach-osiris.c:47:32: fatal error:plat/samsung-timer.h: No such file or directory compilation terminated.
make[2]: *** [arch/arm/mach-s3c24xx/mach-osiris.o] Error 1 make[2]: *** Waiting for unfinished jobs....
So, should be
+#include <plat/samsung-time.h>
I fixed when I applied.
[...]
Thanks.
- Kukjin
PATCH v3 3/5 Add samsung-time support for s3c64xx
In reply to Tomasz Figa--- arch/arm/Kconfig | 3 ++- arch/arm/mach-s3c64xx/Kconfig | 2 ++ arch/arm/mach-s3c64xx/mach-anw6410.c | 4 +++- arch/arm/mach-s3c64xx/mach-crag6410.c | 4 +++- arch/arm/mach-s3c64xx/mach-hmt.c | 4 +++- arch/arm/mach-s3c64xx/mach-mini6410.c | 4 +++- arch/arm/mach-s3c64xx/mach-ncp.c | 4 +++- arch/arm/mach-s3c64xx/mach-real6410.c | 4 +++- arch/arm/mach-s3c64xx/mach-smartq.c | 2 ++ arch/arm/mach-s3c64xx/mach-smartq5.c | 3 ++- arch/arm/mach-s3c64xx/mach-smartq7.c | 3 ++- arch/arm/mach-s3c64xx/mach-smdk6400.c | 4 +++- arch/arm/mach-s3c64xx/mach-smdk6410.c | 4 +++- 13 files changed, 34 insertions(+), 11 deletions(-)
arch/arm/Kconfig +2 -1
@@ -763,10 +763,11 @@ config ARCH_S3C64XX bool "Samsung S3C64XX" select ARCH_HAS_CPUFREQ select ARCH_REQUIRE_GPIOLIB - select ARCH_USES_GETTIMEOFFSET select ARM_VIC select CLKDEV_LOOKUP + select CLKSRC_MMIO select CPU_V6 + select GENERIC_CLOCKEVENTS select HAVE_CLK select HAVE_S3C2410_I2C if I2C select HAVE_S3C2410_WATCHDOG if WATCHDOG
arch/arm/mach-s3c64xx/Kconfig +2 -0
@@ -17,11 +17,13 @@ config PLAT_S3C64XX # Configuration options for the S3C6410 CPU config CPU_S3C6400 + select SAMSUNG_HRT bool help Enable S3C6400 CPU support config CPU_S3C6410 + select SAMSUNG_HRT bool help Enable S3C6410 CPU support
arch/arm/mach-s3c64xx/mach-anw6410.c +3 -1
@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <mach/regs-gpio.h> +#include <plat/samsung-time.h> #include "common.h" #include "regs-modem.h"
@@ -209,6 +210,7 @@ static void __init anw6410_map_io(void)s3c64xx_init_io (anw6410_iodesc,ARRAY_SIZE (anw6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (anw6410_uartcfgs,ARRAY_SIZE (anw6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );anw6410_lcd_mode_set (); }
@@ -234,6 +236,6 @@ MACHINE_START(ANW6410, "A&W6410") .map_io = anw6410_map_io, .init_machine = anw6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-crag6410.c +3 -1
@@ -65,6 +65,7 @@#include <plat/adc.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" #include "crag6410.h"
@@ -745,6 +746,7 @@ static void __init crag6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (crag6410_uartcfgs,ARRAY_SIZE (crag6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* LCD type and Bypass set by bootloader */ }
@@ -870,6 +872,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410") .map_io = crag6410_map_io, .init_machine = crag6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-hmt.c +3 -1
@@ -42,6 +42,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -249,6 +250,7 @@ static void __init hmt_map_io(void)s3c64xx_init_io (hmt_iodesc,ARRAY_SIZE (hmt_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (hmt_uartcfgs,ARRAY_SIZE (hmt_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init hmt_machine_init (void )
@@ -277,6 +279,6 @@ MACHINE_START(HMT, "Airgoo-HMT") .map_io = hmt_map_io, .init_machine = hmt_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-mini6410.c +3 -1
@@ -42,6 +42,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h" #include "regs-modem.h"
@@ -233,6 +234,7 @@ static void __init mini6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini6410_uartcfgs,ARRAY_SIZE (mini6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
@@ -356,6 +358,6 @@ MACHINE_START(MINI6410, "MINI6410") .map_io = mini6410_map_io, .init_machine = mini6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-ncp.c +3 -1
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -88,6 +89,7 @@ static void __init ncp_map_io(void)s3c64xx_init_io (ncp_iodesc,ARRAY_SIZE (ncp_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (ncp_uartcfgs,ARRAY_SIZE (ncp_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init ncp_machine_init (void )
@@ -105,6 +107,6 @@ MACHINE_START(NCP, "NCP") .map_io = ncp_map_io, .init_machine = ncp_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-real6410.c +3 -1
@@ -43,6 +43,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h" #include "regs-modem.h"
@@ -212,6 +213,7 @@ static void __init real6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (real6410_uartcfgs,ARRAY_SIZE (real6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
@@ -335,6 +337,6 @@ MACHINE_START(REAL6410, "REAL6410") .map_io = real6410_map_io, .init_machine = real6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq.c +2 -0
@@ -38,6 +38,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <video/platform_lcd.h> +#include <plat/samsung-time.h> #include "common.h" #include "regs-modem.h"
@@ -378,6 +379,7 @@ void __init smartq_map_io(void)s3c64xx_init_io (smartq_iodesc,ARRAY_SIZE (smartq_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smartq_uartcfgs,ARRAY_SIZE (smartq_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );smartq_lcd_mode_set (); }
arch/arm/mach-s3c64xx/mach-smartq5.c +2 -1
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
@@ -157,6 +158,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5") .map_io = smartq_map_io, .init_machine = smartq5_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq7.c +2 -1
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
@@ -173,6 +174,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7") .map_io = smartq_map_io, .init_machine = smartq7_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6400.c +3 -1
@@ -36,6 +36,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -67,6 +68,7 @@ static void __init smdk6400_map_io(void)s3c64xx_init_io (smdk6400_iodesc,ARRAY_SIZE (smdk6400_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6400_uartcfgs,ARRAY_SIZE (smdk6400_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static struct platform_device *smdk6400_devices[]__initdata = {
@@ -94,6 +96,6 @@ MACHINE_START(SMDK6400, "SMDK6400") .map_io = smdk6400_map_io, .init_machine = smdk6400_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6410.c +3 -1
@@ -70,6 +70,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <plat/keypad.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h" #include "regs-modem.h"
@@ -635,6 +636,7 @@ static void __init smdk6410_map_io(void)s3c64xx_init_io (smdk6410_iodesc,ARRAY_SIZE (smdk6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6410_uartcfgs,ARRAY_SIZE (smdk6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */
@@ -704,6 +706,6 @@ MACHINE_START(SMDK6410, "SMDK6410") .map_io = smdk6410_map_io, .init_machine = smdk6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
Signature · 1 line
1.8.0.3
PATCH v3 4/5 Add samsung-time support for s5pc100
In reply to Tomasz Figa--- arch/arm/Kconfig | 3 ++- arch/arm/mach-s5pc100/Kconfig | 1 + arch/arm/mach-s5pc100/mach-smdkc100.c | 4 +++- arch/arm/plat-samsung/include/plat/samsung-time.h | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/Kconfig +2 -1
@@ -802,9 +802,10 @@ config ARCH_S5P64X0 config ARCH_S5PC100 bool "Samsung S5PC100" - select ARCH_USES_GETTIMEOFFSET select CLKDEV_LOOKUP + select CLKSRC_MMIO select CPU_V7 + select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK select HAVE_S3C2410_I2C if I2C
arch/arm/mach-s5pc100/Kconfig +1 -0
@@ -11,6 +11,7 @@ config CPU_S5PC100 bool select S5P_EXT_INT select SAMSUNG_DMADEV + select SAMSUNG_HRT help Enable S5PC100 CPU support
arch/arm/mach-s5pc100/mach-smdkc100.c +3 -1
@@ -52,6 +52,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <linux/platform_data/asoc-s3c.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -222,6 +223,7 @@ static void __init smdkc100_map_io(void)s5pc100_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdkc100_uartcfgs,ARRAY_SIZE (smdkc100_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc100_machine_init (void )
@@ -257,6 +259,6 @@ MACHINE_START(SMDKC100, "SMDKC100") .handle_irq = vic_handle_irq, .map_io = smdkc100_map_io, .init_machine = smdkc100_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s5pc100_restart,MACHINE_END
arch/arm/plat-samsung/include/plat/samsung-time.h +1 -1
@@ -30,7 +30,7 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 -#ifdef CONFIG_ARCH_S3C24XX +#if defined(CONFIG_ARCH_S3C24XX ) || defined(CONFIG_ARCH_S5PC100 )#define TCNT_MAX 0xffff#define TSCALER_DIV 25#define TDIV 50
Signature · 1 line
1.8.0.3
PATCH v3 5/5 Remove unused plat-samsung/time.c
In reply to Tomasz Figa--- arch/arm/plat-samsung/Makefile | 1 - arch/arm/plat-samsung/include/plat/cpu.h | 5 - arch/arm/plat-samsung/time.c | 285 ------------------------------- 3 files changed, 291 deletions(-) delete mode 100644 arch/arm/plat-samsung/time.c
arch/arm/plat-samsung/Makefile +0 -1
@@ -12,7 +12,6 @@ obj- := # Objects we always build independent of SoC choice obj-y += init.o cpu.o -obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o
arch/arm/plat-samsung/include/plat/cpu.h +0 -5
@@ -192,11 +192,6 @@ extern void s3c24xx_init_uartdevs(char *name,struct s3c24xx_uart_resources *res, struct s3c2410_uartcfg *cfg, int no); -/* timer for s5pc100 only */ - -struct sys_timer ; -extern struct sys_timer s3c24xx_timer; -extern struct syscore_ops s3c2410_pm_syscore_ops;extern struct syscore_ops s3c2412_pm_syscore_ops;extern struct syscore_ops s3c2416_pm_syscore_ops;
arch/arm/plat-samsung/time.c deleted +0 -285
285 lines not on this page · raw message
Signature · 1 line
1.8.0.3
PATCH v2 2/5 Add samsung-time support for s3c24xx
In reply to Heiko StübnerThis patch replace ARCH_USES_GETTIMEOFFSET by GENERIC_CLOCKEVENTS for s3c24xx devices. It becomes possible to use the high-resolution timer and dynamic ticks.
arch/arm/Kconfig +2 -1
@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLK
arch/arm/mach-s3c24xx/Kconfig +6 -0
@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.
@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line
@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.
@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.
@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX line
arch/arm/mach-s3c24xx/mach-amlm5900.c +4 -1
@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =
@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef CONFIG_FB_S3C2410
@@ -237,6 +240,6 @@ MACHINE_START(AML_M5900, "AML_M5900") .map_io = amlm5900_map_io, .init_irq = s3c24xx_init_irq, .init_machine = amlm5900_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-anubis.c +3 -1
@@ -54,6 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -414,6 +415,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
@@ -448,6 +450,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") .map_io = anubis_map_io, .init_machine = anubis_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-at2440evb.c +3 -1
@@ -48,6 +48,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -192,6 +193,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init at2440evb_init (void )
@@ -210,6 +212,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB") .map_io = at2440evb_map_io, .init_machine = at2440evb_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-bast.c +3 -1
@@ -63,6 +63,7 @@#include <plat/cpu-freq.h> #include <plat/gpio-cfg.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -583,6 +584,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )
@@ -612,6 +614,6 @@ MACHINE_START(BAST, "Simtec-BAST") .map_io = bast_map_io, .init_irq = s3c24xx_init_irq, .init_machine = bast_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-gta02.c +3 -1
@@ -88,6 +88,7 @@#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -507,6 +508,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }
@@ -596,6 +598,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02") .map_io = gta02_map_io, .init_irq = s3c24xx_init_irq, .init_machine = gta02_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-h1940.c +3 -1
@@ -67,6 +67,7 @@#include <plat/pm.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h>
@@ -652,6 +653,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
@@ -747,6 +749,6 @@ MACHINE_START(H1940, "IPAQ-H1940") .reserve = h1940_reserve, .init_irq = h1940_init_irq, .init_machine = h1940_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-jive.c +3 -1
@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };
@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )
@@ -661,6 +663,6 @@ MACHINE_START(JIVE, "JIVE") .init_irq = s3c24xx_init_irq, .map_io = jive_map_io, .init_machine = jive_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-mini2440.c +3 -1
@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h>
@@ -527,6 +528,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/*
@@ -689,6 +691,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-n30.c +4 -2
@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */
@@ -589,7 +591,7 @@ MACHINE_START(N30, "Acer-N30")Ben Dooks <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,
@@ -600,7 +602,7 @@ MACHINE_START(N35, "Acer-N35")/* Maintainer: Christer Weinigel <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,
arch/arm/mach-s3c24xx/mach-nexcoder.c +3 -1
@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init (); }
@@ -153,6 +155,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") .map_io = nexcoder_map_io, .init_machine = nexcoder_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-osiris.c +3 -1
@@ -53,6 +53,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -386,6 +387,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */
@@ -428,6 +430,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .map_io = osiris_map_io, .init_irq = s3c24xx_init_irq, .init_machine = osiris_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-otom.c +3 -1
@@ -37,6 +37,7 @@#include <plat/devs.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -104,6 +105,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )
@@ -118,6 +120,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") .map_io = otom11_map_io, .init_machine = otom11_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-qt2410.c +3 -1
@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init qt2410_machine_init (void )
@@ -343,6 +345,6 @@ MACHINE_START(QT2410, "QT2410") .map_io = qt2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = qt2410_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx1950.c +3 -1
@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/irq.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h>
@@ -743,6 +744,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */
@@ -815,6 +817,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") .reserve = rx1950_reserve, .init_irq = s3c24xx_init_irq, .init_machine = rx1950_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-rx3715.c +3 -1
@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */
@@ -212,6 +214,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715") .reserve = rx3715_reserve, .init_irq = rx3715_init_irq, .init_machine = rx3715_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2410.c +3 -1
@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2410_init (void )
@@ -117,6 +119,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc .map_io = smdk2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = smdk2410_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2413.c +5 -3
@@ -47,6 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -107,6 +108,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2413_machine_init (void )
@@ -133,7 +135,7 @@ MACHINE_START(S3C2413, "S3C2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
@@ -145,7 +147,7 @@ MACHINE_START(SMDK2412, "SMDK2412") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
@@ -157,6 +159,6 @@ MACHINE_START(SMDK2413, "SMDK2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2416.c +3 -1
@@ -52,6 +52,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h>
@@ -222,6 +223,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2416_machine_init (void )
@@ -254,6 +256,6 @@ MACHINE_START(SMDK2416, "SMDK2416") .init_irq = s3c24xx_init_irq, .map_io = smdk2416_map_io, .init_machine = smdk2416_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2416_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2440.c +3 -1
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -164,6 +165,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2440_machine_init (void )
@@ -182,6 +184,6 @@ MACHINE_START(S3C2440, "SMDK2440") .init_irq = s3c24xx_init_irq, .map_io = smdk2440_map_io, .init_machine = smdk2440_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-smdk2443.c +3 -1
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h>
@@ -123,6 +124,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2443_machine_init (void )
@@ -144,6 +146,6 @@ MACHINE_START(SMDK2443, "SMDK2443") .init_irq = s3c24xx_init_irq, .map_io = smdk2443_map_io, .init_machine = smdk2443_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2443_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-tct_hammer.c +3 -1
@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init tct_hammer_init (void )
@@ -149,6 +151,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") .map_io = tct_hammer_map_io, .init_irq = s3c24xx_init_irq, .init_machine = tct_hammer_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vr1000.c +3 -1
@@ -50,6 +50,7 @@#include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h"
@@ -335,6 +336,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )
@@ -357,6 +359,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000") .map_io = vr1000_map_io, .init_machine = vr1000_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END
arch/arm/mach-s3c24xx/mach-vstms.c +3 -2
@@ -47,7 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };
@@ -144,6 +144,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )
@@ -161,6 +162,6 @@ MACHINE_START(VSTMS, "VSTMS") .init_irq = s3c24xx_init_irq, .init_machine = vstms_init, .map_io = vstms_map_io, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END
arch/arm/plat-samsung/include/plat/cpu.h +1 -1
@@ -184,7 +184,7 @@ extern void s3c24xx_init_uartdevs(char *name,struct s3c24xx_uart_resources *res, struct s3c2410_uartcfg *cfg, int no); -/* timer for 2410/2440 */ +/* timer for s5pc100 only */ struct sys_timer ;extern struct sys_timer s3c24xx_timer;
arch/arm/plat-samsung/include/plat/samsung-time.h +11 -0
@@ -30,7 +30,18 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 +#ifdef CONFIG_ARCH_S3C24XX +#define TCNT_MAX 0xffff +#define TSCALER_DIV 25 +#define TDIV 50 +#define TSIZE 16 +#else #define TCNT_MAX 0xffffffff +#define TSCALER_DIV 2 +#define TDIV 2 +#define TSIZE 32 +#endif +#define NON_PERIODIC 0#define PERIODIC 1
arch/arm/plat-samsung/samsung-time.c +6 -6
@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* SAMSUNG - Common hr-timer support +* samsung - Common hr-timer support (s3c and s5p) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -267,8 +267,8 @@ static void __init samsung_clockevent_init(void) tscaler =clk_get_parent (tdiv_event); -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); +clk_set_rate (tscaler, pclk /TSCALER_DIV ); +clk_set_rate (tdiv_event, pclk /TDIV );clk_set_parent (tin_event, tdiv_event); clock_rate =clk_get_rate (tin_event);
@@ -336,7 +336,7 @@ static void __init samsung_clocksource_init(void) pclk =clk_get_rate (timerclk); -clk_set_rate (tdiv_source, pclk /2 ); +clk_set_rate (tdiv_source, pclk /TDIV );clk_set_parent (tin_source, tdiv_source); clock_rate =clk_get_rate (tin_source);
@@ -344,10 +344,10 @@ static void __init samsung_clocksource_init(void)samsung_time_setup (timer_source.source_id,TCNT_MAX );samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,TSIZE , clock_rate);if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) + clock_rate,250 ,TSIZE , clocksource_mmio_readl_down))panic ("samsung_clocksource_timer: can't register clocksource\n" ); }
Re: [PATCH 2/5 v2] Add samsung-time support for s3c24xx
Am Sonntag, 2. Dezember 2012, 20:44:09 schrieb Romain Naour:
Quoted 6 lines
This patch replace
ARCH_USES_GETTIMEOFFSETbyGENERIC_CLOCKEVENTSfor s3c24xx devices. It becomes possible to use the high-resolution timer and dynamic ticks.Signed-off-by Naour Romain <[email protected]>
on a s3c2416 based board
Quoted 823 lines
arch/arm/Kconfig +2
-1@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLKarch/arm/mach-s3c24xx/Kconfig +6
-0@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX line(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-amlm5900.cindex f4ad99c..84c9bb0 100644arch/arm/mach-s3c24xx/mach-amlm5900.c +4
-1@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef CONFIG_FB_S3C2410 @@ -237,6 +240,6 @@ MACHINE_START(AML_M5900, "AML_M5900") .map_io = amlm5900_map_io, .init_irq = s3c24xx_init_irq, .init_machine = amlm5900_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-anubis.cindex 1ee8c46..65ba844 100644arch/arm/mach-s3c24xx/mach-anubis.c +3
-1@@ -54,6 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -414,6 +415,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ @@ -448,6 +450,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") .map_io = anubis_map_io, .init_machine = anubis_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-at2440evb.cindex 00381fe..d7eb641 100644arch/arm/mach-s3c24xx/mach-at2440evb.c +3
-1@@ -48,6 +48,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h" @@ -192,6 +193,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init at2440evb_init (void )@@ -210,6 +212,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB") .map_io = at2440evb_map_io, .init_machine = at2440evb_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-bast.cindex 6a30ce7..a9c442e 100644arch/arm/mach-s3c24xx/mach-bast.c +3
-1@@ -63,6 +63,7 @@#include <plat/cpu-freq.h> #include <plat/gpio-cfg.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -583,6 +584,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )@@ -612,6 +614,6 @@ MACHINE_START(BAST, "Simtec-BAST") .map_io = bast_map_io, .init_irq = s3c24xx_init_irq, .init_machine = bast_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-gta02.cindex 4a96346..02c6c6a 100644arch/arm/mach-s3c24xx/mach-gta02.c +3
-1@@ -88,6 +88,7 @@#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h" @@ -507,6 +508,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }@@ -596,6 +598,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02") .map_io = gta02_map_io, .init_irq = s3c24xx_init_irq, .init_machine = gta02_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-h1940.cindex 63aaf07..f5d3578 100644arch/arm/mach-s3c24xx/mach-h1940.c +3
-1@@ -67,6 +67,7 @@#include <plat/pm.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -652,6 +653,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ @@ -747,6 +749,6 @@ MACHINE_START(H1940, "IPAQ-H1940") .reserve = h1940_reserve, .init_irq = h1940_init_irq, .init_machine = h1940_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-jive.cindex c9954e2..01a894d 100644arch/arm/mach-s3c24xx/mach-jive.c +3
-1@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )@@ -661,6 +663,6 @@ MACHINE_START(JIVE, "JIVE") .init_irq = s3c24xx_init_irq, .map_io = jive_map_io, .init_machine = jive_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-mini2440.cindex 393c0f1..a96efcd 100644arch/arm/mach-s3c24xx/mach-mini2440.c +3
-1@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h> @@ -527,6 +528,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* @@ -689,6 +691,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-n30.cindex c53a9bf..f6cea03 100644arch/arm/mach-s3c24xx/mach-n30.c +4
-2@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h" @@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */ @@ -589,7 +591,7 @@ MACHINE_START(N30, "Acer-N30")Ben Dooks <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,@@ -600,7 +602,7 @@ MACHINE_START(N35, "Acer-N35")/* Maintainer: Christer Weinigel <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-nexcoder.cindex a2b92b0..4db6fb3 100644arch/arm/mach-s3c24xx/mach-nexcoder.c +3
-1@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init (); }@@ -153,6 +155,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") .map_io = nexcoder_map_io, .init_machine = nexcoder_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-osiris.cindex bb36d83..e85144e 100644arch/arm/mach-s3c24xx/mach-osiris.c +3
-1@@ -53,6 +53,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -386,6 +387,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ @@ -428,6 +430,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .map_io = osiris_map_io, .init_irq = s3c24xx_init_irq, .init_machine = osiris_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-otom.cindex bca39f0..ab5f353 100644arch/arm/mach-s3c24xx/mach-otom.c +3
-1@@ -37,6 +37,7 @@#include <plat/devs.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -104,6 +105,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )@@ -118,6 +120,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") .map_io = otom11_map_io, .init_machine = otom11_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-qt2410.cindex 7b6ba13..e725554 100644arch/arm/mach-s3c24xx/mach-qt2410.c +3
-1@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init qt2410_machine_init (void )@@ -343,6 +345,6 @@ MACHINE_START(QT2410, "QT2410") .map_io = qt2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = qt2410_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-rx1950.cindex 379fde5..63fbeb1 100644arch/arm/mach-s3c24xx/mach-rx1950.c +3
-1@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/irq.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -743,6 +744,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ @@ -815,6 +817,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") .reserve = rx1950_reserve, .init_irq = s3c24xx_init_irq, .init_machine = rx1950_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-rx3715.cindex dacbb9a..1b358a1 100644arch/arm/mach-s3c24xx/mach-rx3715.c +3
-1@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */ @@ -212,6 +214,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715") .reserve = rx3715_reserve, .init_irq = rx3715_init_irq, .init_machine = rx3715_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2410.cindex 82796b9..c7a18bc 100644arch/arm/mach-s3c24xx/mach-smdk2410.c +3
-1@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h" @@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2410_init (void )@@ -117,6 +119,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc .map_io = smdk2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = smdk2410_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2413.cindex ce99fd8..c29c067 100644arch/arm/mach-s3c24xx/mach-smdk2413.c +5
-3@@ -47,6 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -107,6 +108,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2413_machine_init (void )@@ -133,7 +135,7 @@ MACHINE_START(S3C2413, "S3C2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END @@ -145,7 +147,7 @@ MACHINE_START(SMDK2412, "SMDK2412") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END @@ -157,6 +159,6 @@ MACHINE_START(SMDK2413, "SMDK2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2416.cindex f30d7fc..2c0b7a1 100644arch/arm/mach-s3c24xx/mach-smdk2416.c +3
-1@@ -52,6 +52,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h> @@ -222,6 +223,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2416_machine_init (void )@@ -254,6 +256,6 @@ MACHINE_START(SMDK2416, "SMDK2416") .init_irq = s3c24xx_init_irq, .map_io = smdk2416_map_io, .init_machine = smdk2416_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2416_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2440.cindex b7ff882..caf5c04 100644arch/arm/mach-s3c24xx/mach-smdk2440.c +3
-1@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -164,6 +165,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2440_machine_init (void )@@ -182,6 +184,6 @@ MACHINE_START(S3C2440, "SMDK2440") .init_irq = s3c24xx_init_irq, .map_io = smdk2440_map_io, .init_machine = smdk2440_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2443.cindex 2568656..02fcd27 100644arch/arm/mach-s3c24xx/mach-smdk2443.c +3
-1@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -123,6 +124,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2443_machine_init (void )@@ -144,6 +146,6 @@ MACHINE_START(SMDK2443, "SMDK2443") .init_irq = s3c24xx_init_irq, .map_io = smdk2443_map_io, .init_machine = smdk2443_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2443_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-tct_hammer.cindex 495bf5c..90f43c9 100644arch/arm/mach-s3c24xx/mach-tct_hammer.c +3
-1@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h" @@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init tct_hammer_init (void )@@ -149,6 +151,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") .map_io = tct_hammer_map_io, .init_irq = s3c24xx_init_irq, .init_machine = tct_hammer_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-vr1000.cindex 14d5b12..4366c6f 100644arch/arm/mach-s3c24xx/mach-vr1000.c +3
-1@@ -50,6 +50,7 @@#include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -335,6 +336,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )@@ -357,6 +359,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000") .map_io = vr1000_map_io, .init_machine = vr1000_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-vstms.cindex f1d44ae..412d858 100644arch/arm/mach-s3c24xx/mach-vstms.c +3
-2@@ -47,7 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };@@ -144,6 +144,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )@@ -161,6 +162,6 @@ MACHINE_START(VSTMS, "VSTMS") .init_irq = s3c24xx_init_irq, .init_machine = vstms_init, .map_io = vstms_map_io, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/cpu.hindex ace4451..86fb5f3 100644arch/arm/plat-samsung/include/plat/cpu.h +1
-1@@ -184,7 +184,7 @@ extern void s3c24xx_init_uartdevs(char *name,struct s3c24xx_uart_resources *res, struct s3c2410_uartcfg *cfg, int no); -/* timer for 2410/2440 */ +/* timer for s5pc100 only */ struct sys_timer ;extern struct sys_timer s3c24xx_timer;(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hindex 9d6d622..13ae4b9 100644arch/arm/plat-samsung/include/plat/samsung-time.h +11
-0@@ -30,7 +30,18 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 +#ifdef CONFIG_ARCH_S3C24XX +#define TCNT_MAX 0xffff +#define TSCALER_DIV 25 +#define TDIV 50 +#define TSIZE 16 +#else #define TCNT_MAX 0xffffffff +#define TSCALER_DIV 2 +#define TDIV 2 +#define TSIZE 32 +#endif +#define NON_PERIODIC 0#define PERIODIC 1(quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.cindex 91773bf..6d63fca 100644arch/arm/plat-samsung/samsung-time.c +6
-5@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* SAMSUNG - Common hr-timer support +* samsung - Common hr-timer support (s3c and s5p) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -267,8 +267,8 @@ static void __init samsung_clockevent_init(void) tscaler =clk_get_parent (tdiv_event); -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); +clk_set_rate (tscaler, pclk /TSCALER_DIV ); +clk_set_rate (tdiv_event, pclk /TDIV );clk_set_parent (tin_event, tdiv_event); clock_rate =clk_get_rate (tin_event);@@ -336,7 +336,7 @@ static void __init samsung_clocksource_init(void) pclk =clk_get_rate (timerclk); -clk_set_rate (tdiv_source, pclk /2 ); +clk_set_rate (tdiv_source, pclk /TDIV );clk_set_parent (tin_source, tdiv_source); clock_rate =clk_get_rate (tin_source);@@ -344,10 +344,10 @@ static void __init samsung_clocksource_init(void)samsung_time_setup (timer_source.source_id,TCNT_MAX );samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,TSIZE , clock_rate);if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) + clock_rate, 250, TSIZE, clocksource_mmio_readl_down))panic ("samsung_clocksource_timer: can't register clocksource\n" ); }
Re: [PATCH 2/5 v2] Add samsung-time support for s3c24xx
Quoted 6 lines · Heiko Stübner
Am Sonntag, 2. Dezember 2012, 20:44:09 schrieb Romain Naour:
Quoted 5 lines
This patch replace
ARCH_USES_GETTIMEOFFSETbyGENERIC_CLOCKEVENTSfor s3c24xx devices. It becomes possible to use the high-resolution timer and dynamic ticks.
Quoted 6 lines
Quoted 1 line
Signed-off-by Naour Romain <[email protected]>Tested-by Heiko Stuebner <[email protected]>on a s3c2416 based board
Thank you to have tested.
Quoted 824 lines
Quoted 823 lines
arch/arm/Kconfig +2
-1@@ -737,7 +737,8 @@ config ARCH_SA1100 config ARCH_S3C24XX bool "Samsung S3C24XX SoCs" select ARCH_HAS_CPUFREQ - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select GENERIC_GPIO select HAVE_CLKarch/arm/mach-s3c24xx/Kconfig +6
-0@@ -21,6 +21,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs.@@ -32,6 +33,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM + select SAMSUNG_HRT help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line@@ -44,6 +46,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2416 SoC from the S3C24XX line@@ -54,6 +57,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA + select SAMSUNG_HRT help Support for S3C2440 Samsung Mobile CPU based systems.@@ -63,6 +67,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM + select SAMSUNG_HRT help Support for S3C2442 Samsung Mobile CPU based systems.@@ -78,6 +83,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC + select SAMSUNG_HRT help Support for the S3C2443 SoC from the S3C24XX line(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-amlm5900.cindex f4ad99c..84c9bb0 100644arch/arm/mach-s3c24xx/mach-amlm5900.c +4
-1@@ -63,6 +63,8 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> +#include "common.h" static struct resource amlm5900_nor_resource =@@ -160,6 +162,7 @@ static void __init amlm5900_map_io(void)s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }#ifdef CONFIG_FB_S3C2410 @@ -237,6 +240,6 @@ MACHINE_START(AML_M5900, "AML_M5900") .map_io = amlm5900_map_io, .init_irq = s3c24xx_init_irq, .init_machine = amlm5900_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-anubis.cindex 1ee8c46..65ba844 100644arch/arm/mach-s3c24xx/mach-anubis.c +3
-1@@ -54,6 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -414,6 +415,7 @@ static void __init anubis_map_io(void)s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ @@ -448,6 +450,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") .map_io = anubis_map_io, .init_machine = anubis_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-at2440evb.cindex 00381fe..d7eb641 100644arch/arm/mach-s3c24xx/mach-at2440evb.c +3
-1@@ -48,6 +48,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <plat/samsung-time.h> #include "common.h" @@ -192,6 +193,7 @@ static void __init at2440evb_map_io(void)s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init at2440evb_init (void )@@ -210,6 +212,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB") .map_io = at2440evb_map_io, .init_machine = at2440evb_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-bast.cindex 6a30ce7..a9c442e 100644arch/arm/mach-s3c24xx/mach-bast.c +3
-1@@ -63,6 +63,7 @@#include <plat/cpu-freq.h> #include <plat/gpio-cfg.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -583,6 +584,7 @@ static void __init bast_map_io(void)s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init bast_init (void )@@ -612,6 +614,6 @@ MACHINE_START(BAST, "Simtec-BAST") .map_io = bast_map_io, .init_irq = s3c24xx_init_irq, .init_machine = bast_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-gta02.cindex 4a96346..02c6c6a 100644arch/arm/mach-s3c24xx/mach-gta02.c +3
-1@@ -88,6 +88,7 @@#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h" @@ -507,6 +508,7 @@ static void __init gta02_map_io(void)s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }@@ -596,6 +598,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02") .map_io = gta02_map_io, .init_irq = s3c24xx_init_irq, .init_machine = gta02_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-h1940.cindex 63aaf07..f5d3578 100644arch/arm/mach-s3c24xx/mach-h1940.c +3
-1@@ -67,6 +67,7 @@#include <plat/pm.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -652,6 +653,7 @@ static void __init h1940_map_io(void)s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ @@ -747,6 +749,6 @@ MACHINE_START(H1940, "IPAQ-H1940") .reserve = h1940_reserve, .init_irq = h1940_init_irq, .init_machine = h1940_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-jive.cindex c9954e2..01a894d 100644arch/arm/mach-s3c24xx/mach-jive.c +3
-1@@ -55,6 +55,7 @@#include <plat/cpu.h> #include <plat/pm.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> static struct map_desc jive_iodesc[]__initdata = { };@@ -506,6 +507,7 @@ static void __init jive_map_io(void)s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void jive_power_off (void )@@ -661,6 +663,6 @@ MACHINE_START(JIVE, "JIVE") .init_irq = s3c24xx_init_irq, .map_io = jive_map_io, .init_machine = jive_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-mini2440.cindex 393c0f1..a96efcd 100644arch/arm/mach-s3c24xx/mach-mini2440.c +3
-1@@ -57,6 +57,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <sound/s3c24xx_uda134x.h> @@ -527,6 +528,7 @@ static void __init mini2440_map_io(void)s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* @@ -689,6 +691,6 @@ MACHINE_START(MINI2440, "MINI2440") .map_io = mini2440_map_io, .init_machine = mini2440_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-n30.cindex c53a9bf..f6cea03 100644arch/arm/mach-s3c24xx/mach-n30.c +4
-2@@ -50,6 +50,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <plat/s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <plat/samsung-time.h> #include "common.h" @@ -536,6 +537,7 @@ static void __init n30_map_io(void)n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* GPB3 is the line that controls the pull-up for the USB D+ line */ @@ -589,7 +591,7 @@ MACHINE_START(N30, "Acer-N30")Ben Dooks <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,@@ -600,7 +602,7 @@ MACHINE_START(N35, "Acer-N35")/* Maintainer: Christer Weinigel <[email protected]> */ .atag_offset = 0x100, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .init_machine = n30_init, .init_irq = s3c24xx_init_irq, .map_io = n30_map_io,(quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-nexcoder.cindex a2b92b0..4db6fb3 100644arch/arm/mach-s3c24xx/mach-nexcoder.c +3
-1@@ -46,6 +46,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -137,6 +138,7 @@ static void __init nexcoder_map_io(void)s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );nexcoder_sensorboard_init (); }@@ -153,6 +155,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") .map_io = nexcoder_map_io, .init_machine = nexcoder_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-osiris.cindex bb36d83..e85144e 100644arch/arm/mach-s3c24xx/mach-osiris.c +3
-1@@ -53,6 +53,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -386,6 +387,7 @@ static void __init osiris_map_io(void)s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* check for the newer revision boards with large page nand */ @@ -428,6 +430,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") .map_io = osiris_map_io, .init_irq = s3c24xx_init_irq, .init_machine = osiris_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-otom.cindex bca39f0..ab5f353 100644arch/arm/mach-s3c24xx/mach-otom.c +3
-1@@ -37,6 +37,7 @@#include <plat/devs.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h" @@ -104,6 +105,7 @@ static void __init otom11_map_io(void)s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init otom11_init (void )@@ -118,6 +120,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") .map_io = otom11_map_io, .init_machine = otom11_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-qt2410.cindex 7b6ba13..e725554 100644arch/arm/mach-s3c24xx/mach-qt2410.c +3
-1@@ -60,6 +60,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -304,6 +305,7 @@ static void __init qt2410_map_io(void)s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init qt2410_machine_init (void )@@ -343,6 +345,6 @@ MACHINE_START(QT2410, "QT2410") .map_io = qt2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = qt2410_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-rx1950.cindex 379fde5..63fbeb1 100644arch/arm/mach-s3c24xx/mach-rx1950.c +3
-1@@ -58,6 +58,7 @@#include <plat/pm.h> #include <plat/irq.h> #include <linux/platform_data/touchscreen-s3c2410.h> +#include <plat/samsung-time.h> #include <sound/uda1380.h> @@ -743,6 +744,7 @@ static void __init rx1950_map_io(void)s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* setup PM */ @@ -815,6 +817,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") .reserve = rx1950_reserve, .init_irq = s3c24xx_init_irq, .init_machine = rx1950_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-rx3715.cindex dacbb9a..1b358a1 100644arch/arm/mach-s3c24xx/mach-rx3715.c +3
-1@@ -50,6 +50,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h" @@ -179,6 +180,7 @@ static void __init rx3715_map_io(void)s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }/* H1940 and RX3715 need to reserve this for suspend */ @@ -212,6 +214,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715") .reserve = rx3715_reserve, .init_irq = rx3715_init_irq, .init_machine = rx3715_init_machine, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2410.cindex 82796b9..c7a18bc 100644arch/arm/mach-s3c24xx/mach-smdk2410.c +3
-1@@ -53,6 +53,7 @@#include <plat/cpu.h> #include <plat/common-smdk.h> +#include <plat/samsung-time.h> #include "common.h" @@ -101,6 +102,7 @@ static void __init smdk2410_map_io(void)s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2410_init (void )@@ -117,6 +119,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc .map_io = smdk2410_map_io, .init_irq = s3c24xx_init_irq, .init_machine = smdk2410_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2413.cindex ce99fd8..c29c067 100644arch/arm/mach-s3c24xx/mach-smdk2413.c +5
-3@@ -47,6 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -107,6 +108,7 @@ static void __init smdk2413_map_io(void)s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2413_machine_init (void )@@ -133,7 +135,7 @@ MACHINE_START(S3C2413, "S3C2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END @@ -145,7 +147,7 @@ MACHINE_START(SMDK2412, "SMDK2412") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END @@ -157,6 +159,6 @@ MACHINE_START(SMDK2413, "SMDK2413") .init_irq = s3c24xx_init_irq, .map_io = smdk2413_map_io, .init_machine = smdk2413_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2416.cindex f30d7fc..2c0b7a1 100644arch/arm/mach-s3c24xx/mach-smdk2416.c +3
-1@@ -52,6 +52,7 @@#include <plat/sdhci.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/s3c-hsudc.h> +#include <plat/samsung-time.h> #include <plat/fb.h> @@ -222,6 +223,7 @@ static void __init smdk2416_map_io(void)s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2416_machine_init (void )@@ -254,6 +256,6 @@ MACHINE_START(SMDK2416, "SMDK2416") .init_irq = s3c24xx_init_irq, .map_io = smdk2416_map_io, .init_machine = smdk2416_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2416_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2440.cindex b7ff882..caf5c04 100644arch/arm/mach-s3c24xx/mach-smdk2440.c +3
-1@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -164,6 +165,7 @@ static void __init smdk2440_map_io(void)s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2440_machine_init (void )@@ -182,6 +184,6 @@ MACHINE_START(S3C2440, "SMDK2440") .init_irq = s3c24xx_init_irq, .map_io = smdk2440_map_io, .init_machine = smdk2440_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c244x_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-smdk2443.cindex 2568656..02fcd27 100644arch/arm/mach-s3c24xx/mach-smdk2443.c +3
-1@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include <plat/common-smdk.h> @@ -123,6 +124,7 @@ static void __init smdk2443_map_io(void)s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdk2443_machine_init (void )@@ -144,6 +146,6 @@ MACHINE_START(SMDK2443, "SMDK2443") .init_irq = s3c24xx_init_irq, .map_io = smdk2443_map_io, .init_machine = smdk2443_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2443_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-tct_hammer.cindex 495bf5c..90f43c9 100644arch/arm/mach-s3c24xx/mach-tct_hammer.c +3
-1@@ -53,6 +53,7 @@#include <linux/mtd/partitions.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> +#include <plat/samsung-time.h> #include "common.h" @@ -136,6 +137,7 @@ static void __init tct_hammer_map_io(void)s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init tct_hammer_init (void )@@ -149,6 +151,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") .map_io = tct_hammer_map_io, .init_irq = s3c24xx_init_irq, .init_machine = tct_hammer_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-vr1000.cindex 14d5b12..4366c6f 100644arch/arm/mach-s3c24xx/mach-vr1000.c +3
-1@@ -50,6 +50,7 @@#include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <plat/samsung-time.h> #include "simtec.h" #include "common.h" @@ -335,6 +336,7 @@ static void __init vr1000_map_io(void)s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vr1000_init (void )@@ -357,6 +359,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000") .map_io = vr1000_map_io, .init_machine = vr1000_init, .init_irq = s3c24xx_init_irq, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2410_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/mach-s3c24xx/mach-vstms.cindex f1d44ae..412d858 100644arch/arm/mach-s3c24xx/mach-vstms.c +3
-2@@ -47,7 +47,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> - +#include <plat/samsung-time.h> static struct map_desc vstms_iodesc[]__initdata = { };@@ -144,6 +144,7 @@ static void __init vstms_map_io(void)s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init vstms_init (void )@@ -161,6 +162,6 @@ MACHINE_START(VSTMS, "VSTMS") .init_irq = s3c24xx_init_irq, .init_machine = vstms_init, .map_io = vstms_map_io, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c2412_restart,MACHINE_END (quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/cpu.hindex ace4451..86fb5f3 100644arch/arm/plat-samsung/include/plat/cpu.h +1
-1@@ -184,7 +184,7 @@ extern void s3c24xx_init_uartdevs(char *name,struct s3c24xx_uart_resources *res, struct s3c2410_uartcfg *cfg, int no); -/* timer for 2410/2440 */ +/* timer for s5pc100 only */ struct sys_timer ;extern struct sys_timer s3c24xx_timer;(quoted diff) +0
-0
b/arch/arm/plat-samsung/include/plat/samsung-time.hindex 9d6d622..13ae4b9 100644arch/arm/plat-samsung/include/plat/samsung-time.h +11
-0@@ -30,7 +30,18 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 +#ifdef CONFIG_ARCH_S3C24XX +#define TCNT_MAX 0xffff +#define TSCALER_DIV 25 +#define TDIV 50 +#define TSIZE 16 +#else #define TCNT_MAX 0xffffffff +#define TSCALER_DIV 2 +#define TDIV 2 +#define TSIZE 32 +#endif +#define NON_PERIODIC 0#define PERIODIC 1(quoted diff) +0
-0
b/arch/arm/plat-samsung/samsung-time.cindex 91773bf..6d63fca 100644arch/arm/plat-samsung/samsung-time.c +6
-5@@ -2,7 +2,7 @@* Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* SAMSUNG - Common hr-timer support +* samsung - Common hr-timer support (s3c and s5p) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -267,8 +267,8 @@ static void __init samsung_clockevent_init(void) tscaler =clk_get_parent (tdiv_event); -clk_set_rate (tscaler, pclk /2 ); -clk_set_rate (tdiv_event, pclk /2 ); +clk_set_rate (tscaler, pclk /TSCALER_DIV ); +clk_set_rate (tdiv_event, pclk /TDIV );clk_set_parent (tin_event, tdiv_event); clock_rate =clk_get_rate (tin_event);@@ -336,7 +336,7 @@ static void __init samsung_clocksource_init(void) pclk =clk_get_rate (timerclk); -clk_set_rate (tdiv_source, pclk /2 ); +clk_set_rate (tdiv_source, pclk /TDIV );clk_set_parent (tin_source, tdiv_source); clock_rate =clk_get_rate (tin_source);@@ -344,10 +344,10 @@ static void __init samsung_clocksource_init(void)samsung_time_setup (timer_source.source_id,TCNT_MAX );samsung_time_start (timer_source.source_id,PERIODIC ); -setup_sched_clock (samsung_read_sched_clock,32 , clock_rate); +setup_sched_clock (samsung_read_sched_clock,TSIZE , clock_rate);if (clocksource_mmio_init (samsung_timer_reg (),"samsung_clocksource_timer" , - clock_rate,250 ,32 , clocksource_mmio_readl_down)) + clock_rate, 250, TSIZE, clocksource_mmio_readl_down))panic ("samsung_clocksource_timer: can't register clocksource\n" ); }
PATCH v2 3/5 Add samsung-time support for s3c64xx
In reply to Heiko StübnerThis patch replace ARCH_USES_GETTIMEOFFSET by GENERIC_CLOCKEVENTS for s3c64xx devices. It becomes possible to use the high-resolution timer and dynamic ticks.
arch/arm/Kconfig +2 -1
@@ -757,7 +757,8 @@ config ARCH_S3C64XX bool "Samsung S3C64XX" select ARCH_HAS_CPUFREQ select ARCH_REQUIRE_GPIOLIB - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select ARM_VIC select CLKDEV_LOOKUP select CPU_V6
arch/arm/mach-s3c64xx/Kconfig +2 -0
@@ -17,11 +17,13 @@ config PLAT_S3C64XX # Configuration options for the S3C6410 CPU config CPU_S3C6400 + select SAMSUNG_HRT bool help Enable S3C6400 CPU support config CPU_S3C6410 + select SAMSUNG_HRT bool help Enable S3C6410 CPU support
arch/arm/mach-s3c64xx/mach-anw6410.c +3 -1
@@ -51,6 +51,7 @@#include <plat/cpu.h> #include <mach/regs-gpio.h> #include <mach/regs-modem.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -209,6 +210,7 @@ static void __init anw6410_map_io(void)s3c64xx_init_io (anw6410_iodesc,ARRAY_SIZE (anw6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (anw6410_uartcfgs,ARRAY_SIZE (anw6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );anw6410_lcd_mode_set (); }
@@ -234,6 +236,6 @@ MACHINE_START(ANW6410, "A&W6410") .map_io = anw6410_map_io, .init_machine = anw6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-crag6410.c +3 -1
@@ -70,6 +70,7 @@#include <plat/adc.h> #include <linux/platform_data/i2c-s3c2410.h> #include <plat/pm.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -704,6 +705,7 @@ static void __init crag6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (crag6410_uartcfgs,ARRAY_SIZE (crag6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* LCD type and Bypass set by bootloader */ }
@@ -829,6 +831,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410") .map_io = crag6410_map_io, .init_machine = crag6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-hmt.c +3 -1
@@ -42,6 +42,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -249,6 +250,7 @@ static void __init hmt_map_io(void)s3c64xx_init_io (hmt_iodesc,ARRAY_SIZE (hmt_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (hmt_uartcfgs,ARRAY_SIZE (hmt_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init hmt_machine_init (void )
@@ -277,6 +279,6 @@ MACHINE_START(HMT, "Airgoo-HMT") .map_io = hmt_map_io, .init_machine = hmt_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-mini6410.c +3 -1
@@ -44,6 +44,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -233,6 +234,7 @@ static void __init mini6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini6410_uartcfgs,ARRAY_SIZE (mini6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
@@ -356,6 +358,6 @@ MACHINE_START(MINI6410, "MINI6410") .map_io = mini6410_map_io, .init_machine = mini6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-ncp.c +3 -1
@@ -44,6 +44,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -88,6 +89,7 @@ static void __init ncp_map_io(void)s3c64xx_init_io (ncp_iodesc,ARRAY_SIZE (ncp_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (ncp_uartcfgs,ARRAY_SIZE (ncp_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init ncp_machine_init (void )
@@ -105,6 +107,6 @@ MACHINE_START(NCP, "NCP") .map_io = ncp_map_io, .init_machine = ncp_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-real6410.c +3 -1
@@ -45,6 +45,7 @@#include <video/platform_lcd.h> #include <video/samsung_fimd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -212,6 +213,7 @@ static void __init real6410_map_io(void)s3c64xx_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (real6410_uartcfgs,ARRAY_SIZE (real6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */ tmp =__raw_readl (S3C64XX_SPCON );
@@ -335,6 +337,6 @@ MACHINE_START(REAL6410, "REAL6410") .map_io = real6410_map_io, .init_machine = real6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq.c +2 -0
@@ -39,6 +39,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <video/platform_lcd.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -378,6 +379,7 @@ void __init smartq_map_io(void)s3c64xx_init_io (smartq_iodesc,ARRAY_SIZE (smartq_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smartq_uartcfgs,ARRAY_SIZE (smartq_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );smartq_lcd_mode_set (); }
arch/arm/mach-s3c64xx/mach-smartq5.c +2 -1
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
@@ -157,6 +158,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5") .map_io = smartq_map_io, .init_machine = smartq5_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smartq7.c +2 -1
@@ -29,6 +29,7 @@#include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> +#include <plat/samsung-time.h> #include "common.h" #include "mach-smartq.h"
@@ -173,6 +174,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7") .map_io = smartq_map_io, .init_machine = smartq7_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6400.c +3 -1
@@ -36,6 +36,7 @@#include <plat/devs.h> #include <plat/cpu.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -67,6 +68,7 @@ static void __init smdk6400_map_io(void)s3c64xx_init_io (smdk6400_iodesc,ARRAY_SIZE (smdk6400_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6400_uartcfgs,ARRAY_SIZE (smdk6400_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static struct platform_device *smdk6400_devices[]__initdata = {
@@ -94,6 +96,6 @@ MACHINE_START(SMDK6400, "SMDK6400") .map_io = smdk6400_map_io, .init_machine = smdk6400_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
arch/arm/mach-s3c64xx/mach-smdk6410.c +3 -1
@@ -73,6 +73,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <plat/keypad.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -636,6 +637,7 @@ static void __init smdk6410_map_io(void)s3c64xx_init_io (smdk6410_iodesc,ARRAY_SIZE (smdk6410_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk6410_uartcfgs,ARRAY_SIZE (smdk6410_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 );/* set the LCD type */
@@ -705,6 +707,6 @@ MACHINE_START(SMDK6410, "SMDK6410") .map_io = smdk6410_map_io, .init_machine = smdk6410_machine_init, .init_late = s3c64xx_init_late, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s3c64xx_restart,MACHINE_END
PATCH v2 4/5 Add samsung-time support for s5pc100
In reply to Heiko StübnerThis patch replace ARCH_USES_GETTIMEOFFSET by GENERIC_CLOCKEVENTS for s5pc100 device. It becomes possible to use the high-resolution timer and dynamic ticks.
arch/arm/Kconfig +2 -1
@@ -796,7 +796,8 @@ config ARCH_S5P64X0 config ARCH_S5PC100 bool "Samsung S5PC100" - select ARCH_USES_GETTIMEOFFSET + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO select CLKDEV_LOOKUP select CPU_V7 select GENERIC_GPIO
arch/arm/mach-s5pc100/Kconfig +1 -0
@@ -9,6 +9,7 @@ if ARCH_S5PC100 config CPU_S5PC100 bool + select SAMSUNG_HRT select S5P_EXT_INT select SAMSUNG_DMADEV help
arch/arm/mach-s5pc100/mach-smdkc100.c +3 -1
@@ -52,6 +52,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <linux/platform_data/asoc-s3c.h> #include <plat/backlight.h> +#include <plat/samsung-time.h> #include "common.h"
@@ -223,6 +224,7 @@ static void __init smdkc100_map_io(void)s5pc100_init_io (NULL ,0 );s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdkc100_uartcfgs,ARRAY_SIZE (smdkc100_uartcfgs)); +samsung_set_timer_source (SAMSUNG_PWM3 ,SAMSUNG_PWM4 ); }static void __init smdkc100_machine_init (void )
@@ -258,6 +260,6 @@ MACHINE_START(SMDKC100, "SMDKC100") .handle_irq = vic_handle_irq, .map_io = smdkc100_map_io, .init_machine = smdkc100_machine_init, - .timer = &s3c24xx_timer, + .timer = &samsung_timer, .restart = s5pc100_restart,MACHINE_END
arch/arm/plat-samsung/include/plat/samsung-time.h +1 -1
@@ -30,7 +30,7 @@ struct samsung_timer_source {/* Be able to sleep for atleast 4 seconds (usually more) */ #define SAMSUNG_TIMER_MIN_RANGE 4 -#ifdef CONFIG_ARCH_S3C24XX +#if defined(CONFIG_ARCH_S3C24XX ) || defined(CONFIG_ARCH_S5PC100 )#define TCNT_MAX 0xffff#define TSCALER_DIV 25#define TDIV 50