blob: 6753ee3212520e942a2e386529b60bcc62f7c332 [file] [log] [blame]
From c3e30d13af2076b4592cc1caf527592d713f5d39 Mon Sep 17 00:00:00 2001
From: Christoph Niedermaier <>
Date: Tue, 11 Feb 2020 12:58:07 +0100
Subject: [PATCH] cpufreq: imx6q: Fixes unwanted cpu overclocking on i.MX6ULL
commit 36eb7dc1bd42fe5f850329c893768ff89b696fba upstream.
imx6ul_opp_check_speed_grading is called for both i.MX6UL and i.MX6ULL.
Since the i.MX6ULL was introduced to a separate ocotp compatible node
later, it is possible that the i.MX6ULL has also dtbs with
"fsl,imx6ull-ocotp". On a system without nvmem-cell speed grade a
missing check on this node causes a driver fail without considering
the cpu speed grade.
This patch prevents unwanted cpu overclocking on i.MX6ULL with compatible
node "fsl,imx6ull-ocotp" in old dtbs without nvmem-cell speed grade.
Fixes: 2733fb0d0699 ("cpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull")
Signed-off-by: Christoph Niedermaier <>
Signed-off-by: Viresh Kumar <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 47ccfa6b17b7..7c5a01d7e3a0 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -283,6 +283,9 @@ static int imx6ul_opp_check_speed_grading(struct device *dev)
np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-ocotp");
if (!np)
+ np = of_find_compatible_node(NULL, NULL,
+ "fsl,imx6ull-ocotp");
+ if (!np)
return -ENOENT;
base = of_iomap(np, 0);