From patchwork Tue Dec 11 09:14:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 205141 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0CAE12C0084 for ; Tue, 11 Dec 2012 20:18:45 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TiLvc-0002gx-Q4; Tue, 11 Dec 2012 09:15:04 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TiLvX-0002g3-1V for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2012 09:15:00 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1TiLvR-0001ha-NM; Tue, 11 Dec 2012 10:14:53 +0100 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1TiLvR-0000Wx-Kw; Tue, 11 Dec 2012 10:14:53 +0100 Date: Tue, 11 Dec 2012 10:14:53 +0100 From: Sascha Hauer To: Shawn Guo Subject: Re: [PATCH 3/7] ARM i.MX5: switch IPU clk support to devicetree bindings Message-ID: <20121211091453.GO10369@pengutronix.de> References: <1352733809-27230-1-git-send-email-s.hauer@pengutronix.de> <1352733809-27230-4-git-send-email-s.hauer@pengutronix.de> <20121211055657.GA28581@S2101-09.ap.freescale.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121211055657.GA28581@S2101-09.ap.freescale.net> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:53:43 up 170 days, 23:05, 51 users, load average: 3.89, 7.59, 5.59 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121211_041459_429890_7EC58AC9 X-CRM114-Status: GOOD ( 33.58 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hi Shawn, On Tue, Dec 11, 2012 at 01:57:00PM +0800, Shawn Guo wrote: > Hi Sascha, > > On Mon, Nov 12, 2012 at 04:23:25PM +0100, Sascha Hauer wrote: > > The i.MX5 clk support has platform based clock bindings for the > > IPU. IPU support is devicetree only, so move them over to devicetree > > based bindings. Also, enable MIPI clocks which do not have a device > > associated with, but still need to be enabled to do graphics on > > i.MX51. > > > > Signed-off-by: Sascha Hauer > > --- > > arch/arm/mach-imx/clk-imx51-imx53.c | 19 +++++++++++-------- > > 1 file changed, 11 insertions(+), 8 deletions(-) > > > > diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c > > index a0bf848..02932da 100644 > > --- a/arch/arm/mach-imx/clk-imx51-imx53.c > > +++ b/arch/arm/mach-imx/clk-imx51-imx53.c > > @@ -306,6 +306,10 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, > > clk_prepare_enable(clk[spba]); > > clk_prepare_enable(clk[emi_fast_gate]); /* fec */ > > clk_prepare_enable(clk[emi_slow_gate]); /* eim */ > > + clk_prepare_enable(clk[mipi_hsc1_gate]); > > + clk_prepare_enable(clk[mipi_hsc2_gate]); > > + clk_prepare_enable(clk[mipi_esc_gate]); > > + clk_prepare_enable(clk[mipi_hsp_gate]); > > I just noticed that enabling these clocks will stop my imx51-babbage > board from booting to console. Can you please investigate it? I just tested it, this seems to be a bit complicated. I can confirm that with IPU disabled the last message I see from the kernel is: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready When the IPU is enabled everything is fine. In my testing the IPU was enabled, in the end that was the motivation of the whole series. It seems to be that the system does not work when the MIPI/HSP clocks are enabled and the IPU clock is disabled. I found some reserved bits in the reference manual. Could you try the following and see if it fixes your problem? >From 7d6eca0b10c1a1e2f13c229f6c6c8d6541926dd5 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 11 Dec 2012 10:08:50 +0100 Subject: [PATCH] ARM i.MX51 clock: Fix regression since enabling MIPI/HSP clocks The MIPI/HSP clocks were recently turned on in the i.MX51 clock tree. It turned out that the system does not work properly when the MIPI/HSP clocks are enabled, but the IPU clock is disabled. This happens when IPU support is disabled. In this case the IPU clock gets disabled when the clock framework turns off unused clock in a late_initcall. This is broken since: | commit 9a2d4825a9368e018003a2732a61be063d178f67 | Author: Sascha Hauer | Date: Tue Jun 5 13:53:32 2012 +0200 | | ARM i.MX5: switch IPU clk support to devicetree bindings | | The i.MX5 clk support has platform based clock bindings for the | IPU. IPU support is devicetree only, so move them over to devicetree | based bindings. Also, enable MIPI clocks which do not have a device | associated with, but still need to be enabled to do graphics on | i.MX51. This patch fixes this by setting some reserved bits in the CCM as recommended in the reference manual. Signed-off-by: Sascha Hauer Tested-by: Shawn Guo --- arch/arm/mach-imx/clk-imx51-imx53.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index e8c0473..579023f 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c @@ -319,6 +319,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, unsigned long rate_ckih1, unsigned long rate_ckih2) { int i; + u32 val; struct device_node *np; clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE); @@ -390,6 +391,21 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, imx_print_silicon_rev("i.MX51", mx51_revision()); clk_disable_unprepare(clk[iim_gate]); + /* + * Reference Manual says: Functionality of CCDR[18] and CLPCR[23] is no + * longer supported. Set to one for better power saving. + * + * The effect of not setting these bits is that MIPI clocks can't be + * enabled without the IPU clock being enabled aswell. + */ + val = readl(MXC_CCM_CCDR); + val |= 1 << 18; + writel(val, MXC_CCM_CCDR); + + val = readl(MXC_CCM_CLPCR); + val |= 1 << 23; + writel(val, MXC_CCM_CLPCR); + return 0; }