All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR
@ 2017-05-15 11:55 Fabio Estevam
  2017-05-23 15:34 ` Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabio Estevam @ 2017-05-15 11:55 UTC (permalink / raw)
  To: sboyd; +Cc: shawnguo, kernel, linux-clk, stefan, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

According to the MX7D Reference Manual the powerdown bit of
CCM_ANALOG_PLL_DDRn register is bit 20, so fix it accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
---
Changes since v1:
- Rename to IMX7_DDR_PLL_POWER to make it consistent with the other
special case for the powerdown bit (IMX7_ENET_PLL_POWER) - Stefan

 drivers/clk/imx/clk-imx7d.c | 2 +-
 drivers/clk/imx/clk-pllv3.c | 5 +++++
 drivers/clk/imx/clk.h       | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
index 93b0364..8fa1841 100644
--- a/drivers/clk/imx/clk-imx7d.c
+++ b/drivers/clk/imx/clk-imx7d.c
@@ -424,7 +424,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clks[IMX7D_PLL_VIDEO_MAIN_SRC] = imx_clk_mux("pll_video_main_src", base + 0x130, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
 
 	clks[IMX7D_PLL_ARM_MAIN]  = imx_clk_pllv3(IMX_PLLV3_SYS, "pll_arm_main", "osc", base + 0x60, 0x7f);
-	clks[IMX7D_PLL_DRAM_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_dram_main", "osc", base + 0x70, 0x7f);
+	clks[IMX7D_PLL_DRAM_MAIN] = imx_clk_pllv3(IMX_PLLV3_DDR_IMX7, "pll_dram_main", "osc", base + 0x70, 0x7f);
 	clks[IMX7D_PLL_SYS_MAIN]  = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll_sys_main", "osc", base + 0xb0, 0x1);
 	clks[IMX7D_PLL_ENET_MAIN] = imx_clk_pllv3(IMX_PLLV3_ENET_IMX7, "pll_enet_main", "osc", base + 0xe0, 0x0);
 	clks[IMX7D_PLL_AUDIO_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_audio_main", "osc", base + 0xf0, 0x7f);
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index f109916..0039b16 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -27,6 +27,7 @@
 #define BM_PLL_POWER		(0x1 << 12)
 #define BM_PLL_LOCK		(0x1 << 31)
 #define IMX7_ENET_PLL_POWER	(0x1 << 5)
+#define IMX7_DDR_PLL_POWER	(0x1 << 20)
 
 /**
  * struct clk_pllv3 - IMX PLL clock version 3
@@ -451,6 +452,10 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
 		pll->ref_clock = 500000000;
 		ops = &clk_pllv3_enet_ops;
 		break;
+	case IMX_PLLV3_DDR_IMX7:
+		pll->power_bit = IMX7_ENET_PLL_POWER;
+		ops = &clk_pllv3_av_ops;
+		break;
 	default:
 		ops = &clk_pllv3_ops;
 	}
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index e1f5e42..d54f072 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -35,6 +35,7 @@ enum imx_pllv3_type {
 	IMX_PLLV3_ENET,
 	IMX_PLLV3_ENET_IMX7,
 	IMX_PLLV3_SYS_VF610,
+	IMX_PLLV3_DDR_IMX7,
 };
 
 struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR
  2017-05-15 11:55 [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR Fabio Estevam
@ 2017-05-23 15:34 ` Fabio Estevam
  2017-06-01  7:25 ` Stephen Boyd
  2017-06-06 15:32 ` Leonard Crestez
  2 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2017-05-23 15:34 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Shawn Guo, Sascha Hauer, linux-clk, Stefan Agner, Fabio Estevam

Hi Stephen,

On Mon, May 15, 2017 at 8:55 AM, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> According to the MX7D Reference Manual the powerdown bit of
> CCM_ANALOG_PLL_DDRn register is bit 20, so fix it accordingly.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> Reviewed-by: Stefan Agner <stefan@agner.ch>

