@@ -11,6 +11,7 @@ config CPU_S5PC100
bool
select S5P_EXT_INT
select SAMSUNG_DMADEV
+ select S5P_CLOCK if !COMMON_CLK
help
Enable S5PC100 CPU support
@@ -50,6 +51,13 @@ config S5PC100_SETUP_SPI
help
Common setup code for SPI GPIO configurations.
+config COMMON_CLK_S5PC100
+ bool "Common Clock Framework support"
+ default y
+ select COMMON_CLK
+ help
+ Common setup code for common clock framework.
+
config MACH_SMDKC100
bool "SMDKC100"
select CPU_S5PC100
@@ -11,8 +11,8 @@ obj- :=
# Core
-obj-y += common.o clock.o
-
+obj-y += common.o
+obj-$(CONFIG_S5P_CLOCK) += clock.o
obj-y += dma.o
# machine support
@@ -40,7 +40,13 @@
#include <plat/cpu.h>
#include <plat/devs.h>
+
+#ifdef CONFIG_S5P_CLOCK
#include <plat/clock.h>
+#else
+#include <linux/clk-provider.h>
+#endif
+
#include <plat/sdhci.h>
#include <plat/adc-core.h>
#include <plat/ata-core.h>
@@ -54,6 +60,18 @@
#include "common.h"
+static unsigned long xxti_f, xusbxti_f;
+
+void __init s5pc100_set_xxti_freq(unsigned long freq)
+{
+ xxti_f = freq;
+}
+
+void __init s5pc100_set_xusbxti_freq(unsigned long freq)
+{
+ xusbxti_f = freq;
+}
+
static const char name_s5pc100[] = "S5PC100";
static struct cpu_table cpu_ids[] __initdata = {
@@ -201,13 +219,14 @@ void __init s5pc100_map_io(void)
void __init s5pc100_init_clocks(int xtal)
{
+#ifdef CONFIG_S5P_CLOCK
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
s3c24xx_register_baseclocks(xtal);
s5p_register_clocks(xtal);
s5pc100_register_clocks();
s5pc100_setup_clocks();
- samsung_wdt_reset_init(S3C_VA_WATCHDOG);
+#endif
}
void __init s5pc100_init_irq(void)
@@ -216,6 +235,8 @@ void __init s5pc100_init_irq(void)
/* VIC0, VIC1, and VIC2 are fully populated. */
s5p_init_irq(vic, ARRAY_SIZE(vic));
+ s5pc100_clk_init(NULL, xxti_f, xusbxti_f, S3C_VA_SYS);
+ samsung_wdt_reset_init(S3C_VA_WATCHDOG);
}
static struct bus_type s5pc100_subsys = {
@@ -14,6 +14,19 @@
#include <linux/reboot.h>
+void s5pc100_set_xxti_freq(unsigned long freq);
+void s5pc100_set_xusbxti_freq(unsigned long freq);
+
+#ifdef CONFIG_COMMON_CLK_S5PC100
+void s5pc100_clk_init(struct device_node *np,
+ unsigned long xxti_f, unsigned long xusbxti_f,
+ void __iomem *reg_base);
+#else
+static inline void s5pc100_clk_init(struct device_node *np,
+ unsigned long xxti_f, unsigned long xusbxti_f,
+ void __iomem *reg_base) {}
+#endif
+
void s5pc100_init_io(struct map_desc *mach_desc, int size);
void s5pc100_init_irq(void);
@@ -221,7 +221,8 @@ static struct platform_pwm_backlight_data smdkc100_bl_data = {
static void __init smdkc100_map_io(void)
{
s5pc100_init_io(NULL, 0);
- s3c24xx_init_clocks(12000000);
+ s5pc100_set_xxti_freq(12000000);
+ s5pc100_set_xusbxti_freq(24000000);
s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
}
@@ -91,7 +91,7 @@ config SAMSUNG_CLKSRC
used by newer systems such as the S3C64XX.
config S5P_CLOCK
- def_bool (ARCH_S5P64X0 || ARCH_S5PC100)
+ def_bool ARCH_S5P64X0
help
Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs