diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-25 13:00:38 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-09-16 17:47:36 -0400 |
commit | b69f460dc1a074db3f759c2be9cd13271f91fbdd (patch) | |
tree | 394b24898f17c715ec77328608decd2925e8ab93 /arch/arm/mach-s3c64xx/common.c | |
parent | d0127f6fc12e311cdd89bb1bd62f36621778d149 (diff) |
ARM: S3C64XX: Migrate clock handling to Common Clock Framework
This patch migrates the s3c64xx platform to use the new clock driver
using Common Clock Framework.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c64xx/common.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/common.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 73d79cf5e141..7d3cb58f1856 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/clk-provider.h> | ||
20 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
21 | #include <linux/ioport.h> | 22 | #include <linux/ioport.h> |
22 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
@@ -38,7 +39,6 @@ | |||
38 | #include <mach/regs-gpio.h> | 39 | #include <mach/regs-gpio.h> |
39 | 40 | ||
40 | #include <plat/cpu.h> | 41 | #include <plat/cpu.h> |
41 | #include <plat/clock.h> | ||
42 | #include <plat/devs.h> | 42 | #include <plat/devs.h> |
43 | #include <plat/pm.h> | 43 | #include <plat/pm.h> |
44 | #include <plat/gpio-cfg.h> | 44 | #include <plat/gpio-cfg.h> |
@@ -50,6 +50,19 @@ | |||
50 | 50 | ||
51 | #include "common.h" | 51 | #include "common.h" |
52 | 52 | ||
53 | /* External clock frequency */ | ||
54 | static unsigned long xtal_f = 12000000, xusbxti_f = 48000000; | ||
55 | |||
56 | void __init s3c64xx_set_xtal_freq(unsigned long freq) | ||
57 | { | ||
58 | xtal_f = freq; | ||
59 | } | ||
60 | |||
61 | void __init s3c64xx_set_xusbxti_freq(unsigned long freq) | ||
62 | { | ||
63 | xusbxti_f = freq; | ||
64 | } | ||
65 | |||
53 | /* uart registration process */ | 66 | /* uart registration process */ |
54 | 67 | ||
55 | static void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 68 | static void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
@@ -67,7 +80,6 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
67 | .idcode = S3C6400_CPU_ID, | 80 | .idcode = S3C6400_CPU_ID, |
68 | .idmask = S3C64XX_CPU_MASK, | 81 | .idmask = S3C64XX_CPU_MASK, |
69 | .map_io = s3c6400_map_io, | 82 | .map_io = s3c6400_map_io, |
70 | .init_clocks = s3c6400_init_clocks, | ||
71 | .init_uarts = s3c64xx_init_uarts, | 83 | .init_uarts = s3c64xx_init_uarts, |
72 | .init = s3c6400_init, | 84 | .init = s3c6400_init, |
73 | .name = name_s3c6400, | 85 | .name = name_s3c6400, |
@@ -75,7 +87,6 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
75 | .idcode = S3C6410_CPU_ID, | 87 | .idcode = S3C6410_CPU_ID, |
76 | .idmask = S3C64XX_CPU_MASK, | 88 | .idmask = S3C64XX_CPU_MASK, |
77 | .map_io = s3c6410_map_io, | 89 | .map_io = s3c6410_map_io, |
78 | .init_clocks = s3c6410_init_clocks, | ||
79 | .init_uarts = s3c64xx_init_uarts, | 90 | .init_uarts = s3c64xx_init_uarts, |
80 | .init = s3c6410_init, | 91 | .init = s3c6410_init, |
81 | .name = name_s3c6410, | 92 | .name = name_s3c6410, |
@@ -213,8 +224,10 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) | |||
213 | { | 224 | { |
214 | /* | 225 | /* |
215 | * FIXME: there is no better place to put this at the moment | 226 | * FIXME: there is no better place to put this at the moment |
216 | * (samsung_wdt_reset_init needs clocks) | 227 | * (s3c64xx_clk_init needs ioremap and must happen before init_time |
228 | * samsung_wdt_reset_init needs clocks) | ||
217 | */ | 229 | */ |
230 | s3c64xx_clk_init(NULL, xtal_f, xusbxti_f, soc_is_s3c6400(), S3C_VA_SYS); | ||
218 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); | 231 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); |
219 | 232 | ||
220 | printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); | 233 | printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); |