A gentle ping.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR
  2017-05-15 11:55 [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR Fabio Estevam
  2017-05-23 15:34 ` Fabio Estevam
@ 2017-06-01  7:25 ` Stephen Boyd
  2017-06-06 15:32 ` Leonard Crestez
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2017-06-01  7:25 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: shawnguo, kernel, linux-clk, stefan, Fabio Estevam

On 05/15, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> According to the MX7D Reference Manual the powerdown bit of
> CCM_ANALOG_PLL_DDRn register is bit 20, so fix it accordingly.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> Reviewed-by: Stefan Agner <stefan@agner.ch>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR
  2017-05-15 11:55 [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR Fabio Estevam
  2017-05-23 15:34 ` Fabio Estevam
  2017-06-01  7:25 ` Stephen Boyd
@ 2017-06-06 15:32 ` Leonard Crestez
  2017-06-06 15:46   ` Fabio Estevam
  2 siblings, 1 reply; 5+ messages in thread
From: Leonard Crestez @ 2017-06-06 15:32 UTC (permalink / raw)
  To: Fabio Estevam, sboyd; +Cc: shawnguo, kernel, linux-clk, stefan, Fabio Estevam

On Mon, 2017-05-15 at 08:55 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> According to the MX7D Reference Manual the powerdown bit of
> CCM_ANALOG_PLL_DDRn register is bit 20, so fix it accordingly.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> Reviewed-by: Stefan Agner <stefan@agner.ch>
> ---
> Changes since v1:
> - Rename to IMX7_DDR_PLL_POWER to make it consistent with the other
> special case for the powerdown bit (IMX7_ENET_PLL_POWER) - Stefan
> 
>  drivers/clk/imx/clk-imx7d.c | 2 +-
>  drivers/clk/imx/clk-pllv3.c | 5 +++++
>  drivers/clk/imx/clk.h       | 1 +
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
> index 93b0364..8fa1841 100644
> --- a/drivers/clk/imx/clk-imx7d.c
> +++ b/drivers/clk/imx/clk-imx7d.c
> @@ -424,7 +424,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
>  	clks[IMX7D_PLL_VIDEO_MAIN_SRC] = imx_clk_mux("pll_video_main_src", base + 0x130, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
>  
>  	clks[IMX7D_PLL_ARM_MAIN]  = imx_clk_pllv3(IMX_PLLV3_SYS, "pll_arm_main", "osc", base + 0x60, 0x7f);
> -	clks[IMX7D_PLL_DRAM_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_dram_main", "osc", base + 0x70, 0x7f);
> +	clks[IMX7D_PLL_DRAM_MAIN] = imx_clk_pllv3(IMX_PLLV3_DDR_IMX7, "pll_dram_main", "osc", base + 0x70, 0x7f);
>  	clks[IMX7D_PLL_SYS_MAIN]  = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll_sys_main", "osc", base + 0xb0, 0x1);
>  	clks[IMX7D_PLL_ENET_MAIN] = imx_clk_pllv3(IMX_PLLV3_ENET_IMX7, "pll_enet_main", "osc", base + 0xe0, 0x0);
>  	clks[IMX7D_PLL_AUDIO_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_audio_main", "osc", base + 0xf0, 0x7f);
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index f109916..0039b16 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -27,6 +27,7 @@
>  #define BM_PLL_POWER		(0x1 << 12)
>  #define BM_PLL_LOCK		(0x1 << 31)
>  #define IMX7_ENET_PLL_POWER	(0x1 << 5)
> +#define IMX7_DDR_PLL_POWER	(0x1 << 20)
>  
>  /**
>   * struct clk_pllv3 - IMX PLL clock version 3
> @@ -451,6 +452,10 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
>  		pll->ref_clock = 500000000;
>  		ops = &clk_pllv3_enet_ops;
>  		break;
> +	case IMX_PLLV3_DDR_IMX7:
> +		pll->power_bit = IMX7_ENET_PLL_POWER;
> +		ops = &clk_pllv3_av_ops;
> +		break;

Maybe you mean IMX7_DDR_PLL_POWER here?

This patch made it way into next-20170606 and broke boot on imx7d-sdb.
There is no console output but bisection points to this patch.

Changing power_bit to IMX7_DDR_PLL_POWER seems to make it work.

--
Regards,
Leonard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR
  2017-06-06 15:32 ` Leonard Crestez
@ 2017-06-06 15:46   ` Fabio Estevam
  0 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2017-06-06 15:46 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Stephen Boyd, Shawn Guo, Sascha Hauer, linux-clk, Stefan Agner,
	Fabio Estevam

Hi Leonard,

On Tue, Jun 6, 2017 at 12:32 PM, Leonard Crestez
<leonard.crestez@nxp.com> wrote:

> Maybe you mean IMX7_DDR_PLL_POWER here?
>
> This patch made it way into next-20170606 and broke boot on imx7d-sdb.
> There is no console output but bisection points to this patch.
>
> Changing power_bit to IMX7_DDR_PLL_POWER seems to make it work.

Ops, sorry about that! Just sent a fix. Thanks for reporting.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-06 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 11:55 [PATCH v2] clk: imx7d: Fix the powerdown bit location of PLL DDR Fabio Estevam
2017-05-23 15:34 ` Fabio Estevam
2017-06-01  7:25 ` Stephen Boyd
2017-06-06 15:32 ` Leonard Crestez
2017-06-06 15:46   ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.