@@ -266,6 +266,8 @@ static void imx6q_opp_check_speed_grading(struct device *dev)
266
266
}
267
267
268
268
#define OCOTP_CFG3_6UL_SPEED_696MHZ 0x2
269
+ #define OCOTP_CFG3_6ULL_SPEED_792MHZ 0x2
270
+ #define OCOTP_CFG3_6ULL_SPEED_900MHZ 0x3
269
271
270
272
static void imx6ul_opp_check_speed_grading (struct device * dev )
271
273
{
@@ -287,16 +289,30 @@ static void imx6ul_opp_check_speed_grading(struct device *dev)
287
289
* Speed GRADING[1:0] defines the max speed of ARM:
288
290
* 2b'00: Reserved;
289
291
* 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 ;
292
294
* We need to set the max speed of ARM according to fuse map.
293
295
*/
294
296
val = readl_relaxed (base + OCOTP_CFG3 );
295
297
val >>= OCOTP_CFG3_SPEED_SHIFT ;
296
298
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
+
300
316
iounmap (base );
301
317
put_node :
302
318
of_node_put (np );
@@ -356,7 +372,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
356
372
goto put_reg ;
357
373
}
358
374
359
- if (of_machine_is_compatible ("fsl,imx6ul" ))
375
+ if (of_machine_is_compatible ("fsl,imx6ul" ) ||
376
+ of_machine_is_compatible ("fsl,imx6ull" ))
360
377
imx6ul_opp_check_speed_grading (cpu_dev );
361
378
else
362
379
imx6q_opp_check_speed_grading (cpu_dev );
0 commit comments