All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sunxi: spl: Fix H616 clock initialization
@ 2021-01-31 20:25 Jernej Skrabec
  2021-02-01  0:46 ` Andre Przywara
  0 siblings, 1 reply; 3+ messages in thread
From: Jernej Skrabec @ 2021-01-31 20:25 UTC (permalink / raw)
  To: u-boot

It turns out that there is a magic bit in PRCM region which seemingly
makes PLLs work if it's enabled. Sadly, there is no documentation what
it does exactly, so we'll just mimick BSP boot0 behaviour and enable it
before any clock is set up.

Fixes: b18bd53d6cde ("sunxi: introduce support for H616 clocks")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm/mach-sunxi/clock_sun50i_h6.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-sunxi/clock_sun50i_h6.c b/arch/arm/mach-sunxi/clock_sun50i_h6.c
index 06d84eb158d7..68c8e7f2afbe 100644
--- a/arch/arm/mach-sunxi/clock_sun50i_h6.c
+++ b/arch/arm/mach-sunxi/clock_sun50i_h6.c
@@ -9,6 +9,12 @@ void clock_init_safe(void)
 {
 	struct sunxi_ccm_reg *const ccm =
 		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+#ifdef CONFIG_MACH_SUN50I_H616
+	/* this seems to enable PLLs */
+	setbits_le32(SUNXI_PRCM_BASE + 0x250, 0x10);
+#endif
+
 	clock_set_pll1(408000000);
 
 	writel(CCM_PLL6_DEFAULT, &ccm->pll6_cfg);
-- 
2.30.0

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

end of thread, other threads:[~2021-02-01  5:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31 20:25 [PATCH] sunxi: spl: Fix H616 clock initialization Jernej Skrabec
2021-02-01  0:46 ` Andre Przywara
2021-02-01  5:46   ` Jernej Škrabec

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.