All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xing Zheng <zhengxing@rock-chips.com>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: mturquette@baylibre.com, sboyd@codeaurora.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, huangtao@rock-chips.com,
	jay.xu@rock-chips.com, elaine.zhang@rock-chips.com,
	dianders@chromium.org
Subject: Re: [PATCH v3 5/7] clk: rockchip: add new pll-type for rk3399 and similar socs
Date: Thu, 10 Mar 2016 11:25:34 +0800	[thread overview]
Message-ID: <56E0E92E.7000206@rock-chips.com> (raw)
In-Reply-To: <2688473.EyteJL2oqe@diego>

Hi Heiko,

On 2016年03月09日 20:29, Heiko Stübner wrote:
> Hi Xing,
>
> Am Mittwoch, 9. März 2016, 10:42:58 schrieb Xing Zheng:
>> The rk3399's pll and clock are similar with rk3036's, it different
>> with base on the rk3066(rk3188, rk3288, rk3368 use it), there are
>> different adjust foctors and control registers, so these should be
>> independent and separate from the series of rk3066s.
>>
>> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
>> ---
>>
>> Changes in v3: None
>> Changes in v2: None
>>
>>   drivers/clk/rockchip/clk-pll.c |  279
>> +++++++++++++++++++++++++++++++++++++++- drivers/clk/rockchip/clk.h     |
>>   3 +-
>>   2 files changed, 280 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
>> index 27be66a..62d2f0e 100644
>> --- a/drivers/clk/rockchip/clk-pll.c
>> +++ b/drivers/clk/rockchip/clk-pll.c
>> @@ -593,6 +593,275 @@ static const struct clk_ops
>> rockchip_rk3066_pll_clk_ops = { .init = rockchip_rk3066_pll_init,
>>   };
>>
>> +/**
>> + * PLL used in RK3399
>> + */
>> +
>> +#define RK3399_PLLCON(i)			(i * 0x4)
>> +#define RK3399_PLLCON0_FBDIV_MASK		0xfff
>> +#define RK3399_PLLCON0_FBDIV_SHIFT		0
>> +#define RK3399_PLLCON1_REFDIV_MASK		0x3f
>> +#define RK3399_PLLCON1_REFDIV_SHIFT		0
>> +#define RK3399_PLLCON1_POSTDIV1_MASK		0x7
>> +#define RK3399_PLLCON1_POSTDIV1_SHIFT		8
>> +#define RK3399_PLLCON1_POSTDIV2_MASK		0x7
>> +#define RK3399_PLLCON1_POSTDIV2_SHIFT		12
>> +#define RK3399_PLLCON2_FRAC_MASK		0xffffff
>> +#define RK3399_PLLCON2_FRAC_SHIFT		0
> please move RK3399_PLLCON2_LOCK_STATUS here
Done.
>> +#define RK3399_PLLCON3_DSMPD_MASK		0x1
>> +#define RK3399_PLLCON3_DSMPD_SHIFT		12
> DSMPD_SHIFT should be 3, right?
Yes, I'm sorry to careless.
>
>> +
>> +#define RK3399_PLLCON2_LOCK_STATUS		(31 << 0)
> that is wrong, you want (1 << 31), or even better BIT(31) here
Yes, done.
>
>> +#define RK3399_PLLCON3_PWRDOWN			(1 << 0)
> dito, BIT(0) please
Done.
>> +static int rockchip_rk3399_pll_set_rate(struct clk_hw *hw, unsigned long
>> drate, +					unsigned long prate)
>> +{
>> +	struct rockchip_clk_pll *pll = to_rockchip_clk_pll(hw);
>> +	const struct rockchip_pll_rate_table *rate;
>> +	unsigned long old_rate = rockchip_rk3399_pll_recalc_rate(hw, prate);
>> +	struct regmap *grf = rockchip_clk_get_grf(pll->ctx);
>> +
>> +	if (IS_ERR(grf)) {
>> +		pr_debug("%s: grf regmap not available, aborting rate change\n",
>> +			 __func__);
>> +		return PTR_ERR(grf);
>> +	}
> the pll lock-status moved to the pll registers it seems, so you don't need to
> get the GRF here at all, as we don't need it for the lock status.
Yes, done.

Thanks.

-- 
- Xing Zheng



WARNING: multiple messages have this Message-ID (diff)
From: zhengxing@rock-chips.com (Xing Zheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/7] clk: rockchip: add new pll-type for rk3399 and similar socs
Date: Thu, 10 Mar 2016 11:25:34 +0800	[thread overview]
Message-ID: <56E0E92E.7000206@rock-chips.com> (raw)
In-Reply-To: <2688473.EyteJL2oqe@diego>

Hi Heiko,

On 2016?03?09? 20:29, Heiko St?bner wrote:
> Hi Xing,
>
> Am Mittwoch, 9. M?rz 2016, 10:42:58 schrieb Xing Zheng:
>> The rk3399's pll and clock are similar with rk3036's, it different
>> with base on the rk3066(rk3188, rk3288, rk3368 use it), there are
>> different adjust foctors and control registers, so these should be
>> independent and separate from the series of rk3066s.
>>
>> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
>> ---
>>
>> Changes in v3: None
>> Changes in v2: None
>>
>>   drivers/clk/rockchip/clk-pll.c |  279
>> +++++++++++++++++++++++++++++++++++++++- drivers/clk/rockchip/clk.h     |
>>   3 +-
>>   2 files changed, 280 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
>> index 27be66a..62d2f0e 100644
>> --- a/drivers/clk/rockchip/clk-pll.c
>> +++ b/drivers/clk/rockchip/clk-pll.c
>> @@ -593,6 +593,275 @@ static const struct clk_ops
>> rockchip_rk3066_pll_clk_ops = { .init = rockchip_rk3066_pll_init,
>>   };
>>
>> +/**
>> + * PLL used in RK3399
>> + */
>> +
>> +#define RK3399_PLLCON(i)			(i * 0x4)
>> +#define RK3399_PLLCON0_FBDIV_MASK		0xfff
>> +#define RK3399_PLLCON0_FBDIV_SHIFT		0
>> +#define RK3399_PLLCON1_REFDIV_MASK		0x3f
>> +#define RK3399_PLLCON1_REFDIV_SHIFT		0
>> +#define RK3399_PLLCON1_POSTDIV1_MASK		0x7
>> +#define RK3399_PLLCON1_POSTDIV1_SHIFT		8
>> +#define RK3399_PLLCON1_POSTDIV2_MASK		0x7
>> +#define RK3399_PLLCON1_POSTDIV2_SHIFT		12
>> +#define RK3399_PLLCON2_FRAC_MASK		0xffffff
>> +#define RK3399_PLLCON2_FRAC_SHIFT		0
> please move RK3399_PLLCON2_LOCK_STATUS here
Done.
>> +#define RK3399_PLLCON3_DSMPD_MASK		0x1
>> +#define RK3399_PLLCON3_DSMPD_SHIFT		12
> DSMPD_SHIFT should be 3, right?
Yes, I'm sorry to careless.
>
>> +
>> +#define RK3399_PLLCON2_LOCK_STATUS		(31 << 0)
> that is wrong, you want (1 << 31), or even better BIT(31) here
Yes, done.
>
>> +#define RK3399_PLLCON3_PWRDOWN			(1 << 0)
> dito, BIT(0) please
Done.
>> +static int rockchip_rk3399_pll_set_rate(struct clk_hw *hw, unsigned long
>> drate, +					unsigned long prate)
>> +{
>> +	struct rockchip_clk_pll *pll = to_rockchip_clk_pll(hw);
>> +	const struct rockchip_pll_rate_table *rate;
>> +	unsigned long old_rate = rockchip_rk3399_pll_recalc_rate(hw, prate);
>> +	struct regmap *grf = rockchip_clk_get_grf(pll->ctx);
>> +
>> +	if (IS_ERR(grf)) {
>> +		pr_debug("%s: grf regmap not available, aborting rate change\n",
>> +			 __func__);
>> +		return PTR_ERR(grf);
>> +	}
> the pll lock-status moved to the pll registers it seems, so you don't need to
> get the GRF here at all, as we don't need it for the lock status.
Yes, done.

Thanks.

-- 
- Xing Zheng

  reply	other threads:[~2016-03-10  3:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  2:37 [PATCH v3 0/7] Add more clock compatible features and support the RK3399 clock Xing Zheng
2016-03-09  2:37 ` Xing Zheng
     [not found] ` <1457491027-30936-1-git-send-email-zhengxing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-03-09  2:37   ` [PATCH v3 1/7] dt-bindings: add bindings for rk3399 clock controller Xing Zheng
2016-03-09  2:37     ` Xing Zheng
2016-03-09  2:37     ` Xing Zheng
2016-03-09  2:37 ` [PATCH v3 2/7] clk: rockchip: add dt-binding header for rk3399 Xing Zheng
2016-03-09  2:37 ` [PATCH v3 3/7] clk: rockchip: add more mux parameters for new pll sources Xing Zheng
2016-03-09  2:37   ` Xing Zheng
2016-03-09 16:50   ` Heiko Stübner
2016-03-09 16:50     ` Heiko Stübner
2016-03-09 16:50     ` Heiko Stübner
2016-03-09  2:37 ` [PATCH v3 4/7] clk: rockchip: Add support for multiple clock providers Xing Zheng
2016-03-09  2:37   ` Xing Zheng
2016-03-09 22:25   ` Heiko Stübner
2016-03-09 22:25     ` Heiko Stübner
2016-03-09 22:25     ` Heiko Stübner
2016-03-10  2:29     ` Xing Zheng
2016-03-10  2:29       ` Xing Zheng
2016-03-09  2:42 ` [PATCH v3 5/7] clk: rockchip: add new pll-type for rk3399 and similar socs Xing Zheng
2016-03-09  2:42   ` Xing Zheng
2016-03-09 12:29   ` Heiko Stübner
2016-03-09 12:29     ` Heiko Stübner
2016-03-09 12:29     ` Heiko Stübner
2016-03-10  3:25     ` Xing Zheng [this message]
2016-03-10  3:25       ` Xing Zheng
2016-03-09  2:43 ` [PATCH v3 6/7] clk: rockchip: add a COMPOSITE_FRACMUX_NOGATE type Xing Zheng
2016-03-09  2:43   ` Xing Zheng
2016-03-09 12:35   ` Heiko Stübner
2016-03-09 12:35     ` Heiko Stübner
2016-03-09 12:35     ` Heiko Stübner
2016-03-09  2:44 ` [PATCH v3 7/7] clk: rockchip: add clock controller for the RK3399 Xing Zheng
2016-03-09  2:44   ` Xing Zheng

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=56E0E92E.7000206@rock-chips.com \
    --to=zhengxing@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=elaine.zhang@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=jay.xu@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.