mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX6: Enable parent propagation for clk_gate2
@ 2016-09-13 14:08 Sascha Hauer
  2016-09-14 11:11 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2016-09-13 14:08 UTC (permalink / raw)
  To: Barebox List

Enable parent rate propagation for clk_gate2 to allow the
clock consumers to adjust their rates.
One effect of this is that the i.MX6 NAND controller now can adjust
its rate. It already called a clk_set_rate(rate, 96000000), but this
had no effect, so the clock stayed at reset default 24MHz resulting
in a rather slow timing. This became a problem when commit
"1daa3bc mtd: nand_mxs: Setup timing" introduced EDO timing mode for
faster NAND chips. EDO mode can only work properly for cycle times
< 30ns (at least that's specified in the ONFI spec). 1daa3bc resulted
in sporadic NAND read errors on some boards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/clk-gate2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c
index 344c2fb..faed631 100644
--- a/arch/arm/mach-imx/clk-gate2.c
+++ b/arch/arm/mach-imx/clk-gate2.c
@@ -79,6 +79,8 @@ static int clk_gate2_is_enabled(struct clk *clk)
 }
 
 static struct clk_ops clk_gate2_ops = {
+	.set_rate = clk_parent_set_rate,
+	.round_rate = clk_parent_round_rate,
 	.enable = clk_gate2_enable,
 	.disable = clk_gate2_disable,
 	.is_enabled = clk_gate2_is_enabled,
@@ -96,6 +98,7 @@ struct clk *clk_gate2_alloc(const char *name, const char *parent,
 	g->clk.name = name;
 	g->clk.parent_names = &g->parent;
 	g->clk.num_parents = 1;
+	g->clk.flags = CLK_SET_RATE_PARENT;
 
 	return &g->clk;
 }
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] ARM: i.MX6: Enable parent propagation for clk_gate2
  2016-09-13 14:08 [PATCH] ARM: i.MX6: Enable parent propagation for clk_gate2 Sascha Hauer
@ 2016-09-14 11:11 ` Sam Ravnborg
  2016-09-14 12:46   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2016-09-14 11:11 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hi Sascha.

On Tue, Sep 13, 2016 at 04:08:09PM +0200, Sascha Hauer wrote:
> Enable parent rate propagation for clk_gate2 to allow the
> clock consumers to adjust their rates.
> One effect of this is that the i.MX6 NAND controller now can adjust
> its rate. It already called a clk_set_rate(rate, 96000000), but this
> had no effect, so the clock stayed at reset default 24MHz resulting
> in a rather slow timing. This became a problem when commit
> "1daa3bc mtd: nand_mxs: Setup timing" introduced EDO timing mode for
> faster NAND chips. EDO mode can only work properly for cycle times
> < 30ns (at least that's specified in the ONFI spec). 1daa3bc resulted
> in sporadic NAND read errors on some boards.

Nice work!

We have tested this patch on ~10 boards that failed
with DMA errors before.
None of these boards failed after applying this patch.

> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] ARM: i.MX6: Enable parent propagation for clk_gate2
  2016-09-14 11:11 ` Sam Ravnborg
@ 2016-09-14 12:46   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2016-09-14 12:46 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Barebox List

On Wed, Sep 14, 2016 at 01:11:14PM +0200, Sam Ravnborg wrote:
> Hi Sascha.
> 
> On Tue, Sep 13, 2016 at 04:08:09PM +0200, Sascha Hauer wrote:
> > Enable parent rate propagation for clk_gate2 to allow the
> > clock consumers to adjust their rates.
> > One effect of this is that the i.MX6 NAND controller now can adjust
> > its rate. It already called a clk_set_rate(rate, 96000000), but this
> > had no effect, so the clock stayed at reset default 24MHz resulting
> > in a rather slow timing. This became a problem when commit
> > "1daa3bc mtd: nand_mxs: Setup timing" introduced EDO timing mode for
> > faster NAND chips. EDO mode can only work properly for cycle times
> > < 30ns (at least that's specified in the ONFI spec). 1daa3bc resulted
> > in sporadic NAND read errors on some boards.
> 
> Nice work!
> 
> We have tested this patch on ~10 boards that failed
> with DMA errors before.
> None of these boards failed after applying this patch.

Great :)

Have you noticed the NAND is much faster now?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2016-09-14 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 14:08 [PATCH] ARM: i.MX6: Enable parent propagation for clk_gate2 Sascha Hauer
2016-09-14 11:11 ` Sam Ravnborg
2016-09-14 12:46   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox