linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 33/33] ARM: i.MX6: implement clocks using common clock framework
Date: Thu, 26 Apr 2012 08:41:50 +0200	[thread overview]
Message-ID: <20120426064150.GE3852@pengutronix.de> (raw)
In-Reply-To: <20120426024837.GD28063@b20223-02.ap.freescale.net>

On Thu, Apr 26, 2012 at 10:48:38AM +0800, Richard Zhao wrote:
> The below code is removed from mx6q_clocks_init implicitly.
> Why? If it's reasonable, it needs to be on a separate patch too.
> 
> /* only keep necessary clocks on */
> writel_relaxed(0x3 << CG0  | 0x3 << CG1  | 0x3 << CG2,  CCGR0);
> writel_relaxed(0x3 << CG8  | 0x3 << CG9  | 0x3 << CG10, CCGR2);
> writel_relaxed(0x3 << CG10 | 0x3 << CG12,               CCGR3);
> writel_relaxed(0x3 << CG4  | 0x3 << CG6  | 0x3 << CG7,  CCGR4);
> writel_relaxed(0x3 << CG0,                              CCGR5);
> writel_relaxed(0,                                       CCGR6);
> writel_relaxed(0,                                       CCGR7);

The clock framework will turn them off automatically.
For the first time the hardware state will be consistent with the
software state. Hurray!

> 
> clk_enable(&uart_clk);

This is not needed anymore. For the early debug case we depend on the
uart being enabled by the bootloader anyway, so it's safe to assume that
the clock is turned on also. Otherwise the uart driver turns on this
clock when needed.

> clk_enable(&mmdc_ch0_axi_clk);

This reminds me on something. This clock is turned on in the loop around
clks_init_on. Since we now have pointers to each clock we don't need the
clk_get_sys() anymore but can use the pointers directly. Will fix this
one.

> 
> clk_set_rate(&pll4_audio, FREQ_650M);
> clk_set_rate(&pll5_video, FREQ_650M);
> clk_set_parent(&ipu1_di0_clk, &ipu1_di0_pre_clk);
> clk_set_parent(&ipu1_di0_pre_clk, &pll5_video);
> clk_set_parent(&gpu3d_shader_clk, &pll2_pfd_594m);
> clk_set_rate(&gpu3d_shader_clk, FREQ_594M);
> clk_set_parent(&gpu3d_core_clk, &mmdc_ch0_axi_clk);
> clk_set_rate(&gpu3d_core_clk, FREQ_528M);
> clk_set_parent(&asrc_serial_clk, &pll3_usb_otg);
> clk_set_rate(&asrc_serial_clk, 1500000);
> clk_set_rate(&enfc_clk, 11000000);
> 
> /*
>  * Before pinctrl API is available, we have to rely on the pad
>  * configuration set up by bootloader.  For usdhc example here,
>  * u-boot sets up the pads for 49.5 MHz case, and we have to lower
>  * the usdhc clock from 198 to 49.5 MHz to match the pad configuration.
>  *
>  * FIXME: This is should be removed after pinctrl API is available.
>  * At that time, usdhc driver can call pinctrl API to change pad
>  * configuration dynamically per different usdhc clock settings.
>  */
> clk_set_rate(&usdhc1_clk, 49500000);
> clk_set_rate(&usdhc2_clk, 49500000);
> clk_set_rate(&usdhc3_clk, 49500000);
> clk_set_rate(&usdhc4_clk, 49500000);

Can't say anything to these, probably Shawn has simply lost them while
porting.

> 
> clk_set_parent(&cko1_clk, &ahb_clk);

