diff options
author | Leonard Crestez <leonard.crestez@nxp.com> | 2019-05-29 11:52:08 +0000 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2019-06-03 11:04:13 +0530 |
commit | c2147585cce028e46a0ea8b24be3a11716ee6e4f (patch) | |
tree | 203b55fb4a507051d3773372093a5ac774b91054 /drivers/cpufreq | |
parent | a02177a39344b643dccfa3b18fa5c1fc4984e1e5 (diff) | |
download | linux-c2147585cce028e46a0ea8b24be3a11716ee6e4f.tar.bz2 |
cpufreq: imx-cpufreq-dt: Fix no OPPs available on unfused parts
Early samples without fuses written report "0 0" which means consumer
segment and minimum speed grading. According to datasheet the minimum speed
grade is not supported for consumer parts so all OPPs are disabled
which results in stack dumps later on.
Fix by clamping minimum consumer speed grade to 1 on imx8mm and imx8mq.
Fixes: 4d28ba1d62c4 ("cpufreq: Add imx-cpufreq-dt driver")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
[ Viresh: s/minumum/minimum/ in patch and log ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/imx-cpufreq-dt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index e1aa346efa10..35b6717d7255 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -50,6 +50,21 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) speed_grade = (cell_value & OCOTP_CFG3_SPEED_GRADE_MASK) >> OCOTP_CFG3_SPEED_GRADE_SHIFT; mkt_segment = (cell_value & OCOTP_CFG3_MKT_SEGMENT_MASK) >> OCOTP_CFG3_MKT_SEGMENT_SHIFT; + + /* + * Early samples without fuses written report "0 0" which means + * consumer segment and minimum speed grading. + * + * According to datasheet minimum speed grading is not supported for + * consumer parts so clamp to 1 to avoid warning for "no OPPs" + * + * Applies to 8mq and 8mm. + */ + if (mkt_segment == 0 && speed_grade == 0 && ( + !strcmp(match->compatible, "fsl,imx8mm") || + !strcmp(match->compatible, "fsl,imx8mq"))) + speed_grade = 1; + supported_hw[0] = BIT(speed_grade); supported_hw[1] = BIT(mkt_segment); dev_info(&pdev->dev, "cpu speed grade %d mkt segment %d supported-hw %#x %#x\n", |