diff mbox series

[5/6] clk: imx8mn: Add necessary frequency support for ARM PLL table

Message ID 1565866783-19672-5-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State Superseded, archived
Headers show
Series [1/6] arm64: dts: imx8mn-ddr4-evk: Add i2c1 support | expand

Commit Message

Anson Huang Aug. 15, 2019, 10:59 a.m. UTC
From: Anson Huang <Anson.Huang@nxp.com>

i.MX8MN supports CPU running at 1.5GHz/1.4GHz/1.2GHz, add missing
frequency for ARM PLL table.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/clk/imx/clk-imx8mn.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stephen Boyd Aug. 17, 2019, 3:52 a.m. UTC | #1
Quoting Anson.Huang@nxp.com (2019-08-15 03:59:42)
> diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
> index ecd1062..3f1239a 100644
> --- a/drivers/clk/imx/clk-imx8mn.c
> +++ b/drivers/clk/imx/clk-imx8mn.c
> @@ -82,6 +84,7 @@ static struct imx_pll14xx_clk imx8mn_dram_pll = {
>  static struct imx_pll14xx_clk imx8mn_arm_pll = {
>                 .type = PLL_1416X,
>                 .rate_table = imx8mn_pll1416x_tbl,
> +               .rate_count = ARRAY_SIZE(imx8mn_pll1416x_tbl),

Why is rate_count added? That's not described in the commit text.
Anson Huang Aug. 17, 2019, 10:22 p.m. UTC | #2
Hi, Stephen

> Quoting Anson.Huang@nxp.com (2019-08-15 03:59:42)
> > diff --git a/drivers/clk/imx/clk-imx8mn.c
> > b/drivers/clk/imx/clk-imx8mn.c index ecd1062..3f1239a 100644
> > --- a/drivers/clk/imx/clk-imx8mn.c
> > +++ b/drivers/clk/imx/clk-imx8mn.c
> > @@ -82,6 +84,7 @@ static struct imx_pll14xx_clk imx8mn_dram_pll = {
> > static struct imx_pll14xx_clk imx8mn_arm_pll = {
> >                 .type = PLL_1416X,
> >                 .rate_table = imx8mn_pll1416x_tbl,
> > +               .rate_count = ARRAY_SIZE(imx8mn_pll1416x_tbl),
> 
> Why is rate_count added? That's not described in the commit text.

rate_count is necessary for table search during set_rate, it was missed previously,
I will add it into commit text in V2.

Thanks,
Anson.
Stephen Boyd Aug. 18, 2019, 1:11 a.m. UTC | #3
Quoting Anson Huang (2019-08-17 15:22:01)
> Hi, Stephen
> 
> > Quoting Anson.Huang@nxp.com (2019-08-15 03:59:42)
> > > diff --git a/drivers/clk/imx/clk-imx8mn.c
> > > b/drivers/clk/imx/clk-imx8mn.c index ecd1062..3f1239a 100644
> > > --- a/drivers/clk/imx/clk-imx8mn.c
> > > +++ b/drivers/clk/imx/clk-imx8mn.c
> > > @@ -82,6 +84,7 @@ static struct imx_pll14xx_clk imx8mn_dram_pll = {
> > > static struct imx_pll14xx_clk imx8mn_arm_pll = {
> > >                 .type = PLL_1416X,
> > >                 .rate_table = imx8mn_pll1416x_tbl,
> > > +               .rate_count = ARRAY_SIZE(imx8mn_pll1416x_tbl),
> > 
> > Why is rate_count added? That's not described in the commit text.
> 
> rate_count is necessary for table search during set_rate, it was missed previously,
> I will add it into commit text in V2.
> 

Right, isn't that a more critical fix to make by itself instead of
rolling into this change that adds a few more frequencies?
Anson Huang Aug. 18, 2019, 6:19 a.m. UTC | #4
Hi, Stephen

> Quoting Anson Huang (2019-08-17 15:22:01)
> > Hi, Stephen
> >
> > > Quoting Anson.Huang@nxp.com (2019-08-15 03:59:42)
> > > > diff --git a/drivers/clk/imx/clk-imx8mn.c
> > > > b/drivers/clk/imx/clk-imx8mn.c index ecd1062..3f1239a 100644
> > > > --- a/drivers/clk/imx/clk-imx8mn.c
> > > > +++ b/drivers/clk/imx/clk-imx8mn.c
> > > > @@ -82,6 +84,7 @@ static struct imx_pll14xx_clk imx8mn_dram_pll =
> > > > { static struct imx_pll14xx_clk imx8mn_arm_pll = {
> > > >                 .type = PLL_1416X,
> > > >                 .rate_table = imx8mn_pll1416x_tbl,
> > > > +               .rate_count = ARRAY_SIZE(imx8mn_pll1416x_tbl),
> > >
> > > Why is rate_count added? That's not described in the commit text.
> >
> > rate_count is necessary for table search during set_rate, it was
> > missed previously, I will add it into commit text in V2.
> >
> 
> Right, isn't that a more critical fix to make by itself instead of rolling into this
> change that adds a few more frequencies?

Right, let me split this patch into two patches and resend the V2.

Thanks,
Anson.
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
index ecd1062..3f1239a 100644
--- a/drivers/clk/imx/clk-imx8mn.c
+++ b/drivers/clk/imx/clk-imx8mn.c
@@ -42,6 +42,8 @@  enum {
 static const struct imx_pll14xx_rate_table imx8mn_pll1416x_tbl[] = {
 	PLL_1416X_RATE(1800000000U, 225, 3, 0),
 	PLL_1416X_RATE(1600000000U, 200, 3, 0),
+	PLL_1416X_RATE(1500000000U, 375, 3, 1),
+	PLL_1416X_RATE(1400000000U, 350, 3, 1),
 	PLL_1416X_RATE(1200000000U, 300, 3, 1),
 	PLL_1416X_RATE(1000000000U, 250, 3, 1),
 	PLL_1416X_RATE(800000000U,  200, 3, 1),
@@ -82,6 +84,7 @@  static struct imx_pll14xx_clk imx8mn_dram_pll = {
 static struct imx_pll14xx_clk imx8mn_arm_pll = {
 		.type = PLL_1416X,
 		.rate_table = imx8mn_pll1416x_tbl,
+		.rate_count = ARRAY_SIZE(imx8mn_pll1416x_tbl),
 };
 
 static struct imx_pll14xx_clk imx8mn_gpu_pll = {