Skip to contentSkip to conversation

cpufreq: exynos: Fix the compile error

PATCH In review Jonghwan Choi 5 participants 11 messages May 16, 2014 – May 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 cpufreq: exynos: Fix the compile error

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1
make[2]: *** Waiting for unfinished jobs....
drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

---
 drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
 drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
 drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
 3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +17 -3
index f99cfe2..9aecffef 100644
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/cpufreq.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <plat/cpu.h>
 
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
 	if (!exynos_info)
 		return -ENOMEM;
 
-	if (soc_is_exynos4210())
+	if (of_machine_is_compatible("samsung,exynos4210")) {
+		exynos_info->type = EXYNOS_SOC_4210;
+	} else if (of_machine_is_compatible("samsung,exynos4212")) {
+		exynos_info->type = EXYNOS_SOC_4212;
+	} else if (of_machine_is_compatible("samsung,exynos4412")) {
+		exynos_info->type = EXYNOS_SOC_4212;
+	} else if (of_machine_is_compatible("samsung,exynos5250")) {
+		exynos_info->type = EXYNOS_SOC_5250;
+	} else {
+		pr_err("%s: Unknown SoC type\n", __func__);
+		return -ENODEV;
+	}
+
+	if (exynos_info->type == EXYNOS_SOC_4210)
 		ret = exynos4210_cpufreq_init(exynos_info);
-	else if (soc_is_exynos4212() || soc_is_exynos4412())
+	else if (exynos_info->type == EXYNOS_SOC_4212 || exynos_info->type == EXYNOS_SOC_4412)
 		ret = exynos4x12_cpufreq_init(exynos_info);
-	else if (soc_is_exynos5250())
+	else if (exynos_info->type == EXYNOS_SOC_5250)
 		ret = exynos5250_cpufreq_init(exynos_info);
 	else
 		return 0;
drivers/cpufreq/exynos-cpufreq.h +8 -0
index 3ddade8..f189547 100644
@@ -17,6 +17,13 @@ enum cpufreq_level_index {
 	L20,
 };
 
