aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h13
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-fns.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h6
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2416.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2443.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p-time.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/uncompress.h28
-rw-r--r--arch/arm/plat-samsung/s5p-irq-eint.c3
-rw-r--r--arch/arm/plat-samsung/s5p-irq.c3
-rw-r--r--arch/arm/plat-samsung/s5p-time.c15
-rw-r--r--arch/arm/plat-samsung/time.c20
12 files changed, 32 insertions, 65 deletions
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index b69e11dc679d..37703ef6dfc7 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,
194 194
195/* timer for 2410/2440 */ 195/* timer for 2410/2440 */
196 196
197struct sys_timer; 197extern void s3c24xx_timer_init(void);
198extern struct sys_timer s3c24xx_timer;
199 198
200extern struct syscore_ops s3c2410_pm_syscore_ops; 199extern struct syscore_ops s3c2410_pm_syscore_ops;
201extern struct syscore_ops s3c2412_pm_syscore_ops; 200extern struct syscore_ops s3c2412_pm_syscore_ops;
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
106#else 106#else
107/* machine specific code should provide samsung_gpiolib_getchip */ 107/* machine specific code should provide samsung_gpiolib_getchip */
108 108
109#include <mach/gpio-track.h> 109extern struct samsung_gpio_chip s3c24xx_gpios[];
110
111static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int pin)
112{
113 struct samsung_gpio_chip *chip;
114
115 if (pin > S3C_GPIO_END)
116 return NULL;
117
118 chip = &s3c24xx_gpios[pin/32];
119 return ((pin - chip->chip.base) < chip->chip.ngpio) ? chip : NULL;
120}
110 121
111static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { } 122static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { }
112#endif 123#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 @@
1#include <plat/gpio-cfg.h>
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);
109#ifdef CONFIG_PM 109#ifdef CONFIG_PM
110extern int s3c_irq_wake(struct irq_data *data, unsigned int state); 110extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
111extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 111extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
112extern int s3c24xx_irq_suspend(void);
113extern void s3c24xx_irq_resume(void);
114#else 112#else
115#define s3c_irq_wake NULL 113#define s3c_irq_wake NULL
116#define s3c_irqext_wake NULL 114#define s3c_irqext_wake NULL
117#define s3c24xx_irq_suspend NULL
118#define s3c24xx_irq_resume NULL
119#endif 115#endif
120 116
121extern struct syscore_ops s3c24xx_irq_syscore_ops;
122
123/* PM debug functions */ 117/* PM debug functions */
124 118
125#ifdef CONFIG_SAMSUNG_PM_DEBUG 119#ifdef CONFIG_SAMSUNG_PM_DEBUG
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);
25 25
26extern void s3c2416_restart(char mode, const char *cmd); 26extern void s3c2416_restart(char mode, const char *cmd);
27 27
28extern void s3c2416_init_irq(void);
28extern struct syscore_ops s3c2416_irq_syscore_ops; 29extern struct syscore_ops s3c2416_irq_syscore_ops;
29 30
30#else 31#else
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);
25extern int s3c2443_baseclk_add(void); 25extern int s3c2443_baseclk_add(void);
26 26
27extern void s3c2443_restart(char mode, const char *cmd); 27extern void s3c2443_restart(char mode, const char *cmd);
28
29extern void s3c2443_init_irq(void);
28#else 30#else
29#define s3c2443_init_clocks NULL 31#define s3c2443_init_clocks NULL
30#define s3c2443_init_uarts NULL 32#define s3c2443_init_uarts NULL
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 {
36 36
37extern void __init s5p_set_timer_source(enum s5p_timer_mode event, 37extern void __init s5p_set_timer_source(enum s5p_timer_mode event,
38 enum s5p_timer_mode source); 38 enum s5p_timer_mode source);
39extern struct sys_timer s5p_timer; 39extern void s5p_timer_init(void);
40#endif /* __ASM_PLAT_S5P_TIME_H */ 40#endif /* __ASM_PLAT_S5P_TIME_H */
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)
97 *((volatile unsigned int __force *)(ad)) = (d); \ 97 *((volatile unsigned int __force *)(ad)) = (d); \
98 } while (0) 98 } while (0)
99 99
100/* CONFIG_S3C_BOOT_WATCHDOG
101 *
102 * Simple boot-time watchdog setup, to reboot the system if there is
103 * any problem with the boot process
104*/
105
106#ifdef CONFIG_S3C_BOOT_WATCHDOG
107
108#define WDOG_COUNT (0xff00)
109
110static inline void arch_decomp_wdog(void)
111{
112 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
113}
114
115static void arch_decomp_wdog_start(void)
116{
117 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
118 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
119 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
120}
121
122#else
123#define arch_decomp_wdog_start()
124#define arch_decomp_wdog()
125#endif
126
127#ifdef CONFIG_S3C_BOOT_ERROR_RESET 100#ifdef CONFIG_S3C_BOOT_ERROR_RESET
128 101
129static void arch_decomp_error(const char *x) 102static void arch_decomp_error(const char *x)
@@ -173,7 +146,6 @@ arch_decomp_setup(void)
173 */ 146 */
174 147
175 arch_detect_cpu(); 148 arch_detect_cpu();
176 arch_decomp_wdog_start();
177 149
178 /* Enable the UART FIFOs if they where not enabled and our 150 /* Enable the UART FIFOs if they where not enabled and our
179 * configuration says we should turn them on. 151 * configuration says we should turn them on.
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 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18 18#include <linux/irqchip/arm-vic.h>
19#include <asm/hardware/vic.h>
20 19
21#include <plat/regs-irqtype.h> 20#include <plat/regs-irqtype.h>
22 21
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 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16#include <linux/irqchip/arm-vic.h>
17#include <asm/hardware/vic.h>
18 17
19#include <mach/map.h> 18#include <mach/map.h>
20#include <plat/regs-timer.h> 19#include <plat/regs-timer.h>
diff --git a/arch/arm/plat-samsung/s5p-time.c b/arch/arm/plat-samsung/s5p-time.c
index 028b6e877eb9..e92510cf82ee 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)
274 clock_rate = clk_get_rate(tin_event); 274 clock_rate = clk_get_rate(tin_event);
275 clock_count_per_tick = clock_rate / HZ; 275 clock_count_per_tick = clock_rate / HZ;
276 276
277 clockevents_calc_mult_shift(&time_event_device,
278 clock_rate, S5PTIMER_MIN_RANGE);
279 time_event_device.max_delta_ns =
280 clockevent_delta2ns(-1, &time_event_device);
281 time_event_device.min_delta_ns =
282 clockevent_delta2ns(1, &time_event_device);
283
284 time_event_device.cpumask = cpumask_of(0); 277 time_event_device.cpumask = cpumask_of(0);
285 clockevents_register_device(&time_event_device); 278 clockevents_config_and_register(&time_event_device, clock_rate, 1, -1);
286 279
287 irq_number = timer_source.event_id + IRQ_TIMER0; 280 irq_number = timer_source.event_id + IRQ_TIMER0;
288 setup_irq(irq_number, &s5p_clock_event_irq); 281 setup_irq(irq_number, &s5p_clock_event_irq);
@@ -393,13 +386,9 @@ static void __init s5p_timer_resources(void)
393 clk_enable(tin_source); 386 clk_enable(tin_source);
394} 387}
395 388
396static void __init s5p_timer_init(void) 389void __init s5p_timer_init(void)
397{ 390{
398 s5p_timer_resources(); 391 s5p_timer_resources();
399 s5p_clockevent_init(); 392 s5p_clockevent_init();
400 s5p_clocksource_init(); 393 s5p_clocksource_init();
401} 394}
402
403struct sys_timer s5p_timer = {
404 .init = s5p_timer_init,
405};
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c
index 60552e22f22e..73defd00c3e4 100644
--- a/arch/arm/plat-samsung/time.c
+++ b/arch/arm/plat-samsung/time.c
@@ -27,6 +27,7 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/syscore_ops.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32 33
@@ -95,7 +96,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
95 * IRQs are disabled before entering here from do_gettimeofday() 96 * IRQs are disabled before entering here from do_gettimeofday()
96 */ 97 */
97 98
98static unsigned long s3c2410_gettimeoffset (void) 99static u32 s3c2410_gettimeoffset(void)
99{ 100{
100 unsigned long tdone; 101 unsigned long tdone;
101 unsigned long tval; 102 unsigned long tval;
@@ -120,7 +121,7 @@ static unsigned long s3c2410_gettimeoffset (void)
120 tdone += timer_startval; 121 tdone += timer_startval;
121 } 122 }
122 123
123 return timer_ticks_to_usec(tdone); 124 return timer_ticks_to_usec(tdone) * 1000;
124} 125}
125 126
126 127
@@ -271,15 +272,16 @@ static void __init s3c2410_timer_resources(void)
271 clk_enable(tin); 272 clk_enable(tin);
272} 273}
273 274
274static void __init s3c2410_timer_init(void) 275static struct syscore_ops s3c24xx_syscore_ops = {
276 .resume = s3c2410_timer_setup,
277};
278
279void __init s3c24xx_timer_init(void)
275{ 280{
281 arch_gettimeoffset = s3c2410_gettimeoffset;
282
276 s3c2410_timer_resources(); 283 s3c2410_timer_resources();
277 s3c2410_timer_setup(); 284 s3c2410_timer_setup();
278 setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); 285 setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
286 register_syscore_ops(&s3c24xx_syscore_ops);
279} 287}
280
281struct sys_timer s3c24xx_timer = {
282 .init = s3c2410_timer_init,
283 .offset = s3c2410_gettimeoffset,
284 .resume = s3c2410_timer_setup
285};