Skip to content

Commit 0aa9abd

Browse files
sebszymanskirafaeljw
authored andcommitted
cpufreq: imx6q: check speed grades for i.MX6ULL
Check the max speed supported from the fuses for i.MX6ULL and update the operating points table accordingly. Signed-off-by: Sébastien Szymanski <[email protected]> Acked-by: Viresh Kumar <[email protected]> Tested-by: Stefan Agner <[email protected]> Reviewed-by: Stefan Agner <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7592019 commit 0aa9abd

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

drivers/cpufreq/imx6q-cpufreq.c

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ static void imx6q_opp_check_speed_grading(struct device *dev)
266266
}
267267

268268
#define OCOTP_CFG3_6UL_SPEED_696MHZ 0x2
269+
#define OCOTP_CFG3_6ULL_SPEED_792MHZ 0x2
270+
#define OCOTP_CFG3_6ULL_SPEED_900MHZ 0x3
269271

270272
static void imx6ul_opp_check_speed_grading(struct device *dev)
271273
{
@@ -287,16 +289,30 @@ static void imx6ul_opp_check_speed_grading(struct device *dev)
287289
* Speed GRADING[1:0] defines the max speed of ARM:
288290
* 2b'00: Reserved;
289291
* 2b'01: 528000000Hz;
290-
* 2b'10: 696000000Hz;
291-
* 2b'11: Reserved;
292+
* 2b'10: 696000000Hz on i.MX6UL, 792000000Hz on i.MX6ULL;
293+
* 2b'11: 900000000Hz on i.MX6ULL only;
292294
* We need to set the max speed of ARM according to fuse map.
293295
*/
294296
val = readl_relaxed(base + OCOTP_CFG3);
295297
val >>= OCOTP_CFG3_SPEED_SHIFT;
296298
val &= 0x3;
297-
if (val != OCOTP_CFG3_6UL_SPEED_696MHZ)
298-
if (dev_pm_opp_disable(dev, 696000000))
299-
dev_warn(dev, "failed to disable 696MHz OPP\n");
299+
300+
if (of_machine_is_compatible("fsl,imx6ul")) {
301+
if (val != OCOTP_CFG3_6UL_SPEED_696MHZ)
302+
if (dev_pm_opp_disable(dev, 696000000))
303+
dev_warn(dev, "failed to disable 696MHz OPP\n");
304+
}
305+
306+
if (of_machine_is_compatible("fsl,imx6ull")) {
307+
if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ)
308+
if (dev_pm_opp_disable(dev, 792000000))
309+
dev_warn(dev, "failed to disable 792MHz OPP\n");
310+
311+
if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
312+
if (dev_pm_opp_disable(dev, 900000000))
313+
dev_warn(dev, "failed to disable 900MHz OPP\n");
314+
}
315+
300316
iounmap(base);
301317
put_node:
302318
of_node_put(np);
@@ -356,7 +372,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
356372
goto put_reg;
357373
}
358374

359-
if (of_machine_is_compatible("fsl,imx6ul"))
375+
if (of_machine_is_compatible("fsl,imx6ul") ||
376+
of_machine_is_compatible("fsl,imx6ull"))
360377
imx6ul_opp_check_speed_grading(cpu_dev);
361378
else
362379
imx6q_opp_check_speed_grading(cpu_dev);

0 commit comments

Comments
 (0)