linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: meson8b: fix clk81 register address
@ 2017-01-25 10:53 Jerome Brunet
  2017-01-26 14:27 ` Jerome Brunet
  2017-01-26 23:57 ` Stephen Boyd
  0 siblings, 2 replies; 4+ messages in thread
From: Jerome Brunet @ 2017-01-25 10:53 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Kevin Hilman, Carlo Caione
  Cc: Jerome Brunet, linux-clk, linux-amlogic, linux-arm-kernel, linux-kernel

During meson8b clock probe, clk81 register address is fixed twice.
First using the meson8b_clk_gates array, then by directly changing
meson8b_clk81 register.

As a result meson8b_clk81.reg = HHI_MPEG_CLK_CNTL + clk_base + clk_base.

Fixed by just removing the second fixup.

Fixes: e31a1900c1ff ("meson: clk: Add support for clock gates")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 Patch based on khilman/linux-amlogic.git master branch.

 I don't have a meson8b HW so this patch so this patch has not been
 tested on real HW.

 drivers/clk/meson/meson8b.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c
index 3f1be46cbb33..888494d4fb8a 100644
--- a/drivers/clk/meson/meson8b.c
+++ b/drivers/clk/meson/meson8b.c
@@ -607,7 +607,6 @@ static int meson8b_clkc_probe(struct platform_device *pdev)
 	/* Populate the base address for the MPEG clks */
 	meson8b_mpeg_clk_sel.reg = clk_base + (u32)meson8b_mpeg_clk_sel.reg;
 	meson8b_mpeg_clk_div.reg = clk_base + (u32)meson8b_mpeg_clk_div.reg;
-	meson8b_clk81.reg = clk_base + (u32)meson8b_clk81.reg;
 
 	/* Populate base address for gates */
 	for (i = 0; i < ARRAY_SIZE(meson8b_clk_gates); i++)
-- 
2.7.4

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

* Re: [PATCH] clk: meson8b: fix clk81 register address
  2017-01-25 10:53 [PATCH] clk: meson8b: fix clk81 register address Jerome Brunet
@ 2017-01-26 14:27 ` Jerome Brunet
  2017-01-26 23:57 ` Stephen Boyd
  1 sibling, 0 replies; 4+ messages in thread
From: Jerome Brunet @ 2017-01-26 14:27 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Kevin Hilman, Carlo Caione
  Cc: linux-clk, linux-amlogic, linux-arm-kernel, linux-kernel

On Wed, 2017-01-25 at 11:53 +0100, Jerome Brunet wrote:
> During meson8b clock probe, clk81 register address is fixed twice.
> First using the meson8b_clk_gates array, then by directly changing
> meson8b_clk81 register.
> 
> As a result meson8b_clk81.reg = HHI_MPEG_CLK_CNTL + clk_base +
> clk_base.
> 
> Fixed by just removing the second fixup.
> 
> Fixes: e31a1900c1ff ("meson: clk: Add support for clock gates")
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  Patch based on khilman/linux-amlogic.git master branch.
> 
>  I don't have a meson8b HW so this patch so this patch has not been
>  tested on real HW.

I got my hands on an odroidc1 and I have been to test this.
With clk_base @ 0xf0965000:

* without the patch:
clk81.reg = 0xe12ca174

* with the patch:
clk81.reg = 0xf0965174 (expected result)

In the past, we probably did not see this because clk81 is the mother
of all the other clock gate around the SoC so it is very likely that u-
boot opened this gate for us.

> 
>  drivers/clk/meson/meson8b.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/clk/meson/meson8b.c
> b/drivers/clk/meson/meson8b.c
> index 3f1be46cbb33..888494d4fb8a 100644
> --- a/drivers/clk/meson/meson8b.c
> +++ b/drivers/clk/meson/meson8b.c
> @@ -607,7 +607,6 @@ static int meson8b_clkc_probe(struct
> platform_device *pdev)
>  	/* Populate the base address for the MPEG clks */
>  	meson8b_mpeg_clk_sel.reg = clk_base +
> (u32)meson8b_mpeg_clk_sel.reg;
>  	meson8b_mpeg_clk_div.reg = clk_base +
> (u32)meson8b_mpeg_clk_div.reg;
> -	meson8b_clk81.reg = clk_base + (u32)meson8b_clk81.reg;
>  
>  	/* Populate base address for gates */
>  	for (i = 0; i < ARRAY_SIZE(meson8b_clk_gates); i++)

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

* Re: [PATCH] clk: meson8b: fix clk81 register address
  2017-01-25 10:53 [PATCH] clk: meson8b: fix clk81 register address Jerome Brunet
  2017-01-26 14:27 ` Jerome Brunet
@ 2017-01-26 23:57 ` Stephen Boyd
  2017-01-27  8:43   ` Jerome Brunet
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2017-01-26 23:57 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Michael Turquette, Kevin Hilman, Carlo Caione, linux-clk,
	linux-amlogic, linux-arm-kernel, linux-kernel

On 01/25, Jerome Brunet wrote:
> During meson8b clock probe, clk81 register address is fixed twice.
> First using the meson8b_clk_gates array, then by directly changing
> meson8b_clk81 register.
> 
> As a result meson8b_clk81.reg = HHI_MPEG_CLK_CNTL + clk_base + clk_base.
> 
> Fixed by just removing the second fixup.
> 
> Fixes: e31a1900c1ff ("meson: clk: Add support for clock gates")
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  Patch based on khilman/linux-amlogic.git master branch.

The problem isn't introduced there though?

> 
>  I don't have a meson8b HW so this patch so this patch has not been
>  tested on real HW.

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] 4+ messages in thread

* Re: [PATCH] clk: meson8b: fix clk81 register address
  2017-01-26 23:57 ` Stephen Boyd
@ 2017-01-27  8:43   ` Jerome Brunet
  0 siblings, 0 replies; 4+ messages in thread
From: Jerome Brunet @ 2017-01-27  8:43 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, Kevin Hilman, Carlo Caione, linux-clk,
	linux-amlogic, linux-arm-kernel, linux-kernel

On Thu, 2017-01-26 at 15:57 -0800, Stephen Boyd wrote:
> On 01/25, Jerome Brunet wrote:
> > 
> > During meson8b clock probe, clk81 register address is fixed twice.
> > First using the meson8b_clk_gates array, then by directly changing
> > meson8b_clk81 register.
> > 
> > As a result meson8b_clk81.reg = HHI_MPEG_CLK_CNTL + clk_base +
> > clk_base.
> > 
> > Fixed by just removing the second fixup.
> > 
> > Fixes: e31a1900c1ff ("meson: clk: Add support for clock gates")
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  Patch based on khilman/linux-amlogic.git master branch.
> 
> The problem isn't introduced there though?
Indeed, I should have based my patch on clk-next. Will do next time.

> 
> > 
> > 
> >  I don't have a meson8b HW so this patch so this patch has not been
> >  tested on real HW.
> 
> Applied to clk-next.
> 

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

end of thread, other threads:[~2017-01-27  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 10:53 [PATCH] clk: meson8b: fix clk81 register address Jerome Brunet
2017-01-26 14:27 ` Jerome Brunet
2017-01-26 23:57 ` Stephen Boyd
2017-01-27  8:43   ` Jerome Brunet

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).