All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: ti: omap5: Fix reboot DPLL lock failure when using ABE TIMERs
@ 2020-12-06 11:18 H. Nikolaus Schaller
  2020-12-07 13:31 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: H. Nikolaus Schaller @ 2020-12-06 11:18 UTC (permalink / raw)
  To: Tero Kristo, Michael Turquette, Stephen Boyd
  Cc: linux-omap, linux-clk, linux-kernel, letux-kernel, kernel,
	David Shah, tony, H . Nikolaus Schaller

From: David Shah <dave@ds0.me>

Having the ABE DPLL ref and bypass muxes set to different inputs was
causing the DPLL not to lock when TIMER8 was used, as it is in the Pyra
for the backlight.

This patch fixes this by setting abe_dpll_bypass_clk_mux to sys_32k_ck
in omap5xxx_dt_clk_init.

A similar patch may also be needed for OMAP44xx which has similar code
in omap4xxx_dt_clk_init, but I have not added this as I have no hardware
to test on.

Signed-off-by: David Shah <dave@ds0.me>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/clk/ti/clk-54xx.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/ti/clk-54xx.c b/drivers/clk/ti/clk-54xx.c
index 8694bc9f5fc7f..f0542391ca4bd 100644
--- a/drivers/clk/ti/clk-54xx.c
+++ b/drivers/clk/ti/clk-54xx.c
@@ -605,7 +605,7 @@ static struct ti_dt_clk omap54xx_clks[] = {
 int __init omap5xxx_dt_clk_init(void)
 {
 	int rc;
-	struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll;
+	struct clk *abe_dpll_ref, *abe_dpll, *abe_dpll_byp, *sys_32k_ck, *usb_dpll;
 
 	ti_dt_clocks_register(omap54xx_clks);
 
@@ -616,6 +616,16 @@ int __init omap5xxx_dt_clk_init(void)
 	abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_clk_mux");
 	sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck");
 	rc = clk_set_parent(abe_dpll_ref, sys_32k_ck);
+
+	/*
+	 * This must also be set to sys_32k_ck to match or
+	 * the ABE DPLL will not lock on a warm reboot when
+	 * ABE timers are used.
+	 */
+	abe_dpll_byp = clk_get_sys(NULL, "abe_dpll_bypass_clk_mux");
+	if (!rc)
+		rc = clk_set_parent(abe_dpll_byp, sys_32k_ck);
+
 	abe_dpll = clk_get_sys(NULL, "dpll_abe_ck");
 	if (!rc)
 		rc = clk_set_rate(abe_dpll, OMAP5_DPLL_ABE_DEFFREQ);
-- 
2.26.2


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

* Re: [PATCH] clk: ti: omap5: Fix reboot DPLL lock failure when using ABE TIMERs
  2020-12-06 11:18 [PATCH] clk: ti: omap5: Fix reboot DPLL lock failure when using ABE TIMERs H. Nikolaus Schaller
@ 2020-12-07 13:31 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2020-12-07 13:31 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Tero Kristo, Michael Turquette, Stephen Boyd, linux-omap,
	linux-clk, linux-kernel, letux-kernel, kernel, David Shah

* H. Nikolaus Schaller <hns@goldelico.com> [201206 11:19]:
> From: David Shah <dave@ds0.me>
> 
> Having the ABE DPLL ref and bypass muxes set to different inputs was
> causing the DPLL not to lock when TIMER8 was used, as it is in the Pyra
> for the backlight.
> 
> This patch fixes this by setting abe_dpll_bypass_clk_mux to sys_32k_ck
> in omap5xxx_dt_clk_init.
> 
> A similar patch may also be needed for OMAP44xx which has similar code
> in omap4xxx_dt_clk_init, but I have not added this as I have no hardware
> to test on.

Acked-by: Tony Lindgren <tony@atomide.com>

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

end of thread, other threads:[~2020-12-07 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 11:18 [PATCH] clk: ti: omap5: Fix reboot DPLL lock failure when using ABE TIMERs H. Nikolaus Schaller
2020-12-07 13:31 ` Tony Lindgren

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.