Why this? The cko pin has different usecases on each board, mostly I
think for debugging. We shouldn't touch it here.

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 |

  reply	other threads:[~2012-04-26  6:41 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 15:27 [PATCH v2] Convert i.MX architecture to generic clock framework Sascha Hauer
2012-04-25 15:27 ` [PATCH 01/33] dmaengine i.MX SDMA: do not depend on grouped clocks Sascha Hauer
2012-04-25 15:27 ` [PATCH 02/33] spi i.MX: " Sascha Hauer
2012-04-25 15:27 ` [PATCH 03/33] video imxfb: " Sascha Hauer
2012-04-25 15:27 ` [PATCH 04/33] net fec: " Sascha Hauer
2012-04-25 15:27 ` [PATCH 05/33] mmc mxcmmc: " Sascha Hauer
2012-04-25 15:27 ` [PATCH 06/33] mmc sdhc i.MX: " Sascha Hauer
2012-04-25 15:27 ` [PATCH 07/33] serial " Sascha Hauer
2012-04-25 15:27 ` [PATCH 08/33] mtd mxc_nand: prepare/unprepare clock Sascha Hauer
2012-04-25 15:27 ` [PATCH 09/33] USB ehci mxc: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 10/33] USB ehci mxc: sanitize clock handling Sascha Hauer
2012-04-25 15:28 ` [PATCH 11/33] w1 i.MX: prepare/unprepare clock Sascha Hauer
2012-04-25 15:28 ` [PATCH 12/33] watchdog imx2: prepare clk before enabling it Sascha Hauer
2012-04-25 15:28 ` [PATCH 13/33] media mx3 camera: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 14/33] dmaengine i.MX ipu: clk_prepare/unprepare clock Sascha Hauer
2012-04-25 15:28 ` [PATCH 15/33] rtc: imx dryice: Add missing clk_prepare Sascha Hauer
2012-04-25 15:28 ` [PATCH 16/33] ARM i.MX5: prepare gpc_dvfs_clk Sascha Hauer
2012-04-25 15:28 ` [PATCH 17/33] ARM i.MX timer: request correct clock Sascha Hauer
2012-04-25 15:28 ` [PATCH 18/33] ARM i.MX3: Make ccm base address a variable Sascha Hauer
2012-04-25 15:28 ` [PATCH 19/33] ARM i.MX: prepare for common clock framework Sascha Hauer
2012-04-27  6:40   ` Shawn Guo
2012-04-27  7:16     ` Sascha Hauer
2012-04-27  7:55       ` Shawn Guo
2012-04-27  8:09         ` Sascha Hauer
2012-04-25 15:28 ` [PATCH 20/33] ARM i.MX: Add common clock support for pllv1 Sascha Hauer
2012-04-25 15:28 ` [PATCH 21/33] ARM i.MX: Add common clock support for pllv2 Sascha Hauer
2012-04-25 15:28 ` [PATCH 22/33] ARM: imx: add common clock support for pllv3 Sascha Hauer
2012-04-27  6:21   ` Shawn Guo
2012-04-27  6:32     ` Sascha Hauer
2012-04-27  6:45       ` Shawn Guo
2012-04-25 15:28 ` [PATCH 23/33] ARM i.MX: Add common clock support for 2bit gate Sascha Hauer
2012-04-25 15:28 ` [PATCH 24/33] ARM: imx: add common clock support for pfd Sascha Hauer
2012-04-25 15:28 ` [PATCH 25/33] ARM: imx: add common clock support for clk busy Sascha Hauer
2012-04-25 15:28 ` [PATCH 26/33] ARM i.MX25: implement clocks using common clock framework Sascha Hauer
2012-04-25 15:28 ` [PATCH 27/33] ARM i.MX1: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 28/33] ARM i.MX21: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 29/33] ARM i.MX27: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 30/33] ARM i.MX31: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 31/33] ARM i.MX5: " Sascha Hauer
2012-04-26 12:48   ` Heiko Stübner
2012-04-26 13:02     ` Sascha Hauer
2012-04-26 14:21       ` Heiko Stübner
2012-05-03  3:21   ` Shawn Guo
2012-05-03  6:35     ` Sascha Hauer
2012-04-25 15:28 ` [PATCH 32/33] ARM i.MX35: " Sascha Hauer
2012-04-25 15:28 ` [PATCH 33/33] ARM: i.MX6: " Sascha Hauer
2012-04-26  2:48   ` Richard Zhao
2012-04-26  6:41     ` Sascha Hauer [this message]
2012-04-26  6:57       ` Richard Zhao
2012-04-26  7:14         ` Sascha Hauer
2012-04-26  8:04           ` Sascha Hauer
2012-04-26  9:27             ` Richard Zhao
2012-04-26  7:58         ` Shawn Guo
2012-04-26  9:30           ` Richard Zhao
2012-04-26  7:42       ` Shawn Guo
2012-04-26  9:37         ` Richard Zhao
2012-04-26 14:06 ` [PATCH v2] Convert i.MX architecture to generic " Dirk Behme
2012-04-26 14:25   ` Sascha Hauer
2012-04-27  2:28   ` Shawn Guo
2012-04-27  6:32     ` Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120426064150.GE3852@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).