public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] clk: rockchip: dmc: support rk3399 dmc clock driver
@ 2015-11-23  8:09 MyungJoo Ham
  2015-11-23  9:26 ` hl
  0 siblings, 1 reply; 7+ messages in thread
From: MyungJoo Ham @ 2015-11-23  8:09 UTC (permalink / raw)
  To: Lin Huang, heiko@sntech.de, dianders@chromium.org,
	mturquette@baylibre.com, 박경민
  Cc: linux-clk@vger.kernel.org, sboyd@codeaurora.org,
	dbasehore@chromium.org, linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1675 bytes --]

> +static unsigned long rk3399_dmcclk_recalc_rate(struct clk_hw *hw,
> +					       unsigned long parent_rate)
> +{
> +	struct rk3399_dmcclk *dmc = to_rk3399_dmcclk(&hw);
> +	u32 val;
> +
> +	/*
> +	 * Get parent rate since it changed in this clks set_rate op. The parent
> +	 * rate passed into this function is cached before set_rate is called in
> +	 * the common clk code, so we have to get it here.
> +	 */
> +	parent_rate = clk_get_rate(clk_get_parent(hw->clk));
> +
> +	val = readl(dmc->cru + CRU_CLKSEL6_CON);
> +	val = (val >> CLK_DDRC_DIV_CON_SHIFT) & CLK_DDRC_DIV_CON_MASK;
> +
> +	return parent_rate / (val + 1);
> +}
> +
> +/*
> + * TODO: set ddr frequcney in dcf which run in ATF
> + */
> +static int rk3399_dmcclk_set_rate(struct clk_hw *hw, unsigned long rate,
> +				  unsigned long parent_rate)
> +{
> +	return 0;
> +}

Is it correct that you didn't fill this up because your
Trustzone driver (SMC) is not ready yet?

Then, why don't you fill that function assuming that TrustZone is not activated
and add SMC call functions with if or #if after its TrustZone driver is ready?

Or does your SoC mandate the usage ot TrustZone, restricting the usage
of CRU_CLKSEL6_CON write? (I don't see why SoC vendors will do this..)


I'll be ready to merge the RK3399 devfreq driver if you
fill this up (assuming that TZ is not enabled) or
add TZ driver and SMC calls.


Cheers,
MyungJoo
ps. according to rk339_dmcclk_recalc_rate(), filling rk339_dmcclk_set_rate
assuming that TZ is not enabled seems trivial.ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/2] Bring up rk3399 ddr frequency scaling
@ 2015-11-19 10:21 Lin Huang
  2015-11-19 10:21 ` [PATCH 1/2] clk: rockchip: dmc: support rk3399 dmc clock driver Lin Huang
  0 siblings, 1 reply; 7+ messages in thread
From: Lin Huang @ 2015-11-19 10:21 UTC (permalink / raw)
  To: heiko, dianders, mturquette, myungjoo.ham, kyungmin.park
  Cc: linux-clk, sboyd, dbasehore, linux-rockchip, linux-kernel,
	Lin Huang

these patchset bring up rk3399 ddr frequency scaling flow,
use devfreq framework and simple_ondemand policy. Ddr set
rate function will implement in dcf controller which run in
the ATF, and rk3399 ATF not ready now, so we need finish it
when rk3399 ATF ready.

Lin Huang (2):
  clk: rockchip: dmc: support rk3399 dmc clock driver
  devfreq: rockchip: support rk3399 dmc devfreq

 drivers/clk/rockchip/Makefile         |   1 +
 drivers/clk/rockchip/clk-rk3399-dmc.c | 196 ++++++++++++++++++++
 drivers/devfreq/Kconfig               |   1 +
 drivers/devfreq/Makefile              |   1 +
 drivers/devfreq/rockchip/Kconfig      |   8 +
 drivers/devfreq/rockchip/Makefile     |   1 +
 drivers/devfreq/rockchip/rk3399_dmc.c | 327 ++++++++++++++++++++++++++++++++++
 include/soc/rockchip/rk3399-dmc-clk.h |  36 ++++
 8 files changed, 571 insertions(+)
 create mode 100644 drivers/clk/rockchip/clk-rk3399-dmc.c
 create mode 100644 drivers/devfreq/rockchip/Kconfig
 create mode 100644 drivers/devfreq/rockchip/Makefile
 create mode 100644 drivers/devfreq/rockchip/rk3399_dmc.c
 create mode 100644 include/soc/rockchip/rk3399-dmc-clk.h

-- 
1.9.1


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

end of thread, other threads:[~2015-11-23  9:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23  8:09 [PATCH 1/2] clk: rockchip: dmc: support rk3399 dmc clock driver MyungJoo Ham
2015-11-23  9:26 ` hl
  -- strict thread matches above, loose matches on Subject: below --
2015-11-19 10:21 [PATCH 0/2] Bring up rk3399 ddr frequency scaling Lin Huang
2015-11-19 10:21 ` [PATCH 1/2] clk: rockchip: dmc: support rk3399 dmc clock driver Lin Huang
2015-11-19 21:47   ` Heiko Stuebner
2015-11-20  1:37     ` hl
2015-11-21 18:30       ` Heiko Stuebner
2015-11-23  9:20         ` hl

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