Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: imx-cpufreq-dt: Correct i.MX8MN's default speed grade value

i.MX8MN has different speed grade definition compared to
i.MX8MQ/i.MX8MM, when fuses are NOT written, the default
speed_grade should be set to minimum available OPP defined
in DT which is 1.2GHz, the corresponding speed_grade value
should be 0xb.

Fixes: 5b8010ba70d5 ("cpufreq: imx-cpufreq-dt: Add i.MX8MN support")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

Anson Huang and committed by
Viresh Kumar
af44d180 e318d2c8

+10 -10
+10 -10
drivers/cpufreq/imx-cpufreq-dt.c
··· 44 44 mkt_segment = (cell_value & OCOTP_CFG3_MKT_SEGMENT_MASK) >> OCOTP_CFG3_MKT_SEGMENT_SHIFT; 45 45 46 46 /* 47 - * Early samples without fuses written report "0 0" which means 48 - * consumer segment and minimum speed grading. 49 - * 50 - * According to datasheet minimum speed grading is not supported for 51 - * consumer parts so clamp to 1 to avoid warning for "no OPPs" 47 + * Early samples without fuses written report "0 0" which may NOT 48 + * match any OPP defined in DT. So clamp to minimum OPP defined in 49 + * DT to avoid warning for "no OPPs". 52 50 * 53 51 * Applies to i.MX8M series SoCs. 54 52 */ 55 - if (mkt_segment == 0 && speed_grade == 0 && ( 56 - of_machine_is_compatible("fsl,imx8mm") || 57 - of_machine_is_compatible("fsl,imx8mn") || 58 - of_machine_is_compatible("fsl,imx8mq"))) 59 - speed_grade = 1; 53 + if (mkt_segment == 0 && speed_grade == 0) { 54 + if (of_machine_is_compatible("fsl,imx8mm") || 55 + of_machine_is_compatible("fsl,imx8mq")) 56 + speed_grade = 1; 57 + if (of_machine_is_compatible("fsl,imx8mn")) 58 + speed_grade = 0xb; 59 + } 60 60 61 61 supported_hw[0] = BIT(speed_grade); 62 62 supported_hw[1] = BIT(mkt_segment);