2019-12-26 06:56:57

by Anson Huang

[permalink] [raw]
Subject: [PATCH 1/2] cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading

Add i.MX8MP to blacklist, so that imx-cpufreq-dt driver can handle
speed grading bits just like other i.MX8M SoCs.

Signed-off-by: Anson Huang <[email protected]>
---
drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index f1d170d..a2e5f3a 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = {
{ .compatible = "fsl,imx8mq", },
{ .compatible = "fsl,imx8mm", },
{ .compatible = "fsl,imx8mn", },
+ { .compatible = "fsl,imx8mp", },

{ .compatible = "marvell,armadaxp", },

--
2.7.4


2019-12-26 06:57:17

by Anson Huang

[permalink] [raw]
Subject: [PATCH 2/2] cpufreq: imx-cpufreq-dt: Add i.MX8MP support

Add i.MX8MP cpufreq DT support for speed grading and market
segment check.

Signed-off-by: Anson Huang <[email protected]>
---
drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
index 85a6efd..912e93d 100644
--- a/drivers/cpufreq/imx-cpufreq-dt.c
+++ b/drivers/cpufreq/imx-cpufreq-dt.c
@@ -35,7 +35,7 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
if (ret)
return ret;

- if (of_machine_is_compatible("fsl,imx8mn"))
+ if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))
speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
>> OCOTP_CFG3_SPEED_GRADE_SHIFT;
else
@@ -54,7 +54,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
if (of_machine_is_compatible("fsl,imx8mm") ||
of_machine_is_compatible("fsl,imx8mq"))
speed_grade = 1;
- if (of_machine_is_compatible("fsl,imx8mn"))
+ if (of_machine_is_compatible("fsl,imx8mn") ||
+ of_machine_is_compatible("fsl,imx8mp"))
speed_grade = 0xb;
}

--
2.7.4

2019-12-26 14:06:45

by Abel Vesa

[permalink] [raw]
Subject: Re: [PATCH 2/2] cpufreq: imx-cpufreq-dt: Add i.MX8MP support

On 19-12-26 14:52:47, Anson Huang wrote:
> Add i.MX8MP cpufreq DT support for speed grading and market
> segment check.
>
> Signed-off-by: Anson Huang <[email protected]>
> ---
> drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
> index 85a6efd..912e93d 100644
> --- a/drivers/cpufreq/imx-cpufreq-dt.c
> +++ b/drivers/cpufreq/imx-cpufreq-dt.c
> @@ -35,7 +35,7 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - if (of_machine_is_compatible("fsl,imx8mn"))
> + if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))

Is there a way we could do this more generic so we won't have to add
another of_machine_is_compatible if a new imx8m comes around ?

If not, please drop the second one on a new line to follow the 80 chars rule.

Then you can add:
Reviewed-by: Abel Vesa <[email protected]>

> speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
> >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
> else
> @@ -54,7 +54,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
> if (of_machine_is_compatible("fsl,imx8mm") ||
> of_machine_is_compatible("fsl,imx8mq"))
> speed_grade = 1;
> - if (of_machine_is_compatible("fsl,imx8mn"))
> + if (of_machine_is_compatible("fsl,imx8mn") ||
> + of_machine_is_compatible("fsl,imx8mp"))
> speed_grade = 0xb;
> }
>
> --
> 2.7.4
>

2020-01-06 06:45:30

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 1/2] cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading

On 26-12-19, 14:52, Anson Huang wrote:
> Add i.MX8MP to blacklist, so that imx-cpufreq-dt driver can handle
> speed grading bits just like other i.MX8M SoCs.
>
> Signed-off-by: Anson Huang <[email protected]>
> ---
> drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
> index f1d170d..a2e5f3a 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = {
> { .compatible = "fsl,imx8mq", },
> { .compatible = "fsl,imx8mm", },
> { .compatible = "fsl,imx8mn", },
> + { .compatible = "fsl,imx8mp", },
>
> { .compatible = "marvell,armadaxp", },

Applied both (after minor formatting fixes). Thanks.

--
viresh