Skip to contentSkip to conversation

cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading

PATCH Applied Anson Huang 3 participants 4 messages Dec 26, 2019 – Jan 6, 2020

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

PATCH 1/2 cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading

Add i.MX8MP to blacklist, so that imx-cpufreq-dt driver can handle speed grading bits just like other i.MX8M SoCs.

---
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
index f1d170d..a2e5f3a 100644
@@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = {
 	{ .compatible = "fsl,imx8mq", },
 	{ .compatible = "fsl,imx8mm", },
 	{ .compatible = "fsl,imx8mn", },
+	{ .compatible = "fsl,imx8mp", },
 
 	{ .compatible = "marvell,armadaxp", },
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 cpufreq: imx-cpufreq-dt: Add i.MX8MP support

Add i.MX8MP cpufreq DT support for speed grading and market segment check.

---
 drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/cpufreq/imx-cpufreq-dt.c +3 -2
index 85a6efd..912e93d 100644
@@ -35,7 +35,7 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (of_machine_is_compatible("fsl,imx8mn"))
+	if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))
 		speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
 			      >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
 	else
@@ -54,7 +54,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 		if (of_machine_is_compatible("fsl,imx8mm") ||
 		    of_machine_is_compatible("fsl,imx8mq"))
 			speed_grade = 1;
-		if (of_machine_is_compatible("fsl,imx8mn"))
+		if (of_machine_is_compatible("fsl,imx8mn") ||
+			of_machine_is_compatible("fsl,imx8mp"))
 			speed_grade = 0xb;
 	}
 
Signature · 1 line
2.7.4
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] cpufreq: imx-cpufreq-dt: Add i.MX8MP support

Quoted 13 lines · Anson Huang

Add i.MX8MP cpufreq DT support for speed grading and market segment check.

---
 drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/cpufreq/imx-cpufreq-dt.c +0 -0
index 85a6efd..912e93d 100644

drivers/cpufreq/imx-cpufreq-dt.c static int imx_cpufreq_dt_probe(struct platform_device *pdev) · line 38

Quoted 5 lines
drivers/cpufreq/imx-cpufreq-dt.c +1 -1
@@ -35,7 +35,7 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (of_machine_is_compatible("fsl,imx8mn"))
+	if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))

Is there a way we could do this more generic so we won't have to add another of_machine_is_compatible if a new imx8m comes around ?

If not, please drop the second one on a new line to follow the 80 chars rule.

Then you can add:

Quoted 16 lines
drivers/cpufreq/imx-cpufreq-dt.c +2 -1
 		speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
 			      >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
 	else
@@ -54,7 +54,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 		if (of_machine_is_compatible("fsl,imx8mm") ||
 		    of_machine_is_compatible("fsl,imx8mq"))
 			speed_grade = 1;
-		if (of_machine_is_compatible("fsl,imx8mn"))
+		if (of_machine_is_compatible("fsl,imx8mn") ||
+			of_machine_is_compatible("fsl,imx8mp"))
 			speed_grade = 0xb;
 	}
 
Signature · 1 line
2.7.4
maintainer Applied
#3 lore raw
In reply to Anson Huang
Quoted 13 lines · Anson Huang

Add i.MX8MP to blacklist, so that imx-cpufreq-dt driver can handle speed grading bits just like other i.MX8M SoCs.

---
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq-dt-platdev.c +0 -0
index f1d170d..a2e5f3a 100644

drivers/cpufreq/cpufreq-dt-platdev.c static const struct of_device_id blacklist[] __initconst = { · line 114

Quoted 6 lines
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
@@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = {
 	{ .compatible = "fsl,imx8mq", },
 	{ .compatible = "fsl,imx8mm", },
 	{ .compatible = "fsl,imx8mn", },
+	{ .compatible = "fsl,imx8mp", },
 
 	{ .compatible = "marvell,armadaxp", },

Applied both (after minor formatting fixes). Thanks.

Signature · 1 line
viresh