* [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
@ 2018-10-18 7:07 Icenowy Zheng
2018-10-18 16:58 ` Maxime Ripard
2018-10-18 17:19 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Icenowy Zheng @ 2018-10-18 7:07 UTC (permalink / raw)
To: Maxime Ripard, Chen-Yu Tsai
Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi, Icenowy Zheng
In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
register is called "LDO{1,2}_EN", and according to the BSP source code
from Allwinner , the LDOs are enabled during the clock's enabling
process.
The clock failed to generate output if the two LDOs are not enabled.
Add the two bits to the clock's gate bits, so that the LDOs are enabled
when the PLL is enabled.
Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v2:
- Add a section of comments before the addition.
drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
index 5f80eb018014..884d8f7863c4 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
@@ -162,7 +162,12 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu",
#define SUN50I_A64_PLL_MIPI_REG 0x040
static struct ccu_nkm pll_mipi_clk = {
- .enable = BIT(31),
+ /*
+ * The bit 23 and 22 are called "LDO{1,2}_EN" on the SoC's
+ * user manual, and by experiments the PLL doesn't work without
+ * these bits toggled.
+ */
+ .enable = BIT(31) | BIT(23) | BIT(22),
.lock = BIT(28),
.n = _SUNXI_CCU_MULT(8, 4),
.k = _SUNXI_CCU_MULT_MIN(4, 2, 2),
--
2.18.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
2018-10-18 7:07 [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
@ 2018-10-18 16:58 ` Maxime Ripard
2018-10-18 17:19 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-10-18 16:58 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Chen-Yu Tsai, linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi
On Thu, Oct 18, 2018 at 03:07:29PM +0800, Icenowy Zheng wrote:
> In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
> register is called "LDO{1,2}_EN", and according to the BSP source code
> from Allwinner , the LDOs are enabled during the clock's enabling
> process.
>
> The clock failed to generate output if the two LDOs are not enabled.
>
> Add the two bits to the clock's gate bits, so that the LDOs are enabled
> when the PLL is enabled.
>
> Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Queued for 4.21, thanks!
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
2018-10-18 7:07 [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
2018-10-18 16:58 ` Maxime Ripard
@ 2018-10-18 17:19 ` Stephen Boyd
2018-10-19 5:50 ` Icenowy Zheng
1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2018-10-18 17:19 UTC (permalink / raw)
To: Chen-Yu Tsai, Icenowy Zheng, Maxime Ripard
Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi, Icenowy Zheng
Quoting Icenowy Zheng (2018-10-18 00:07:29)
> In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
> register is called "LDO{1,2}_EN", and according to the BSP source code
> from Allwinner , the LDOs are enabled during the clock's enabling
> process.
>
> The clock failed to generate output if the two LDOs are not enabled.
>
> Add the two bits to the clock's gate bits, so that the LDOs are enabled
> when the PLL is enabled.
>
> Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
Looks OK to me from not knowing anything about this driver. Shall I pick
directly into clk-next for next release?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
2018-10-18 17:19 ` Stephen Boyd
@ 2018-10-19 5:50 ` Icenowy Zheng
0 siblings, 0 replies; 4+ messages in thread
From: Icenowy Zheng @ 2018-10-19 5:50 UTC (permalink / raw)
To: linux-arm-kernel, Stephen Boyd, Chen-Yu Tsai, Maxime Ripard
Cc: linux-sunxi, linux-clk, linux-kernel
于 2018年10月19日 GMT+08:00 上午1:19:54, Stephen Boyd <sboyd@kernel.org> 写到:
>Quoting Icenowy Zheng (2018-10-18 00:07:29)
>> In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
>> register is called "LDO{1,2}_EN", and according to the BSP source
>code
>> from Allwinner , the LDOs are enabled during the clock's enabling
>> process.
>>
>> The clock failed to generate output if the two LDOs are not enabled.
>>
>> Add the two bits to the clock's gate bits, so that the LDOs are
>enabled
>> when the PLL is enabled.
>>
>> Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> ---
>
>Looks OK to me from not knowing anything about this driver. Shall I
>pick
>directly into clk-next for next release?
I prefer to wait for an ACK from Maxime.
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-19 10:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 7:07 [PATCH v2] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
2018-10-18 16:58 ` Maxime Ripard
2018-10-18 17:19 ` Stephen Boyd
2018-10-19 5:50 ` Icenowy Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).