+enum exynos_soc_type {
+	EXYNOS_SOC_4210,
+	EXYNOS_SOC_4212,
+	EXYNOS_SOC_4412,
+	EXYNOS_SOC_5250,
+};
+
 #define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \
 	{ \
 		.freq = (f) * 1000, \
@@ -34,6 +41,7 @@ struct apll_freq {
 };
 
 struct exynos_dvfs_info {
+	enum exynos_soc_type type;
 	unsigned long	mpll_freq_khz;
 	unsigned int	pll_safe_idx;
 	struct clk	*cpu_clk;
drivers/cpufreq/exynos4x12-cpufreq.c +4 -7
index 466c76a..63a3907 100644
@@ -100,7 +100,6 @@ static struct apll_freq apll_freq_4412[] = {
 static void exynos4x12_set_clkdiv(unsigned int div_index)
 {
 	unsigned int tmp;
-	unsigned int stat_cpu1;
 
 	/* Change Divider - CPU0 */
 
@@ -115,13 +114,11 @@ static void exynos4x12_set_clkdiv(unsigned int div_index)
 	tmp = apll_freq_4x12[div_index].clk_div_cpu1;
 
 	__raw_writel(tmp, EXYNOS4_CLKDIV_CPU1);
-	if (soc_is_exynos4212())
-		stat_cpu1 = 0x11;
-	else
-		stat_cpu1 = 0x111;
 
-	while (__raw_readl(EXYNOS4_CLKDIV_STATCPU1) & stat_cpu1)
+	do {
 		cpu_relax();
+		tmp = __raw_readl(EXYNOS4_CLKDIV_STATCPU1);
+	} while (tmp != 0x0);
 }
 
 static void exynos4x12_set_apll(unsigned int index)
@@ -184,7 +181,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
 	if (IS_ERR(mout_apll))
 		goto err_mout_apll;
 
-	if (soc_is_exynos4212())
+	if (info->type == EXYNOS_SOC_4212)
 		apll_freq_4x12 = apll_freq_4212;
 	else
 		apll_freq_4x12 = apll_freq_4412;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 22 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage
for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':

Quoted 9 lines

drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Probably,
Suggested-by: Tomasz Figa ?

Quoted 1 line

Looks better.

Rafael, if you have no objection on this, shall I pick this into samsung tree for 3.16 because of the current build breakage with enabling exynos cpufreq?

Thanks,
Kukjin

Quoted 120 lines
---
 drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
 drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
 drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
 3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos- renamed from drivers/cpufreq/exynos-cpufreq.c +0 -0

cpufreq.c
index f99cfe2..9aecffef 100644

drivers/cpufreq/exynos-cpufreq.c +17 -3
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/cpufreq.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <plat/cpu.h>
 
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct
 platform_device *pdev)
 	if (!exynos_info)
 		return -ENOMEM;
 
-	if (soc_is_exynos4210())
+	if (of_machine_is_compatible("samsung,exynos4210")) {
+		exynos_info->type = EXYNOS_SOC_4210;
+	} else if (of_machine_is_compatible("samsung,exynos4212")) {
+		exynos_info->type = EXYNOS_SOC_4212;
+	} else if (of_machine_is_compatible("samsung,exynos4412")) {
+		exynos_info->type = EXYNOS_SOC_4212;
+	} else if (of_machine_is_compatible("samsung,exynos5250")) {
+		exynos_info->type = EXYNOS_SOC_5250;
+	} else {
+		pr_err("%s: Unknown SoC type\n", __func__);
+		return -ENODEV;
+	}
+
+	if (exynos_info->type == EXYNOS_SOC_4210)
 		ret = exynos4210_cpufreq_init(exynos_info);
-	else if (soc_is_exynos4212() || soc_is_exynos4412())
+	else if (exynos_info->type == EXYNOS_SOC_4212 || exynos_info->type
 == EXYNOS_SOC_4412)
 		ret = exynos4x12_cpufreq_init(exynos_info);
-	else if (soc_is_exynos5250())
+	else if (exynos_info->type == EXYNOS_SOC_5250)
 		ret = exynos5250_cpufreq_init(exynos_info);
drivers/cpufreq/exynos-cpufreq.c +0 -0
 	else
 		return 0;
drivers/cpufreq/exynos- renamed from drivers/cpufreq/exynos-cpufreq.h +0 -0

cpufreq.h
index 3ddade8..f189547 100644

drivers/cpufreq/exynos-cpufreq.h +7 -0
@@ -17,6 +17,13 @@ enum cpufreq_level_index {
 	L20,
 };
 
+enum exynos_soc_type {
+	EXYNOS_SOC_4210,
+	EXYNOS_SOC_4212,
+	EXYNOS_SOC_4412,
+	EXYNOS_SOC_5250,
+};
+
 #define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s)
 \
 	{ \
drivers/cpufreq/exynos-cpufreq.h +1 -0
 		.freq = (f) * 1000, \
@@ -34,6 +41,7 @@ struct apll_freq {
 };
 
 struct exynos_dvfs_info {
+	enum exynos_soc_type type;
 	unsigned long	mpll_freq_khz;
 	unsigned int	pll_safe_idx;
 	struct clk	*cpu_clk;
drivers/cpufreq/exynos4x12-cpufreq.c +3 -6
index 466c76a..63a3907 100644
@@ -100,7 +100,6 @@ static struct apll_freq apll_freq_4412[] = {
 static void exynos4x12_set_clkdiv(unsigned int div_index)
 {
 	unsigned int tmp;
-	unsigned int stat_cpu1;
 
 	/* Change Divider - CPU0 */
 
@@ -115,13 +114,11 @@ static void exynos4x12_set_clkdiv(unsigned int
 div_index)
 	tmp = apll_freq_4x12[div_index].clk_div_cpu1;
 
 	__raw_writel(tmp, EXYNOS4_CLKDIV_CPU1);
-	if (soc_is_exynos4212())
-		stat_cpu1 = 0x11;
-	else
-		stat_cpu1 = 0x111;
 
-	while (__raw_readl(EXYNOS4_CLKDIV_STATCPU1) & stat_cpu1)
+	do {
 		cpu_relax();
+		tmp = __raw_readl(EXYNOS4_CLKDIV_STATCPU1);
+	} while (tmp != 0x0);
 }
 

static void exynos4x12_set_apll(unsigned int index)

drivers/cpufreq/exynos4x12-cpufreq.c +1 -1
@@ -184,7 +181,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info
 *info)
 	if (IS_ERR(mout_apll))
 		goto err_mout_apll;
 
-	if (soc_is_exynos4212())
+	if (info->type == EXYNOS_SOC_4212)
 		apll_freq_4x12 = apll_freq_4212;
 	else

apll_freq_4x12 = apll_freq_4412;
--
1.7.10.4

maintainer
#7 lore raw
In reply to Jonghwan Choi
Quoted 13 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Quoted 8 lines

make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1
make[2]: *** Waiting for unfinished jobs....
drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2

Blank line here..

Quoted 22 lines

This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

---
 drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
 drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
 drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
 3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -0
index f99cfe2..9aecffef 100644
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/cpufreq.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <plat/cpu.h>
 

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 172

Quoted 10 lines
drivers/cpufreq/exynos-cpufreq.c +6 -1
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
        if (!exynos_info)
                return -ENOMEM;
 
-       if (soc_is_exynos4210())
+       if (of_machine_is_compatible("samsung,exynos4210")) {
+               exynos_info->type = EXYNOS_SOC_4210;
+       } else if (of_machine_is_compatible("samsung,exynos4212")) {
+               exynos_info->type = EXYNOS_SOC_4212;
+       } else if (of_machine_is_compatible("samsung,exynos4412")) {
+               exynos_info->type = EXYNOS_SOC_4212;

4412 ?

Quoted 7 lines
drivers/cpufreq/exynos-cpufreq.c +7 -0
+       } else if (of_machine_is_compatible("samsung,exynos5250")) {
+               exynos_info->type = EXYNOS_SOC_5250;
+       } else {
+               pr_err("%s: Unknown SoC type\n", __func__);
+               return -ENODEV;
+       }
+

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 187

Quoted 10 lines
drivers/cpufreq/exynos-cpufreq.c +3 -2
+       if (exynos_info->type == EXYNOS_SOC_4210)
                ret = exynos4210_cpufreq_init(exynos_info);
-       else if (soc_is_exynos4212() || soc_is_exynos4412())
+       else if (exynos_info->type == EXYNOS_SOC_4212 || exynos_info->type == EXYNOS_SOC_4412)
                ret = exynos4x12_cpufreq_init(exynos_info);
-       else if (soc_is_exynos5250())
+       else if (exynos_info->type == EXYNOS_SOC_5250)
                ret = exynos5250_cpufreq_init(exynos_info);
        else
                return 0;

Do this in the first if/else only..

#2 lore raw
In reply to Kukjin Kim
Quoted 36 lines · Kukjin Kim
Quoted 22 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage
for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':

Quoted 9 lines

drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Probably,
Suggested-by: Tomasz Figa ?

Quoted 7 lines
Quoted 1 line

Looks better.

Rafael, if you have no objection on this, shall I pick this into samsung tree for 3.16 because of the current build breakage with enabling exynos cpufreq?

Please go ahead.

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#3 lore raw
Quoted 39 lines · Rafael J. Wysocki
Quoted 38 lines · Kukjin Kim
Quoted 22 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage
for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':

Quoted 9 lines

drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Probably,
Suggested-by: Tomasz Figa ?

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

Looks better.

Rafael, if you have no objection on this, shall I pick this into samsung tree for 3.16 because of the current build breakage with enabling exynos cpufreq?

Please go ahead.

Done.

Thanks,
Kukjin

#8 lore raw
In reply to Viresh Kumar
Quoted 50 lines · Viresh Kumar
Quoted 13 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration]
drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Quoted 8 lines

make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1
make[2]: *** Waiting for unfinished jobs....
drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2

Blank line here..

Quoted 25 lines

This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

---
  drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
  drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
  drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
  3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -0
index f99cfe2..9aecffef 100644
@@ -17,6 +17,7 @@
  #include<linux/regulator/consumer.h>
  #include<linux/cpufreq.h>
  #include<linux/platform_device.h>
+#include<linux/of.h>
 
  #include<plat/cpu.h>
 
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
         if (!exynos_info)
                 return -ENOMEM;
 
Quoted 10 lines

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 172

Quoted 7 lines
drivers/cpufreq/exynos-cpufreq.c +6 -1
-       if (soc_is_exynos4210())
+       if (of_machine_is_compatible("samsung,exynos4210")) {
+               exynos_info->type = EXYNOS_SOC_4210;
+       } else if (of_machine_is_compatible("samsung,exynos4212")) {
+               exynos_info->type = EXYNOS_SOC_4212;
+       } else if (of_machine_is_compatible("samsung,exynos4412")) {
+               exynos_info->type = EXYNOS_SOC_4212;

4412 ?

Yes, I will fix when I apply.

Quoted 18 lines
Quoted 7 lines
drivers/cpufreq/exynos-cpufreq.c +7 -0
+       } else if (of_machine_is_compatible("samsung,exynos5250")) {
+               exynos_info->type = EXYNOS_SOC_5250;
+       } else {
+               pr_err("%s: Unknown SoC type\n", __func__);
+               return -ENODEV;
+       }
+

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 187

Quoted 10 lines
drivers/cpufreq/exynos-cpufreq.c +3 -2
+       if (exynos_info->type == EXYNOS_SOC_4210)
                 ret = exynos4210_cpufreq_init(exynos_info);
-       else if (soc_is_exynos4212() || soc_is_exynos4412())
+       else if (exynos_info->type == EXYNOS_SOC_4212 || exynos_info->type == EXYNOS_SOC_4412)
                 ret = exynos4x12_cpufreq_init(exynos_info);
-       else if (soc_is_exynos5250())
+       else if (exynos_info->type == EXYNOS_SOC_5250)
                 ret = exynos5250_cpufreq_init(exynos_info);
         else
                 return 0;
Quoted 1 line

Do this in the first if/else only..

Probably, you mean following in above?

Quoted 1 line
Quoted 1 line

- if (soc_is_exynos4210())

I've applied this with fixing typo you mentioned just now, if any concerns, please kindly let me know.

Thanks,
Kukjin

#4 lore raw
In reply to Kukjin Kim

Hi Kukjin,

Quoted 45 lines · Kukjin Kim
Quoted 44 lines · Rafael J. Wysocki
Quoted 43 lines · Kukjin Kim
Quoted 25 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to
mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit

Quoted 9 lines

declaration of
function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Probably,
Suggested-by: Tomasz Figa ?

Quoted 1 line

Looks better.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

Rafael, if you have no objection on this, shall I pick this into samsung tree for 3.16 because of the current build breakage with enabling exynos cpufreq?

Please go ahead.

Done.

What about Viresh's comments?

Best regards,
Tomasz

#9 lore raw
In reply to Kukjin Kim
Quoted 92 lines · Kukjin Kim
Quoted 60 lines · Viresh Kumar
Quoted 20 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs....

Quoted 8 lines

drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2

Blank line here..

Quoted 28 lines

This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

---
  drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
  drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
  drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
  3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -0
index f99cfe2..9aecffef 100644
@@ -17,6 +17,7 @@
  #include<linux/regulator/consumer.h>
  #include<linux/cpufreq.h>
  #include<linux/platform_device.h>
+#include<linux/of.h>
 
  #include<plat/cpu.h>
 
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct
 platform_device *pdev)
         if (!exynos_info)
                 return -ENOMEM;
 
Quoted 10 lines

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 172

Quoted 7 lines
drivers/cpufreq/exynos-cpufreq.c +6 -1
-       if (soc_is_exynos4210())
+       if (of_machine_is_compatible("samsung,exynos4210")) {
+               exynos_info->type = EXYNOS_SOC_4210;
+       } else if (of_machine_is_compatible("samsung,exynos4212")) {
+               exynos_info->type = EXYNOS_SOC_4212;
+       } else if (of_machine_is_compatible("samsung,exynos4412")) {
+               exynos_info->type = EXYNOS_SOC_4212;

4412 ?

Yes, I will fix when I apply.

Quoted 19 lines
Quoted 18 lines
drivers/cpufreq/exynos-cpufreq.c +10 -2
+       } else if (of_machine_is_compatible("samsung,exynos5250")) {
+               exynos_info->type = EXYNOS_SOC_5250;
+       } else {
+               pr_err("%s: Unknown SoC type\n", __func__);
+               return -ENODEV;
+       }
+
+       if (exynos_info->type == EXYNOS_SOC_4210)
                 ret = exynos4210_cpufreq_init(exynos_info);
-       else if (soc_is_exynos4212() || soc_is_exynos4412())
+       else if (exynos_info->type == EXYNOS_SOC_4212 ||
 exynos_info->type == EXYNOS_SOC_4412)
                 ret = exynos4x12_cpufreq_init(exynos_info);
-       else if (soc_is_exynos5250())
+       else if (exynos_info->type == EXYNOS_SOC_5250)
                 ret = exynos5250_cpufreq_init(exynos_info);
         else
                 return 0;
Quoted 8 lines
Quoted 1 line

Do this in the first if/else only..

Probably, you mean following in above?

Quoted 1 line
Quoted 1 line

- if (soc_is_exynos4210())

I've applied this with fixing typo you mentioned just now, if any concerns, please kindly let me know.

I think Viresh meant merging the two if/else blocks together, as follows:

	if (of_machine_is_compatible("samsung,exynos4210")) {
		exynos_info->type = EXYNOS_SOC_4210;
		ret = exynos4210_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos4212")) {
		exynos_info->type = EXYNOS_SOC_4212;
		ret = exynos4x12_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos4412")) {
		exynos_info->type = EXYNOS_SOC_4412;
		ret = exynos4x12_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos5250")) {
		exynos_info->type = EXYNOS_SOC_5250;
		ret = exynos5250_cpufreq_init(exynos_info);
	} else {
		pr_err("%s: Unknown SoC type\n", __func__);
		return -ENODEV;
	}

Best regards,
Tomasz

#10 lore raw
Quoted 104 lines · Tomasz Figa
Quoted 92 lines · Kukjin Kim
Quoted 60 lines · Viresh Kumar
Quoted 20 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs....

Quoted 8 lines

drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':
drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2

Blank line here..

Quoted 28 lines

This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

---
   drivers/cpufreq/exynos-cpufreq.c     |   20 +++++++++++++++++---
   drivers/cpufreq/exynos-cpufreq.h     |    8 ++++++++
   drivers/cpufreq/exynos4x12-cpufreq.c |   11 ++++-------
   3 files changed, 29 insertions(+), 10 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -0
index f99cfe2..9aecffef 100644
@@ -17,6 +17,7 @@
   #include<linux/regulator/consumer.h>
   #include<linux/cpufreq.h>
   #include<linux/platform_device.h>
+#include<linux/of.h>
 
   #include<plat/cpu.h>
 
@@ -163,11 +164,24 @@ static int exynos_cpufreq_probe(struct
 platform_device *pdev)
          if (!exynos_info)
                  return -ENOMEM;
 
Quoted 10 lines

drivers/cpufreq/exynos-cpufreq.c static int exynos_cpufreq_probe(struct platform_device *pdev) · line 172

Quoted 7 lines
drivers/cpufreq/exynos-cpufreq.c +6 -1
-       if (soc_is_exynos4210())
+       if (of_machine_is_compatible("samsung,exynos4210")) {
+               exynos_info->type = EXYNOS_SOC_4210;
+       } else if (of_machine_is_compatible("samsung,exynos4212")) {
+               exynos_info->type = EXYNOS_SOC_4212;
+       } else if (of_machine_is_compatible("samsung,exynos4412")) {
+               exynos_info->type = EXYNOS_SOC_4212;

4412 ?

Yes, I will fix when I apply.

Quoted 19 lines
Quoted 18 lines
drivers/cpufreq/exynos-cpufreq.c +10 -2
+       } else if (of_machine_is_compatible("samsung,exynos5250")) {
+               exynos_info->type = EXYNOS_SOC_5250;
+       } else {
+               pr_err("%s: Unknown SoC type\n", __func__);
+               return -ENODEV;
+       }
+
+       if (exynos_info->type == EXYNOS_SOC_4210)
                  ret = exynos4210_cpufreq_init(exynos_info);
-       else if (soc_is_exynos4212() || soc_is_exynos4412())
+       else if (exynos_info->type == EXYNOS_SOC_4212 ||
 exynos_info->type == EXYNOS_SOC_4412)
                  ret = exynos4x12_cpufreq_init(exynos_info);
-       else if (soc_is_exynos5250())
+       else if (exynos_info->type == EXYNOS_SOC_5250)
                  ret = exynos5250_cpufreq_init(exynos_info);
          else
                  return 0;
Quoted 8 lines
Quoted 1 line

Do this in the first if/else only..

Probably, you mean following in above?

Quoted 1 line
Quoted 1 line

- if (soc_is_exynos4210())

I've applied this with fixing typo you mentioned just now, if any concerns, please kindly let me know.

I think Viresh meant merging the two if/else blocks together, as follows:

Quoted 17 lines
	if (of_machine_is_compatible("samsung,exynos4210")) {
		exynos_info->type = EXYNOS_SOC_4210;
		ret = exynos4210_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos4212")) {
		exynos_info->type = EXYNOS_SOC_4212;
		ret = exynos4x12_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos4412")) {
		exynos_info->type = EXYNOS_SOC_4412;
		ret = exynos4x12_cpufreq_init(exynos_info);
	} else if (of_machine_is_compatible("samsung,exynos5250")) {
		exynos_info->type = EXYNOS_SOC_5250;
		ret = exynos5250_cpufreq_init(exynos_info);
	} else {
		pr_err("%s: Unknown SoC type\n", __func__);
		return -ENODEV;
	}

Yeah, I just now realized same thing :(

looks better, the SoC type is only used for 4212/4412 in other place though...I will modify as per Viresh's suggestion.

Thanks,
Kukjin

#5 lore raw
In reply to Rafael J. Wysocki
Quoted 39 lines · Rafael J. Wysocki
Quoted 38 lines · Kukjin Kim
Quoted 22 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from plat to mach") which lands in samsung tree causes build breakage
for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration of function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration of function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration of function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function 'exynos4x12_set_clkdiv':

Quoted 9 lines

drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit declaration of function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Probably,
Suggested-by: Tomasz Figa ?

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

Looks better.

Rafael, if you have no objection on this, shall I pick this into samsung tree for 3.16 because of the current build breakage with enabling exynos cpufreq?

Please go ahead.

Actually, this conflicts with one patch already in my tree. The resoultion is quite obvious, but it would be better to avoid this conflict altogether.

Rafael

#6 lore raw
Quoted 53 lines · Rafael J. Wysocki
Quoted 4 lines · Rafael J. Wysocki
Quoted 3 lines · Kukjin Kim
Quoted 2 lines · Jonghwan Choi

Commit 7da83a80 ("ARM: EXYNOS: Migrate Exynos specific macros from

plat to

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

mach") which lands in samsung tree causes build breakage for cpufreq-exynos like following:

drivers/cpufreq/exynos-cpufreq.c: In function 'exynos_cpufreq_probe':
drivers/cpufreq/exynos-cpufreq.c:166:2: error: implicit declaration

of

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

function 'soc_is_exynos4210' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration

of

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

function 'soc_is_exynos4212' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:168:2: error: implicit declaration

of

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

function 'soc_is_exynos4412' [-Werror=implicit-function-declaration] drivers/cpufreq/exynos-cpufreq.c:170:2: error: implicit declaration

of

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

function 'soc_is_exynos5250' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos-cpufreq.o] Error 1 make[2]: *** Waiting for unfinished jobs.... drivers/cpufreq/exynos4x12-cpufreq.c: In function

'exynos4x12_set_clkdiv':

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/cpufreq/exynos4x12-cpufreq.c:118:2: error: implicit

declaration of

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

function 'soc_is_exynos4212' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors make[2]: *** [drivers/cpufreq/exynos4x12-cpufreq.o] Error 1 make[1]: *** [drivers/cpufreq] Error 2
This fixes above error with getting SoC information via of_machine_is_compatible() instead of soc_is_exynosXXXX().

Quoted 8 lines
Quoted 8 lines

Probably,
Suggested-by: Tomasz Figa ?

Quoted 1 line

Looks better.

Rafael, if you have no objection on this, shall I pick this into

samsung

Quoted 1 line
Quoted 1 line

tree for 3.16 because of the current build breakage with enabling

Quoted 9 lines

exynos

Quoted 3 lines
Quoted 1 line

cpufreq?

Please go ahead.

Actually, this conflicts with one patch already in my tree. The resoultion
is quite obvious, but it would be better to avoid this conflict altogether.

Yeah. If you don't mind, shall I pick the patch (commit e5eaa445b0dc)into samsung tree with your ack?

Thanks,
Kukjin