mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Kukjin Kim" <kgene.kim@samsung.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Olof Johansson" <olof@lixom.net>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Tomasz Figa" <tomasz.figa@gmail.com>
Subject: [PATCH 02/19] ARM: s5pv210: Migrate clock handling to Common Clock Framework
Date: Fri, 04 Jul 2014 19:48:02 +0200	[thread overview]
Message-ID: <1404496099-26708-3-git-send-email-t.figa@samsung.com> (raw)
In-Reply-To: <1404496099-26708-1-git-send-email-t.figa@samsung.com>

From: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>

This patch migrates the s5pv210 platform to use new clock driver
using Common Clock Framework.

Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[t.figa: Rebased and fixed merge conflicts.]
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 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 <linux/dma-mapping.h>
 #include <linux/serial_core.h>
 #include <linux/serial_s3c.h>
+#include <linux/of.h>
 
 #include <asm/proc-fns.h>
 #include <asm/mach/arch.h>
@@ -35,7 +36,13 @@
 #include <mach/regs-clock.h>
 
 #include <plat/cpu.h>
+
+#ifdef CONFIG_S5P_CLOCK
 #include <plat/clock.h>
+#else
+#include <linux/clk-provider.h>
+#endif
+
 #include <plat/devs.h>
 #include <plat/sdhci.h>
 #include <plat/adc-core.h>
@@ -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 <linux/reboot.h>
 
+#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
 
-- 
1.9.3


  parent reply	other threads:[~2014-07-04 17:52 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 17:48 [PATCH 00/19] ARM: SAMSUNG: S5PV210 platform clean-up Tomasz Figa
2014-07-04 17:48 ` [PATCH 01/19] clk: samsung: Add clock driver for S5PV210 and compatible SoCs Tomasz Figa
2014-07-04 17:48 ` Tomasz Figa [this message]
2014-07-04 17:48 ` [PATCH 03/19] cpufreq: s3c24xx: Remove some dead code Tomasz Figa
2014-07-04 17:48 ` [PATCH 04/19] serial: samsung: Remove support for legacy clock code Tomasz Figa
2014-07-16  9:27   ` Paul Bolle
2014-07-16 12:43     ` Tomasz Figa
2014-07-16 14:26       ` Paul Bolle
2014-07-16 14:35         ` Paul Bolle
2014-07-16 14:43           ` Tomasz Figa
2014-09-04  9:39             ` Paul Bolle
2014-09-04  9:42               ` Paul Bolle
2014-07-04 17:48 ` [PATCH 05/19] ARM: SAMSUNG: Remove " Tomasz Figa
2014-07-04 17:48 ` [PATCH 06/19] clk: samsung: Add S5PV210 Audio Subsystem clock driver Tomasz Figa
2014-07-04 17:48 ` [PATCH 07/19] phy: Add support for S5PV210 to the Exynos USB 2.0 PHY driver Tomasz Figa
2014-07-04 17:48 ` [PATCH 08/19] ARM: s5pv210: Add board file for boot using Device Tree Tomasz Figa
2014-07-04 17:48 ` [PATCH 09/19] ARM: Samsung: DT: Add Device tree for s5pv210 Tomasz Figa
2014-07-04 17:48 ` [PATCH 10/19] ARM: Samsung: DT: Add Device tree for S5PC110/S5PV210 Boards Tomasz Figa
2014-07-04 17:48 ` [PATCH 11/19] ARM: S5PV210: Remove support for board files Tomasz Figa
2014-07-16 10:04   ` Paul Bolle
2014-07-16 12:53     ` Tomasz Figa
2014-09-04 10:05       ` Paul Bolle
2014-09-04 16:02         ` Arnd Bergmann
2014-09-05 12:04           ` Paul Bolle
2014-09-05 12:28             ` Arnd Bergmann
2014-09-18  9:43           ` [PATCH] ASoC: samsung: Remove goni or aquila with the WM8994 Paul Bolle
2014-09-18 17:57             ` Mark Brown
2014-09-18 21:57               ` Paul Bolle
2014-09-23  1:04                 ` Mark Brown
2014-09-24 20:27                   ` Paul Bolle
2014-09-18 10:42           ` [PATCH] ASoC: samsung: Remove PCM support for WM8580 on SMDK Paul Bolle
2014-09-18 17:59             ` Mark Brown
2014-07-04 17:48 ` [PATCH 12/19] ARM: S5PV210: Untie PM support from legacy code Tomasz Figa
2014-07-04 17:48 ` [PATCH 13/19] ARM: s5pv210: move debug-macro.S into the common space Tomasz Figa
2014-07-15 23:54   ` Kukjin Kim
2014-07-16  0:53     ` Kukjin Kim
2014-07-16  0:56       ` Tomasz Figa
2014-07-18 19:38         ` Kukjin Kim
2014-07-18 23:25           ` Tomasz Figa
2014-07-04 17:48 ` [PATCH 14/19] ARM: s5pv210: Register cpufreq platform device Tomasz Figa
2014-07-04 17:48 ` [PATCH 15/19] cpufreq: s5pv210: Make the driver multiplatform aware Tomasz Figa
2014-07-04 17:48 ` [PATCH 16/19] ARM: s5pv210: Enable multi-platform build support Tomasz Figa
2014-07-04 17:48 ` [PATCH 17/19] gpio: samsung: Remove legacy support of S5PV210 Tomasz Figa
2014-07-15 23:52   ` Kukjin Kim
2014-07-04 17:48 ` [PATCH 18/19] ARM: SAMSUNG: Remove remaining legacy code Tomasz Figa
2014-07-04 20:23   ` Arnd Bergmann
2014-07-08 14:10     ` Tomasz Figa
2014-07-16  9:47   ` Paul Bolle
2014-07-16 12:56     ` Tomasz Figa
2014-07-17 10:10       ` Paul Bolle
2014-07-17 10:12         ` Paul Bolle
2014-07-16 10:15   ` Paul Bolle
2014-07-16 12:58     ` Tomasz Figa
2014-09-04 10:16       ` Paul Bolle
2014-09-18 19:29         ` Paul Bolle
2014-09-18 19:33           ` Tomasz Figa
2014-07-16 10:24   ` Paul Bolle
2014-07-16 13:00     ` Tomasz Figa
2014-09-04 10:08       ` Paul Bolle
2014-09-04 16:03         ` Arnd Bergmann
2014-09-18  8:57           ` [PATCH] gpio: samsung: Remove remaining check for CONFIG_S5P_GPIO_DRVSTR Paul Bolle
2014-09-18 19:34             ` Tomasz Figa
2014-09-23 15:42             ` Linus Walleij
2014-07-04 17:48 ` [PATCH 19/19] clk: samsung: s5pv210: Remove legacy board support Tomasz Figa
2014-07-04 17:53 ` [PATCH 00/19] ARM: SAMSUNG: S5PV210 platform clean-up Tomasz Figa
2014-07-04 20:15 ` Arnd Bergmann
2014-07-12 22:57   ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404496099-26708-3-git-send-email-t.figa@samsung.com \
    --to=t.figa@samsung.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=olof@lixom.net \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®