From 23c197b77f9553c30f9c8a5ab41279a35f135f37 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 11:51:58 -0700 Subject: ARM: set arch_gettimeoffset directly remove ARM's struct sys_timer .offset function pointer, and instead directly set the arch_gettimeoffset function pointer when the timer driver is initialized. This requires multiplying all function results by 1000, since the removed arm_gettimeoffset() did this. Also, s/unsigned long/u32/ just to make the function prototypes exactly match that of arch_gettimeoffset. Cc: Russell King Cc: Andrew Victor Cc: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard Cc: Hartley Sweeten Cc: Ryan Mallon Cc: Ben Dooks Cc: Kukjin Kim Signed-off-by: Stephen Warren --- arch/arm/plat-samsung/time.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 60552e22f22e..67206df94aa8 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -95,7 +95,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) * IRQs are disabled before entering here from do_gettimeofday() */ -static unsigned long s3c2410_gettimeoffset (void) +static u32 s3c2410_gettimeoffset(void) { unsigned long tdone; unsigned long tval; @@ -120,7 +120,7 @@ static unsigned long s3c2410_gettimeoffset (void) tdone += timer_startval; } - return timer_ticks_to_usec(tdone); + return timer_ticks_to_usec(tdone) * 1000; } @@ -273,6 +273,8 @@ static void __init s3c2410_timer_resources(void) static void __init s3c2410_timer_init(void) { + arch_gettimeoffset = s3c2410_gettimeoffset; + s3c2410_timer_resources(); s3c2410_timer_setup(); setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); @@ -280,6 +282,5 @@ static void __init s3c2410_timer_init(void) struct sys_timer s3c24xx_timer = { .init = s3c2410_timer_init, - .offset = s3c2410_gettimeoffset, .resume = s3c2410_timer_setup }; -- cgit v1.2.3 From 656c669bc0cb9d2a621318b4b7300e8072930278 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 17:24:28 -0700 Subject: ARM: samsung: register syscore_ops for timer resume directly Instead of using struct sys_timer's resume function, register syscore_ops directly in s3c2410_timer_init(). This will allow the sys_timer suspend/ resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Cc: Ben Dooks Cc: Kukjin Kim Signed-off-by: Stephen Warren --- arch/arm/plat-samsung/time.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 67206df94aa8..773745a85f0f 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -271,6 +272,10 @@ static void __init s3c2410_timer_resources(void) clk_enable(tin); } +static struct syscore_ops s3c24xx_syscore_ops = { + .resume = s3c2410_timer_setup, +}; + static void __init s3c2410_timer_init(void) { arch_gettimeoffset = s3c2410_gettimeoffset; @@ -278,9 +283,9 @@ static void __init s3c2410_timer_init(void) s3c2410_timer_resources(); s3c2410_timer_setup(); setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); + register_syscore_ops(&s3c24xx_syscore_ops); } struct sys_timer s3c24xx_timer = { .init = s3c2410_timer_init, - .resume = s3c2410_timer_setup }; -- cgit v1.2.3 From 6bb27d7349db51b50c40534710fe164ca0d58902 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 12:40:59 -0700 Subject: ARM: delete struct sys_timer Now that the only field in struct sys_timer is .init, delete the struct, and replace the machine descriptor .timer field with the initialization function itself. This will enable moving timer drivers into drivers/clocksource without having to place a public prototype of each struct sys_timer object into include/linux; the intent is to create a single of_clocksource_init() function that determines which timer driver to initialize by scanning the device dtree, much like the proposed irqchip_init() at: http://www.spinics.net/lists/arm-kernel/msg203686.html Includes mach-omap2 fixes from Igor Grinberg. Tested-by: Robert Jarzmik Signed-off-by: Stephen Warren --- arch/arm/plat-samsung/include/plat/cpu.h | 3 +-- arch/arm/plat-samsung/include/plat/s5p-time.h | 2 +- arch/arm/plat-samsung/s5p-time.c | 6 +----- arch/arm/plat-samsung/time.c | 6 +----- 4 files changed, 4 insertions(+), 13 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index e0072ce8d6e9..e0667a1c137c 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h @@ -194,8 +194,7 @@ extern void s3c24xx_init_uartdevs(char *name, /* timer for 2410/2440 */ -struct sys_timer; -extern struct sys_timer s3c24xx_timer; +extern void s3c24xx_timer_init(void); extern struct syscore_ops s3c2410_pm_syscore_ops; extern struct syscore_ops s3c2412_pm_syscore_ops; diff --git a/arch/arm/plat-samsung/include/plat/s5p-time.h b/arch/arm/plat-samsung/include/plat/s5p-time.h index 3a70aebc9205..9c96f3586ce0 100644 --- a/arch/arm/plat-samsung/include/plat/s5p-time.h +++ b/arch/arm/plat-samsung/include/plat/s5p-time.h @@ -36,5 +36,5 @@ struct s5p_timer_source { extern void __init s5p_set_timer_source(enum s5p_timer_mode event, enum s5p_timer_mode source); -extern struct sys_timer s5p_timer; +extern void s5p_timer_init(void); #endif /* __ASM_PLAT_S5P_TIME_H */ diff --git a/arch/arm/plat-samsung/s5p-time.c b/arch/arm/plat-samsung/s5p-time.c index 028b6e877eb9..dabede46c0ec 100644 --- a/arch/arm/plat-samsung/s5p-time.c +++ b/arch/arm/plat-samsung/s5p-time.c @@ -393,13 +393,9 @@ static void __init s5p_timer_resources(void) clk_enable(tin_source); } -static void __init s5p_timer_init(void) +void __init s5p_timer_init(void) { s5p_timer_resources(); s5p_clockevent_init(); s5p_clocksource_init(); } - -struct sys_timer s5p_timer = { - .init = s5p_timer_init, -}; diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 773745a85f0f..73defd00c3e4 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -276,7 +276,7 @@ static struct syscore_ops s3c24xx_syscore_ops = { .resume = s3c2410_timer_setup, }; -static void __init s3c2410_timer_init(void) +void __init s3c24xx_timer_init(void) { arch_gettimeoffset = s3c2410_gettimeoffset; @@ -285,7 +285,3 @@ static void __init s3c2410_timer_init(void) setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); register_syscore_ops(&s3c24xx_syscore_ops); } - -struct sys_timer s3c24xx_timer = { - .init = s3c2410_timer_init, -}; -- cgit v1.2.3 From 0a2691dade25dceb4b3982a7b4f749c708ac0b50 Mon Sep 17 00:00:00 2001 From: Kukjin Kim Date: Sun, 30 Dec 2012 18:28:01 -0800 Subject: ARM: SAMSUNG: cleanup mach/gpio-fns.h gpio-track.h and gpio-nrs.h remove , and Acked-by: Linus Walleij Cc: Grant Likely Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/include/plat/gpio-core.h | 13 ++++++++++++- arch/arm/plat-samsung/include/plat/gpio-fns.h | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) delete mode 100644 arch/arm/plat-samsung/include/plat/gpio-fns.h (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h index f7a3ea2c498a..cf5aae5b0975 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-core.h +++ b/arch/arm/plat-samsung/include/plat/gpio-core.h @@ -106,7 +106,18 @@ static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int chi #else /* machine specific code should provide samsung_gpiolib_getchip */ -#include +extern struct samsung_gpio_chip s3c24xx_gpios[]; + +static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int pin) +{ + struct samsung_gpio_chip *chip; + + if (pin > S3C_GPIO_END) + return NULL; + + chip = &s3c24xx_gpios[pin/32]; + return ((pin - chip->chip.base) < chip->chip.ngpio) ? chip : NULL; +} static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { } #endif diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h deleted file mode 100644 index d1ecef0e38e0..000000000000 --- a/arch/arm/plat-samsung/include/plat/gpio-fns.h +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.3 From 1ff5f55a8c7b011f818434923a93afc48de0b2ee Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Thu, 10 Jan 2013 21:58:38 +0800 Subject: ARM: samsung: remove unused arch_decomp_wdog() code Besides the fact that CONFIG_S3C_BOOT_WATCHDOG is defined nowhere, with ARCH_HAS_DECOMP_WDOG removed from arch/arm/boot/compressed/decompress.c, all the arch_decomp_wdog() related code is not used. Remove them. Signed-off-by: Shawn Guo Acked-by: Nicolas Pitre Acked-by: Kukjin Kim --- arch/arm/plat-samsung/include/plat/uncompress.h | 28 ------------------------- 1 file changed, 28 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h index 7e068d182c3d..438b24846e7f 100644 --- a/arch/arm/plat-samsung/include/plat/uncompress.h +++ b/arch/arm/plat-samsung/include/plat/uncompress.h @@ -97,33 +97,6 @@ static inline void flush(void) *((volatile unsigned int __force *)(ad)) = (d); \ } while (0) -/* CONFIG_S3C_BOOT_WATCHDOG - * - * Simple boot-time watchdog setup, to reboot the system if there is - * any problem with the boot process -*/ - -#ifdef CONFIG_S3C_BOOT_WATCHDOG - -#define WDOG_COUNT (0xff00) - -static inline void arch_decomp_wdog(void) -{ - __raw_writel(WDOG_COUNT, S3C2410_WTCNT); -} - -static void arch_decomp_wdog_start(void) -{ - __raw_writel(WDOG_COUNT, S3C2410_WTDAT); - __raw_writel(WDOG_COUNT, S3C2410_WTCNT); - __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON); -} - -#else -#define arch_decomp_wdog_start() -#define arch_decomp_wdog() -#endif - #ifdef CONFIG_S3C_BOOT_ERROR_RESET static void arch_decomp_error(const char *x) @@ -173,7 +146,6 @@ arch_decomp_setup(void) */ arch_detect_cpu(); - arch_decomp_wdog_start(); /* Enable the UART FIFOs if they where not enabled and our * configuration says we should turn them on. -- cgit v1.2.3 From 9e47b8bf9815523a5816f2f83e73b13812d74014 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 7 Jan 2013 09:45:59 -0600 Subject: irqchip: Move ARM vic.h to include/linux/irqchip/arm-vic.h Now that we have VIC moved to drivers/irqchip and all VIC DT init for platforms using irqchip_init, move gic.h and update the remaining includes. Signed-off-by: Rob Herring Cc: Thomas Gleixner Cc: Hartley Sweeten Cc: Ryan Mallon Cc: Russell King Cc: Alessandro Rubini Acked-by: Linus Walleij Cc: STEricsson Cc: Ben Dooks Cc: Kukjin Kim Cc: linux-samsung-soc@vger.kernel.org --- arch/arm/plat-samsung/s5p-irq-eint.c | 3 +-- arch/arm/plat-samsung/s5p-irq.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/s5p-irq-eint.c b/arch/arm/plat-samsung/s5p-irq-eint.c index 33bd3f3d20f5..faa651602780 100644 --- a/arch/arm/plat-samsung/s5p-irq-eint.c +++ b/arch/arm/plat-samsung/s5p-irq-eint.c @@ -15,8 +15,7 @@ #include #include #include - -#include +#include #include diff --git a/arch/arm/plat-samsung/s5p-irq.c b/arch/arm/plat-samsung/s5p-irq.c index dfb47d638f03..103e371f5e35 100644 --- a/arch/arm/plat-samsung/s5p-irq.c +++ b/arch/arm/plat-samsung/s5p-irq.c @@ -13,8 +13,7 @@ #include #include #include - -#include +#include #include #include -- cgit v1.2.3 From 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 12 Jan 2013 11:50:05 +0000 Subject: ARM: use clockevents_config_and_register() where possible The clockevent core is able to figure out the best mult and shift, calculate min_delta_ns and max_delta_ns, with the necessary info passed into clockevents_config_and_register(). Use this combined configure and register function where possible to make the codes less error prone and gain some positive diff stat. Signed-off-by: Shawn Guo Cc: Nicolas Ferre Reviewed-by: Anton Vorontsov Acked-by: Kukjin Kim Cc: Russell King Cc: Sascha Hauer Cc: Jason Cooper Tested-by: Roland Stigge Acked-by: Eric Miao Cc: Haojian Zhuang Cc: David Brown Tested-by: Tony Lindgren Acked-by: Barry Song Tested-by: Stephen Warren Acked-by: Tony Prisk Cc: Lennert Buytenhek Cc: Wan ZongShun Acked-by: Viresh Kumar Acked-by: Arnd Bergmann Acked-by: Jason Cooper Reviewed-by: Thomas Gleixner Signed-off-by: Olof Johansson --- arch/arm/plat-samsung/s5p-time.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/s5p-time.c b/arch/arm/plat-samsung/s5p-time.c index 028b6e877eb9..798268b3159a 100644 --- a/arch/arm/plat-samsung/s5p-time.c +++ b/arch/arm/plat-samsung/s5p-time.c @@ -274,15 +274,8 @@ static void __init s5p_clockevent_init(void) 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); + clockevents_config_and_register(&time_event_device, clock_rate, 1, -1); irq_number = timer_source.event_id + IRQ_TIMER0; setup_irq(irq_number, &s5p_clock_event_irq); -- cgit v1.2.3 From d8fdec168542971f6ffbf0883c8be2e9bbb22ca6 Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Tue, 29 Jan 2013 10:25:22 -0800 Subject: ARM: S3C24XX: Move irq syscore-ops to irq-pm With this the definition of s3c24xx_irq_syscore_ops can also move to common.h from plat/pm.h and the definitions of s3c24xx_irq_suspend and s3c24xx_irq_resume are also not necessary anymore in plat/pm.h Signed-off-by: Heiko Stuebner Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/include/plat/pm.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index 887a0c954379..f6fcadeee969 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h @@ -109,17 +109,11 @@ extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); #ifdef CONFIG_PM extern int s3c_irq_wake(struct irq_data *data, unsigned int state); extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); -extern int s3c24xx_irq_suspend(void); -extern void s3c24xx_irq_resume(void); #else #define s3c_irq_wake NULL #define s3c_irqext_wake NULL -#define s3c24xx_irq_suspend NULL -#define s3c24xx_irq_resume NULL #endif -extern struct syscore_ops s3c24xx_irq_syscore_ops; - /* PM debug functions */ #ifdef CONFIG_SAMSUNG_PM_DEBUG -- cgit v1.2.3 From 4a282dd3b616a1e7a7f170973ed2a12332544dc3 Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Tue, 29 Jan 2013 10:25:22 -0800 Subject: ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs Previously the irq init used s3c24xx_init_irq and an additional arch_initcall to add the cpu specific irqs. To be able to simplyfy the irq init later, create a new function s3c416_init_irq, which then calls s3c24xx_init_irq but also adds the cpu specific irqs. Signed-off-by: Heiko Stuebner Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/include/plat/s3c2416.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h index 7178e338e25e..f27399a3c68d 100644 --- a/arch/arm/plat-samsung/include/plat/s3c2416.h +++ b/arch/arm/plat-samsung/include/plat/s3c2416.h @@ -25,6 +25,7 @@ extern int s3c2416_baseclk_add(void); extern void s3c2416_restart(char mode, const char *cmd); +extern void s3c2416_init_irq(void); extern struct syscore_ops s3c2416_irq_syscore_ops; #else -- cgit v1.2.3 From b499b7a87117c6ec45f5d4f73ac6a643b1709292 Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Tue, 29 Jan 2013 10:25:23 -0800 Subject: ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs Previously the irq init used s3c24xx_init_irq and an additional arch_initcall to add the cpu specific irqs. To be able to simplyfy the irq init later, create a new function s3c2443_init_irq, which then calls s3c24xx_init_irq but also adds the cpu specific irqs. Signed-off-by: Heiko Stuebner Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/include/plat/s3c2443.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/plat-samsung') diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h index a5b794ff838b..71b88ec48956 100644 --- a/arch/arm/plat-samsung/include/plat/s3c2443.h +++ b/arch/arm/plat-samsung/include/plat/s3c2443.h @@ -25,6 +25,8 @@ extern void s3c2443_init_clocks(int xtal); extern int s3c2443_baseclk_add(void); extern void s3c2443_restart(char mode, const char *cmd); + +extern void s3c2443_init_irq(void); #else #define s3c2443_init_clocks NULL #define s3c2443_init_uarts NULL -- cgit v1.2.3