Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754999Ab3H1QbR (ORCPT ); Wed, 28 Aug 2013 12:31:17 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:16671 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754925Ab3H1QbO (ORCPT ); Wed, 28 Aug 2013 12:31:14 -0400 X-AuditID: cbfee61a-b7f7a6d00000235f-06-521e25d0fce0 From: Mateusz Krawczuk To: kgene.kim@samsung.com Cc: mturquette@linaro.org, tomasz.figa@gmail.com, yadi.brar@samsung.com, dianders@chromium.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, swarren@wwwdotorg.org, ian.campbell@citrix.com, rob@landley.net, thomas.abraham@linaro.org, s.nawrocki@samsung.com, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux@arm.linux.org.uk, ben-linux@fluff.org, linux-samsung-soc@vger.kernel.org, Mateusz Krawczuk Subject: [RFC 3/3] ARM: s5pc100: Migrate clock handling to Common Clock Framework Date: Wed, 28 Aug 2013 18:29:17 +0200 Message-id: <1377707357-4902-4-git-send-email-m.krawczuk@partner.samsung.com> X-Mailer: git-send-email 1.8.1.2 In-reply-to: <1377707357-4902-1-git-send-email-m.krawczuk@partner.samsung.com> References: <1377707357-4902-1-git-send-email-m.krawczuk@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRmVeSWpSXmKPExsVy+t9jQd0LqnJBBg2r5S0mrTvAZDH/yDlW i7PLDrJZvOntYLHoXXCVzWLT42usFgvblrBYXN41h81ixvl9TBa3L/NanF5zitli6fWLTBZP J1xks5gwfS2LxbqX01ksDr9pZ7V4dbCNxeLYjCWMFqt2/WG0mDP9HZODiMeaeWsYPVqae9g8 ZjdcZPF4PXkCo8ffVS+YPXbOusvu8Wr1TFaPO9f2sHlsXlLvcfDdHiaPvi2rGD0+b5Lz2Dg3 NIA3issmJTUnsyy1SN8ugStj18vVrAXT1Sv2dtxgaWA8rdDFyMkhIWAicbPnIDOELSZx4d56 ti5GLg4hgemMEqeXNjCCJIQE2pkkbj2LBrHZBMwlJj7bxAJiiwhISjQ1/GEGaWAW6GCReHrg JStIQlggWOJxawOYzSKgKtHW1AdUxMHBK+ArsWylG8QyBYmfl0+wgdicAn4Sfw59ZoXY5Sux 6dssxgmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBEfIM6kdjCsbLA4xCnAwKvHw RvyWDRJiTSwrrsw9xCjBwawkwvtbRC5IiDclsbIqtSg/vqg0J7X4EKM0B4uSOO+BVutAIYH0 xJLU7NTUgtQimCwTB6dUA+MpfY8AYcFzLyfbOSo7XV7TGNDQuP6ax8/Xd2XE1GR5oyb8TM7o PP5MWC1O/mLg8yUSr/e/5gvItDcoaOi657zsacDEYwffKD8OqZmobf3E6BGD7BGNx+o32BY9 ktlvy7aC9UOnzoxba06xGm64mDunql/1tPHXybye0trcl/875q1jjF7Na63EUpyRaKjFXFSc CAAzkaLdjAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5090 Lines: 175 This patch migrates the s5pc100 platform to use new clock driver using Common Clock Framework. Signed-off-by: Mateusz Krawczuk --- arch/arm/mach-s5pc100/Kconfig | 8 ++++++++ arch/arm/mach-s5pc100/Makefile | 4 ++-- arch/arm/mach-s5pc100/common.c | 23 ++++++++++++++++++++++- arch/arm/mach-s5pc100/common.h | 13 +++++++++++++ arch/arm/mach-s5pc100/mach-smdkc100.c | 3 ++- arch/arm/plat-samsung/Kconfig | 2 +- 6 files changed, 48 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index 15170be..ed50897 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig @@ -11,6 +11,7 @@ config CPU_S5PC100 bool select S5P_EXT_INT select SAMSUNG_DMADEV + select S5P_CLOCK if !COMMON_CLK_S5PC100 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 diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile index 118c711..74b90ec 100644 --- a/arch/arm/mach-s5pc100/Makefile +++ b/arch/arm/mach-s5pc100/Makefile @@ -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 diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index c5a8eea..d8db7b2 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c @@ -40,7 +40,13 @@ #include #include + +#ifdef CONFIG_S5P_CLOCK #include +#else +#include +#endif + #include #include #include @@ -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 = { diff --git a/arch/arm/mach-s5pc100/common.h b/arch/arm/mach-s5pc100/common.h index 08d782d..d7d80b8 100644 --- a/arch/arm/mach-s5pc100/common.h +++ b/arch/arm/mach-s5pc100/common.h @@ -14,6 +14,19 @@ #include +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); diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c index 7c57a22..1087dcb 100644 --- a/arch/arm/mach-s5pc100/mach-smdkc100.c +++ b/arch/arm/mach-s5pc100/mach-smdkc100.c @@ -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); } diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 2a98613..645f21c 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -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 -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/