From patchwork Fri Jul 4 17:48:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4482681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20D57BEEAA for ; Fri, 4 Jul 2014 17:53:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30CB520381 for ; Fri, 4 Jul 2014 17:53:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32AC52039D for ; Fri, 4 Jul 2014 17:53:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X37e2-0006Kp-TD; Fri, 04 Jul 2014 17:51:34 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X37bz-0002mu-PJ for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 17:49:29 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8700BJF85JDPA0@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 18:48:55 +0100 (BST) X-AuditID: cbfec7f4-b7fac6d000006cfe-26-53b6e907e0fa Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E7.AA.27902.709E6B35; Fri, 04 Jul 2014 18:48:55 +0100 (BST) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N87000DO85CNK10@eusync1.samsung.com>; Fri, 04 Jul 2014 18:48:55 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 02/19] ARM: s5pv210: Migrate clock handling to Common Clock Framework Date: Fri, 04 Jul 2014 19:48:02 +0200 Message-id: <1404496099-26708-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.9.3 In-reply-to: <1404496099-26708-1-git-send-email-t.figa@samsung.com> References: <1404496099-26708-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xy7rsL7cFG9zayGnxd9IxdoupD5+w Wfx/9JrVonfBVTaLTY+vsVpc3jWHzWLG+X1MFmuP3GW3OHX9M5vFql1/GB24PH7/msTosXPW XXaPTas62Tw2L6n3uHKiidWjb8sqRo/t1+Yxe3zeJBfAEcVlk5Kak1mWWqRvl8CVse7KXsaC 1doVpxbMYGtg7FPpYuTkkBAwkdi25S07hC0mceHeerYuRi4OIYGljBL3fr1khHD6mCQ+/LnB BlLFJqAm8bnhEZgtIqAq8bltAVA3BwezwG0miVZhkLCwQLjElyUrmEFsFqCSI4/mM4LYvAJO EnfbvzFBLJOT6N32BqyGU8BZYuK6C2BxIaCaP//ns0xg5F3AyLCKUTS1NLmgOCk911CvODG3 uDQvXS85P3cTIyQcv+xgXHzM6hCjAAejEg9v44oNwUKsiWXFlbmHGCU4mJVEeP+s2hYsxJuS WFmVWpQfX1Sak1p8iJGJg1OqgXHGzhOxFleYN0w5oJB4OfRddPwSFv7uGy9y+cQ/aa6538ly Nu2zUuc0b9YoxVOTa5W3fAk8XLr7T7jt3Y1XGZbfedQ399Ur3WjuokV68kfm5GndmNawWPyD D8OxzkWTtW0kXz4tZNSIXFZ7QPN91XaxVz/z201ltylc1FDu+9xo0Rm7Z/6TkI1KLMUZiYZa zEXFiQCHeilIJQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140704_104927_992297_248AB94E X-CRM114-Status: GOOD ( 15.10 ) X-Spam-Score: -5.0 (-----) Cc: Kukjin Kim , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Arnd Bergmann , linux-kernel@vger.kernel.org, Tomasz Figa , Mark Brown , Olof Johansson , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mateusz Krawczuk This patch migrates the s5pv210 platform to use new clock driver using Common Clock Framework. Signed-off-by: Mateusz Krawczuk Signed-off-by: Kyungmin Park [t.figa: Rebased and fixed merge conflicts.] Signed-off-by: Tomasz Figa --- arch/arm/mach-s5pv210/Kconfig | 9 +++++++++ arch/arm/mach-s5pv210/Makefile | 4 ++-- arch/arm/mach-s5pv210/common.c | 16 ++++++++++++++++ arch/arm/mach-s5pv210/common.h | 9 +++++++++ arch/arm/mach-s5pv210/mach-goni.c | 2 +- arch/arm/mach-s5pv210/mach-smdkv210.c | 2 +- arch/arm/plat-samsung/Kconfig | 2 +- 7 files changed, 39 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index f60f286..60785ce 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -13,6 +13,7 @@ config CPU_S5PV210 bool select ARM_AMBA select PL330_DMA if DMADEVICES + select S5P_CLOCK if !COMMON_CLK select S5P_EXT_INT select S5P_PM if PM select S5P_SLEEP if PM @@ -70,6 +71,14 @@ config S5PV210_SETUP_USB_PHY help Common setup code for USB PHY controller +config COMMON_CLK_S5PV210 + bool "Common Clock Framework support" + default y + select COMMON_CLK_SAMSUNG + help + Enable this option to use new clock driver + based on Common Clock Framework. + menu "S5PC110 Machines" config MACH_AQUILA diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 1c4e419..d1a493a 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -12,8 +12,8 @@ obj- := # Core -obj-y += common.o clock.o - +obj-y += common.o +obj-$(CONFIG_S5P_CLOCK) += clock.o obj-$(CONFIG_PM) += pm.o obj-y += dma.o diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 7024dcd..2e2202a 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,13 @@ #include #include + +#ifdef CONFIG_S5P_CLOCK #include +#else +#include +#endif + #include #include #include @@ -50,6 +57,9 @@ #include "common.h" +/* External clock frequency */ +static unsigned long xusbxti_f; + static const char name_s5pv210[] = "S5PV210/S5PC110"; static struct cpu_table cpu_ids[] __initdata = { @@ -229,18 +239,24 @@ void __init s5pv210_map_io(void) void __init s5pv210_init_clocks(int xtal) { +#ifdef CONFIG_S5P_CLOCK printk(KERN_DEBUG "%s: initializing clocks\n", __func__); s3c24xx_register_baseclocks(xtal); s5p_register_clocks(xtal); s5pv210_register_clocks(); s5pv210_setup_clocks(); +#else + xusbxti_f = xtal; +#endif } void __init s5pv210_init_irq(void) { u32 vic[4]; /* S5PV210 supports 4 VIC */ + s5pv210_clk_init(0, xusbxti_f, S3C_VA_SYS); + /* All the VICs are fully populated. */ vic[0] = ~0; vic[1] = ~0; diff --git a/arch/arm/mach-s5pv210/common.h b/arch/arm/mach-s5pv210/common.h index fe1beb5..a2e85cb 100644 --- a/arch/arm/mach-s5pv210/common.h +++ b/arch/arm/mach-s5pv210/common.h @@ -14,6 +14,15 @@ #include +#ifdef CONFIG_COMMON_CLK_S5PV210 +void s5pv210_clk_init(unsigned long xxti_f, unsigned long xusbxti_f, + void __iomem *reg_base); +#else +static inline void s5pv210_clk_init(unsigned long xxti_f, + unsigned long xusbxti_f, + void __iomem *reg_base) {} +#endif + void s5pv210_init_io(struct map_desc *mach_desc, int size); void s5pv210_init_irq(void); diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index c1ce921..0fc71be 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c @@ -849,7 +849,7 @@ static void __init goni_sound_init(void) static void __init goni_map_io(void) { s5pv210_init_io(NULL, 0); - s3c24xx_init_clocks(clk_xusbxti.rate); + s3c24xx_init_clocks(24000000); s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); } diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index 2a6655f..1bde3a3 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c @@ -285,7 +285,7 @@ static struct platform_pwm_backlight_data smdkv210_bl_data = { static void __init smdkv210_map_io(void) { s5pv210_init_io(NULL, 0); - s3c24xx_init_clocks(clk_xusbxti.rate); + s3c24xx_init_clocks(24000000); s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4); } diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 1c629c2..42f5d5b 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -78,7 +78,7 @@ config SAMSUNG_CLKSRC used by newer systems such as the S3C64XX. config S5P_CLOCK - def_bool ARCH_S5PV210 + bool help Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs