From: Stephen Boyd <sboyd@codeaurora.org>
To: Jacky Bai <ping.bai@nxp.com>
Cc: "shawnguo@kernel.org" <shawnguo@kernel.org>,
"mturquette@baylibre.com" <mturquette@baylibre.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
Fabio Estevam <fabio.estevam@nxp.com>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"jacky.baip@gmail.com" <jacky.baip@gmai>
Subject: Re: [PATCH v2 04/12] driver: clk: imx: Add clock driver for imx6sll
Date: Fri, 20 Jan 2017 17:00:09 -0800 [thread overview]
Message-ID: <20170121010009.GC8801@codeaurora.org> (raw)
In-Reply-To: <AM3PR04MB53027B627AE8CEC6D7D0D1B87780@AM3PR04MB530.eurprd04.prod.outlook.com>
On 01/13, Jacky Bai wrote:
> > >
> > > The reason why we enable these two clks here is in below commit commit
> > > a5120e89e7e187a91852896f586876c7a2030804
> > > Author: Peter Chen <peter.chen@freescale.com>
> > > Date: Fri Jan 18 10:38:05 2013 +0800
> > > ARM i.MX6: change mxs usbphy clock usage
> > >
> >
> > So can we mark these clks with CLK_IS_CRITICAL flag then instead?
> > Or are they disabled out of the bootloader?
> >
>
> Sure, using 'CLK_IS_CRITICAL' should be ok for clks_init_on clocks. But for USBPHY*_GATE, it is
> only enabled when CONIG_USB_MXC_PHY is true. And another concern is if we need to add CLK_IS_CRITICAL
> flag to clks_init_on clocks, we may need to add new wrapper function to register these critical clock. It is not very good.
Ok so set the critical flag when CONFIG_USB_MXC_PHY is enabled?
That isn't too hard to do.
>
> > >
> > > > > + }
> > > > > +
> > > > > + /* Lower the AHB clock rate before changing the clock source. */
> > > > > + clk_set_rate(clks[IMX6SLL_CLK_AHB], 99000000);
> > > > > +
> > > > > + /* Change periph_pre clock to pll2_bus to adjust AXI rate to 264MHz */
> > > > > + clk_set_parent(clks[IMX6SLL_CLK_PERIPH_CLK2_SEL],
> > > > clks[IMX6SLL_CLK_PLL3_USB_OTG]);
> > > > > + clk_set_parent(clks[IMX6SLL_CLK_PERIPH],
> > > > clks[IMX6SLL_CLK_PERIPH_CLK2]);
> > > > > + clk_set_parent(clks[IMX6SLL_CLK_PERIPH_PRE],
> > > > clks[IMX6SLL_CLK_PLL2_BUS]);
> > > > > + clk_set_parent(clks[IMX6SLL_CLK_PERIPH],
> > > > > +clks[IMX6SLL_CLK_PERIPH_PRE]);
> > > > > +
> > > > > + clk_set_rate(clks[IMX6SLL_CLK_AHB], 132000000);
> > > >
> > > > assigned-clocks for rates now? Or perhaps we shouldn't be exposing
> > > > these as clks if they have some sort of complicated rate sequence
> > > > switch that we can't guarantee with the clk_ops we have today.
> > >
> > > These clks will be used by some peripherals, so we need to expose these
> > clocks.
> > > And the above parent and rate swith sequence is not very easy to be
> > > handled in assigned-clocks, So we leave it in this place.
> > >
> >
> > How do we guarantee that the rate switch doesn't happen later on, requiring
> > this coordinated sequence of clk operations?
> >
>
> This clock sequence is used for increasing the AXI and AHB bus clock rate. In normal
> use, it is very rarely that we need to change them again. If we really need to change
> AXI and AHB bus clock later, a similar sequence must be used to do this.
>
Ok. It feels unsafe, so please make sure no child clocks have the
CLK_SET_RATE_PARENT flag set so we can't randomly change the rate
of this clk outside of this init code.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-01-21 1:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-27 9:47 [PATCH v2 00/12] Add basic code support for imx6sll Bai Ping
2016-12-27 9:47 ` [PATCH v2 01/12] ARM: imx: Add basic msl " Bai Ping
2016-12-27 9:47 ` [PATCH v2 02/12] driver: clocksource: add gpt timer " Bai Ping
2017-01-09 10:30 ` Daniel Lezcano
2016-12-27 9:47 ` [PATCH v2 03/12] Document: dt: binding: imx: update clock doc " Bai Ping
2017-01-03 17:48 ` Rob Herring
2016-12-27 9:47 ` [PATCH v2 04/12] driver: clk: imx: Add clock driver " Bai Ping
[not found] ` <1482832070-22668-5-git-send-email-ping.bai-3arQi8VN3Tc@public.gmane.org>
2017-01-03 17:49 ` Rob Herring
2017-01-10 0:37 ` Stephen Boyd
[not found] ` <20170110003753.GM17126-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-01-10 3:18 ` Jacky Bai
2017-01-12 22:05 ` Stephen Boyd
2017-01-13 3:04 ` Jacky Bai
2017-01-21 1:00 ` Stephen Boyd [this message]
2017-01-22 2:14 ` Jacky Bai
2016-12-27 9:47 ` [PATCH v2 05/12] Document: dt: binding: imx: update pinctrl doc " Bai Ping
2016-12-27 12:59 ` Linus Walleij
2017-01-09 2:32 ` Jacky Bai
[not found] ` <AM3PR04MB5304992095753B761E66A9A87640-f56W/S9L6NRDGcFijYBXZgfhPeD8jYilXA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2017-01-11 14:33 ` Linus Walleij
2017-01-12 2:57 ` Jacky Bai
2017-01-13 15:22 ` Linus Walleij
2017-01-17 6:35 ` Jacky Bai
2017-01-18 12:24 ` Linus Walleij
2017-01-23 6:04 ` Shawn Guo
2017-01-23 7:17 ` Jacky Bai
2017-01-26 14:05 ` Linus Walleij
2017-02-16 7:51 ` Dong Aisheng
2017-02-24 9:02 ` Dong Aisheng
2017-03-14 13:54 ` Linus Walleij
2017-03-15 14:05 ` Dong Aisheng
2016-12-27 9:47 ` [PATCH v2 06/12] driver: pinctrl: imx: Add pinctrl driver support " Bai Ping
2016-12-27 13:01 ` Linus Walleij
2017-01-03 1:00 ` Jacky Bai
2016-12-27 9:47 ` [PATCH v2 07/12] ARM: dts: imx: Add basic dtsi " Bai Ping
2016-12-27 9:47 ` [PATCH v2 08/12] ARM: dts: imx: Add imx6sll EVK board dts support Bai Ping
2016-12-27 9:47 ` [PATCH v2 09/12] ARM: debug: Add low level debug support for imx6sll Bai Ping
2016-12-27 9:47 ` [PATCH v2 10/12] ARM: imx: Add suspend/resume " Bai Ping
2016-12-27 9:47 ` [PATCH v2 11/12] ARM: imx: correct i.mx6sll dram io low power mode Bai Ping
2016-12-27 9:47 ` [PATCH v2 12/12] ARM: configs: enable imx6sll support in defconfig Bai Ping
2017-01-23 6:10 ` [PATCH v2 00/12] Add basic code support for imx6sll Shawn Guo
2017-01-23 7:18 ` Jacky Bai
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=20170121010009.GC8801@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=jacky.baip@gmai \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=ping.bai@nxp.com \
--cc=robh+dt@kernel.org \
--cc=shawnguo@kernel.org \
--cc=tglx@linutronix.de \
/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).