Skip to contentSkip to conversation

EXYNOS: Make EXYNOS common cpufreq driver

PATCH In review Kukjin Kim 2 participants 4 messages Dec 7, 2011 – Dec 24, 2011

Subsystems (4)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH 4/5 EXYNOS: Make EXYNOS common cpufreq driver

From: Jaecheol Lee <[email protected]>

To support various EXYNOS series SoCs commonly, added exynos common structure.
exynos-cpufreq.c => EXYNOS series common cpufreq driver exynos4210-cpufreq.c => EXYNOS4210 support cpufreq driver

---
 arch/arm/mach-exynos/include/mach/cpufreq.h |   34 +++
 drivers/cpufreq/Kconfig.arm                 |   15 +-
 drivers/cpufreq/Makefile                    |    1 +
 drivers/cpufreq/exynos-cpufreq.c            |  296 ++++++++++++++++++++
 drivers/cpufreq/exynos4210-cpufreq.c        |  385 +++++----------------------
 5 files changed, 414 insertions(+), 317 deletions(-)
 create mode 100644 arch/arm/mach-exynos/include/mach/cpufreq.h
 create mode 100644 drivers/cpufreq/exynos-cpufreq.c
arch/arm/mach-exynos/include/mach/cpufreq.h new file +34 -0
new file mode 100644
index 0000000..3df27f2
@@ -0,0 +1,34 @@
+/* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * EXYNOS - CPUFreq support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+enum cpufreq_level_index {
+	L0, L1, L2, L3, L4,
+	L5, L6, L7, L8, L9,
+	L10, L11, L12, L13, L14,
+	L15, L16, L17, L18, L19,
+	L20,
+};
+
+struct exynos_dvfs_info {
+	unsigned long	mpll_freq_khz;
+	unsigned int	pll_safe_idx;
+	unsigned int	pm_lock_idx;
+	unsigned int	max_support_idx;
+	unsigned int	min_support_idx;
+	struct clk	*cpu_clk;
+	unsigned int	*volt_table;
+	struct cpufreq_frequency_table	*freq_table;
+	void (*set_freq)(unsigned int, unsigned int);
+	bool (*need_apll_change)(unsigned int, unsigned int);
+};
+
+extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
drivers/cpufreq/Kconfig.arm +11 -4
index 72a0044..e0664fe 100644
@@ -21,12 +21,19 @@ config ARM_S5PV210_CPUFREQ
 
 	  If in doubt, say N.
 
+config ARM_EXYNOS_CPUFREQ
+	bool "SAMSUNG EXYNOS SoCs"
+	depends on ARCH_EXYNOS
+	select ARM_EXYNOS4210_CPUFREQ if CPU_EXYNOS4210
+	default y
+	help
+	  This adds the CPUFreq driver common part for Samsung
+	  EXYNOS SoCs.
+
+	  If in doubt, say N.
+
 config ARM_EXYNOS4210_CPUFREQ
 	bool "Samsung EXYNOS4210"
-	depends on CPU_EXYNOS4210
-	default y
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS4210
 	  SoC (S5PV310 or S5PC210).
-
-	  If in doubt, say N.
drivers/cpufreq/Makefile +1 -0
index a48bc02..48cfff7 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_X86_CPUFREQ_NFORCE2)	+= cpufreq-nforce2.o
 obj-$(CONFIG_UX500_SOC_DB8500)		+= db8500-cpufreq.o
 obj-$(CONFIG_ARM_S3C64XX_CPUFREQ)	+= s3c64xx-cpufreq.o
 obj-$(CONFIG_ARM_S5PV210_CPUFREQ)	+= s5pv210-cpufreq.o
+obj-$(CONFIG_ARM_EXYNOS_CPUFREQ)	+= exynos-cpufreq.o
 obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ)	+= exynos4210-cpufreq.o
 
 ##################################################################################
drivers/cpufreq/exynos-cpufreq.c new file +296 -0

296 lines not on this page · raw message

drivers/cpufreq/exynos4210-cpufreq.c +72 -313

511 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines · Kukjin Kim

From: Jaecheol Lee <[email protected]>

To support various EXYNOS series SoCs commonly, added exynos common structure.
exynos-cpufreq.c => EXYNOS series common cpufreq driver exynos4210-cpufreq.c => EXYNOS4210 support cpufreq driver

Please rediff this one and resend. It doesn't apply on top of the other patches..

Applying: [CPUFREQ] EXYNOS4210: Remove code about bus on cpufreq
Applying: [CPUFREQ] EXYNOS4210: Update frequency table for cpu divider
Applying: [CPUFREQ] EXYNOS4210: cpufreq code is changed for stable working
Applying: [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver
error: patch failed: drivers/cpufreq/Makefile:42
error: drivers/cpufreq/Makefile: patch does not apply
Patch failed at 0005 [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".

I'll push out what I have applied so far to cpufreq.next

thanks,
Dave

author
#2 lore raw
Quoted 26 lines · Dave Jones
Quoted 9 lines · Kukjin Kim

From: Jaecheol Lee <[email protected]>

To support various EXYNOS series SoCs commonly, added exynos common structure.
exynos-cpufreq.c => EXYNOS series common cpufreq driver exynos4210-cpufreq.c => EXYNOS4210 support cpufreq driver

Please rediff this one and resend. It doesn't apply on top of the other patches..

Applying: [CPUFREQ] EXYNOS4210: Remove code about bus on cpufreq
Applying: [CPUFREQ] EXYNOS4210: Update frequency table for cpu divider
Applying: [CPUFREQ] EXYNOS4210: cpufreq code is changed for stable working
Applying: [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver
error: patch failed: drivers/cpufreq/Makefile:42
error: drivers/cpufreq/Makefile: patch does not apply
Patch failed at 0005 [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".

Quoted 2 lines

I'll push out what I have applied so far to cpufreq.next

Hi Dave

You can find updated 4th patch at below.
I rebased it on your latest cpufreq/next branch.
And the 5th patch has no problem to apply.

If any problem, please let me know.

As a note, since my git send-email has problem, re-submitted them on Sunday. Please kindly ignore that.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

From 6cfb3b48905c4e5796fe79688df0ef123df2140d Mon Sep 17 00:00:00 2001
From: Jaecheol Lee <[email protected]>
Date: Tue, 6 Dec 2011 10:02:38 +0900
Subject: [PATCH V2 4/5] [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver

To support various EXYNOS series SoCs commonly, added exynos common structure.
exynos-cpufreq.c => EXYNOS series common cpufreq driver exynos4210-cpufreq.c => EXYNOS4210 support cpufreq driver

---
Changes since v1:
- Rebased on latest cpufreq repository.

 arch/arm/mach-exynos/include/mach/cpufreq.h |   34 +++
 drivers/cpufreq/Kconfig.arm                 |   15 +-
 drivers/cpufreq/Makefile                    |    1 +
 drivers/cpufreq/exynos-cpufreq.c            |  296 ++++++++++++++++++++
 drivers/cpufreq/exynos4210-cpufreq.c        |  385 +++++----------------------
 5 files changed, 414 insertions(+), 317 deletions(-)
 create mode 100644 arch/arm/mach-exynos/include/mach/cpufreq.h
 create mode 100644 drivers/cpufreq/exynos-cpufreq.c
arch/arm/mach-exynos/include/mach/cpufreq.h new file +34 -0
new file mode 100644
index 0000000..3df27f2
@@ -0,0 +1,34 @@
+/* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * EXYNOS - CPUFreq support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+enum cpufreq_level_index {
+	L0, L1, L2, L3, L4,
+	L5, L6, L7, L8, L9,
+	L10, L11, L12, L13, L14,
+	L15, L16, L17, L18, L19,
+	L20,
+};
+
+struct exynos_dvfs_info {
+	unsigned long	mpll_freq_khz;
+	unsigned int	pll_safe_idx;
+	unsigned int	pm_lock_idx;
+	unsigned int	max_support_idx;
+	unsigned int	min_support_idx;
+	struct clk	*cpu_clk;
+	unsigned int	*volt_table;
+	struct cpufreq_frequency_table	*freq_table;
+	void (*set_freq)(unsigned int, unsigned int);
+	bool (*need_apll_change)(unsigned int, unsigned int);
+};
+
+extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
drivers/cpufreq/Kconfig.arm +11 -4
index 72a0044..e0664fe 100644
@@ -21,12 +21,19 @@ config ARM_S5PV210_CPUFREQ
 
 	  If in doubt, say N.
 
+config ARM_EXYNOS_CPUFREQ
+	bool "SAMSUNG EXYNOS SoCs"
+	depends on ARCH_EXYNOS
+	select ARM_EXYNOS4210_CPUFREQ if CPU_EXYNOS4210
+	default y
+	help
+	  This adds the CPUFreq driver common part for Samsung
+	  EXYNOS SoCs.
+
+	  If in doubt, say N.
+
 config ARM_EXYNOS4210_CPUFREQ
 	bool "Samsung EXYNOS4210"
-	depends on CPU_EXYNOS4210
-	default y
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS4210
 	  SoC (S5PV310 or S5PC210).
-
-	  If in doubt, say N.
drivers/cpufreq/Makefile +1 -0
index ce75fcb..ac000fa 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_X86_CPUFREQ_NFORCE2)	+= cpufreq-nforce2.o
 obj-$(CONFIG_UX500_SOC_DB8500)		+= db8500-cpufreq.o
 obj-$(CONFIG_ARM_S3C64XX_CPUFREQ)	+= s3c64xx-cpufreq.o
 obj-$(CONFIG_ARM_S5PV210_CPUFREQ)	+= s5pv210-cpufreq.o
+obj-$(CONFIG_ARM_EXYNOS_CPUFREQ)	+= exynos-cpufreq.o
 obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ)	+= exynos4210-cpufreq.o
 obj-$(CONFIG_ARCH_OMAP2PLUS)            += omap-cpufreq.o
 
drivers/cpufreq/exynos-cpufreq.c new file +296 -0

296 lines not on this page · raw message

drivers/cpufreq/exynos4210-cpufreq.c +72 -313

511 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#3 lore raw
In reply to Dave Jones
Quoted 29 lines · Kukjin Kim
Quoted 12 lines · Dave Jones
Quoted 9 lines · Kukjin Kim

From: Jaecheol Lee <[email protected]>

To support various EXYNOS series SoCs commonly, added exynos common structure.
exynos-cpufreq.c => EXYNOS series common cpufreq driver exynos4210-cpufreq.c => EXYNOS4210 support cpufreq driver

Quoted 6 lines

Please rediff this one and resend. It doesn't apply on top of the other patches..

Applying: [CPUFREQ] EXYNOS4210: Remove code about bus on cpufreq
Applying: [CPUFREQ] EXYNOS4210: Update frequency table for cpu divider
Applying: [CPUFREQ] EXYNOS4210: cpufreq code is changed for stable

working

Quoted 8 lines

Applying: [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver
error: patch failed: drivers/cpufreq/Makefile:42
error: drivers/cpufreq/Makefile: patch does not apply
Patch failed at 0005 [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".

Quoted 8 lines
Quoted 2 lines

I'll push out what I have applied so far to cpufreq.next

Hi Dave

You can find updated 4th patch at below.
I rebased it on your latest cpufreq/next branch. And the 5th patch has no problem to apply.

Hi Dave,

I couldn't find 4th and 5th patches in your cpufreq yet. If any problem, please let me know.

Merry Christmas!
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 13 lines

If any problem, please let me know.

As a note, since my git send-email has problem, re-submitted them on Sunday.
Please kindly ignore that.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

(snip)