All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bintian <bintian.wang@huawei.com>
To: Stephen Boyd <sboyd@codeaurora.org>, <mturquette@linaro.org>,
	<zhangfei.gao@linaro.org>, <xuwei5@hisilicon.com>,
	<xuejiancheng@huawei.com>, <tomeu.vizoso@collabora.com>,
	<sledge.yanwei@huawei.com>, <linux-clk@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <arnd@arndb.de>,
	<will.deacon@arm.com>, <robh+dt@kernel.org>, <khilman@linaro.org>,
	<mark.rutland@arm.com>, <catalin.marinas@arm.com>,
	<haojian.zhuang@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>, <olof@lixom.net>,
	<yanhaifeng@gmail.com>, <linux@arm.linux.org.uk>,
	<guodong.xu@linaro.org>, <jorge.ramirez-ortiz@linaro.org>,
	<tyler.baker@linaro.org>, <khilman@kernel.org>
Cc: <xuyiping@hisilicon.com>, <wangbinghui@hisilicon.com>,
	<zhenwei.wang@hisilicon.com>, <victor.lixin@hisilicon.com>,
	<puck.chen@hisilicon.com>, <dan.zhao@hisilicon.com>,
	<huxinwei@huawei.com>, <z.liuxinliang@huawei.com>,
	<heyunlei@huawei.com>, <kong.kongxinwei@hisilicon.com>,
	<wangbintian@gmail.com>, <w.f@huawei.com>,
	<liguozhu@hisilicon.com>
Subject: Re: [PATCH v7 6/7] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Date: Thu, 21 May 2015 11:57:47 +0800	[thread overview]
Message-ID: <555D57BB.8080702@huawei.com> (raw)
In-Reply-To: <555D09F3.7020506@codeaurora.org>

Hello Stephen, Arnd,

On 2015/5/21 6:25, Stephen Boyd wrote:
> On 05/20/15 03:29, Bintian Wang wrote:
>> Add clock drivers for hi6220 SoC, this driver controls the SoC
>> registers to supply different clocks to different IPs in the SoC.
>>
>> We add one divider clock for hi6220 because the divider in hi6220
>> also has a mask bit but it doesnot obey the rule defined by flag
>> "CLK_DIVIDER_HIWORD_MASK", we can not get index of the mask bit by
>> left shift fixed bits (e.g. 16 bits), so we add this divider clock
>> to handle it.
>>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> Signed-off-by: Bintian Wang <bintian.wang@huawei.com>
>> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
>> Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>> Tested-by: Will Deacon <will.deacon@arm.com>
>> Tested-by: Tyler Baker <tyler.baker@linaro.org>
>> ---
>>   drivers/clk/Kconfig                       |    2 +
>>   drivers/clk/Makefile                      |    4 +-
>>   drivers/clk/hisilicon/Kconfig             |    6 +
>>   drivers/clk/hisilicon/Makefile            |    3 +-
>>   drivers/clk/hisilicon/clk-hi6220.c        |  291 +++++++++++++++++++++++++++++
>>   drivers/clk/hisilicon/clk.c               |   29 +++
>>   drivers/clk/hisilicon/clk.h               |   17 ++
>>   drivers/clk/hisilicon/clkdivider-hi6220.c |  156 ++++++++++++++++
>>   include/dt-bindings/clock/hi6220-clock.h  |  173 +++++++++++++++++
>>   9 files changed, 677 insertions(+), 4 deletions(-)
>>   create mode 100644 drivers/clk/hisilicon/Kconfig
>>   create mode 100644 drivers/clk/hisilicon/clk-hi6220.c
>>   create mode 100644 drivers/clk/hisilicon/clkdivider-hi6220.c
>>   create mode 100644 include/dt-bindings/clock/hi6220-clock.h
>>
>> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
>> index 9897f35..18bb930 100644
>> --- a/drivers/clk/Kconfig
>> +++ b/drivers/clk/Kconfig
>> @@ -150,6 +150,8 @@ config COMMON_CLK_CDCE706
>>   	---help---
>>   	  This driver supports TI CDCE706 programmable 3-PLL clock synthesizer.
>>
>> +source "drivers/clk/hisilicon/Kconfig"
>> +
>>   source "drivers/clk/qcom/Kconfig"
>>
>
> There's going to be a merge conflict here if this doesn't go through the
> clk tree.
Hello Arnd, how about the clk driver of hi6220 goes through the clk
tree and those dts and arch patches go through arm-soc?

If there is no problem, I will split the clock header file to a
single patch for your convenience.
>
>>
>> +
>> +static void __init hi6220_clk_sys_init(struct device_node *np)
>> +{
>> +	struct hisi_clock_data *clk_data;
>> +
>> +	clk_data = hisi_clk_init(np, HI6220_SYS_NR_CLKS);
>> +	if (!clk_data)
>> +		return;
>> +
>> +	hisi_clk_register_gate_sep(hi6220_separated_gate_clks_sys,
>> +			ARRAY_SIZE(hi6220_separated_gate_clks_sys), clk_data);
>> +
>> +	hisi_clk_register_mux(hi6220_mux_clks_sys,
>> +			ARRAY_SIZE(hi6220_mux_clks_sys), clk_data);
>> +
>> +	hi6220_clk_register_divider(hi6220_div_clks_sys,
>> +			ARRAY_SIZE(hi6220_div_clks_sys), clk_data);
>> +
>> +	if (!clk_data_ao)
>> +		return;
>> +
>> +	/* enable high speed clock on UART1 mux */
>> +	clk_set_parent(clk_data->clk_data.clks[HI6220_UART1_SRC],
>> +			clk_data_ao->clk_data.clks[HI6220_150M]);
>
> Sorry I missed this one earlier. Can we do this clk_set_parent() through
> assigned-parents instead?
Uart1 has two clock parents in hi6220, and use "clk_tcxo" by default,
we use uart1 to connect BT in HiKey, and switch to "clk_150m" for high 
speed mode of BT, but pl011 has no code to set clock rate or set clock
parents operation, so it's a easy way to do that here.

I expected an #include <linux/clk.h> for the
> usage of clk_set_parent() here so I didn't look hard to see if consumer
> APIs were being used.
OK, I will add in next version 8.

Thanks,

Bintian
>
> Otherwise the patch looks fine.
>

WARNING: multiple messages have this Message-ID (diff)
From: bintian.wang@huawei.com (Bintian)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 6/7] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Date: Thu, 21 May 2015 11:57:47 +0800	[thread overview]
Message-ID: <555D57BB.8080702@huawei.com> (raw)
In-Reply-To: <555D09F3.7020506@codeaurora.org>

Hello Stephen, Arnd,

On 2015/5/21 6:25, Stephen Boyd wrote:
> On 05/20/15 03:29, Bintian Wang wrote:
>> Add clock drivers for hi6220 SoC, this driver controls the SoC
>> registers to supply different clocks to different IPs in the SoC.
>>
>> We add one divider clock for hi6220 because the divider in hi6220
>> also has a mask bit but it doesnot obey the rule defined by flag
>> "CLK_DIVIDER_HIWORD_MASK", we can not get index of the mask bit by
>> left shift fixed bits (e.g. 16 bits), so we add this divider clock
>> to handle it.
>>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> Signed-off-by: Bintian Wang <bintian.wang@huawei.com>
>> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
>> Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>> Tested-by: Will Deacon <will.deacon@arm.com>
>> Tested-by: Tyler Baker <tyler.baker@linaro.org>
>> ---
>>   drivers/clk/Kconfig                       |    2 +
>>   drivers/clk/Makefile                      |    4 +-
>>   drivers/clk/hisilicon/Kconfig             |    6 +
>>   drivers/clk/hisilicon/Makefile            |    3 +-
>>   drivers/clk/hisilicon/clk-hi6220.c        |  291 +++++++++++++++++++++++++++++
>>   drivers/clk/hisilicon/clk.c               |   29 +++
>>   drivers/clk/hisilicon/clk.h               |   17 ++
>>   drivers/clk/hisilicon/clkdivider-hi6220.c |  156 ++++++++++++++++
>>   include/dt-bindings/clock/hi6220-clock.h  |  173 +++++++++++++++++
>>   9 files changed, 677 insertions(+), 4 deletions(-)
>>   create mode 100644 drivers/clk/hisilicon/Kconfig
>>   create mode 100644 drivers/clk/hisilicon/clk-hi6220.c
>>   create mode 100644 drivers/clk/hisilicon/clkdivider-hi6220.c
>>   create mode 100644 include/dt-bindings/clock/hi6220-clock.h
>>
>> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
>> index 9897f35..18bb930 100644
>> --- a/drivers/clk/Kconfig
>> +++ b/drivers/clk/Kconfig
>> @@ -150,6 +150,8 @@ config COMMON_CLK_CDCE706
>>   	---help---
>>   	  This driver supports TI CDCE706 programmable 3-PLL clock synthesizer.
>>
>> +source "drivers/clk/hisilicon/Kconfig"
>> +
>>   source "drivers/clk/qcom/Kconfig"
>>
>
> There's going to be a merge conflict here if this doesn't go through the
> clk tree.
Hello Arnd, how about the clk driver of hi6220 goes through the clk
tree and those dts and arch patches go through arm-soc?

If there is no problem, I will split the clock header file to a
single patch for your convenience.
>
>>
>> +
>> +static void __init hi6220_clk_sys_init(struct device_node *np)
>> +{
>> +	struct hisi_clock_data *clk_data;
>> +
>> +	clk_data = hisi_clk_init(np, HI6220_SYS_NR_CLKS);
>> +	if (!clk_data)
>> +		return;
>> +
>> +	hisi_clk_register_gate_sep(hi6220_separated_gate_clks_sys,
>> +			ARRAY_SIZE(hi6220_separated_gate_clks_sys), clk_data);
>> +
>> +	hisi_clk_register_mux(hi6220_mux_clks_sys,
>> +			ARRAY_SIZE(hi6220_mux_clks_sys), clk_data);
>> +
>> +	hi6220_clk_register_divider(hi6220_div_clks_sys,
>> +			ARRAY_SIZE(hi6220_div_clks_sys), clk_data);
>> +
>> +	if (!clk_data_ao)
>> +		return;
>> +
>> +	/* enable high speed clock on UART1 mux */
>> +	clk_set_parent(clk_data->clk_data.clks[HI6220_UART1_SRC],
>> +			clk_data_ao->clk_data.clks[HI6220_150M]);
>
> Sorry I missed this one earlier. Can we do this clk_set_parent() through
> assigned-parents instead?
Uart1 has two clock parents in hi6220, and use "clk_tcxo" by default,
we use uart1 to connect BT in HiKey, and switch to "clk_150m" for high 
speed mode of BT, but pl011 has no code to set clock rate or set clock
parents operation, so it's a easy way to do that here.

I expected an #include <linux/clk.h> for the
> usage of clk_set_parent() here so I didn't look hard to see if consumer
> APIs were being used.
OK, I will add in next version 8.

Thanks,

Bintian
>
> Otherwise the patch looks fine.
>

  reply	other threads:[~2015-05-21  3:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 10:29 [PATCH v7 5/7] clk: hisilicon: Remove __init for marking function prototypes Bintian Wang
2015-05-20 10:29 ` Bintian Wang
2015-05-20 10:29 ` [PATCH v7 6/7] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC Bintian Wang
2015-05-20 10:29   ` Bintian Wang
2015-05-20 22:25   ` Stephen Boyd
2015-05-20 22:25     ` Stephen Boyd
2015-05-21  3:57     ` Bintian [this message]
2015-05-21  3:57       ` Bintian
2015-05-21 18:00       ` Stephen Boyd
2015-05-21 18:00         ` Stephen Boyd
2015-05-22  5:20         ` Bintian
2015-05-22  5:20           ` Bintian
2015-05-22 18:30           ` Brent Wang
2015-05-22 18:30             ` Brent Wang
2015-05-22 18:35             ` Stephen Boyd
2015-05-22 18:35               ` Stephen Boyd
2015-05-22 18:41               ` Stephen Boyd
2015-05-22 18:41                 ` Stephen Boyd
2015-05-22 18:57                 ` Brent Wang
2015-05-22 18:57                   ` Brent Wang
2015-05-22 19:17                   ` Stephen Boyd
2015-05-22 19:17                     ` Stephen Boyd
2015-05-23  0:45                     ` Brent Wang
2015-05-23  0:45                       ` Brent Wang

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=555D57BB.8080702@huawei.com \
    --to=bintian.wang@huawei.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=dan.zhao@hisilicon.com \
    --cc=guodong.xu@linaro.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=heyunlei@huawei.com \
    --cc=huxinwei@huawei.com \
    --cc=jorge.ramirez-ortiz@linaro.org \
    --cc=khilman@kernel.org \
    --cc=khilman@linaro.org \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=olof@lixom.net \
    --cc=puck.chen@hisilicon.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=sledge.yanwei@huawei.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=tyler.baker@linaro.org \
    --cc=victor.lixin@hisilicon.com \
    --cc=w.f@huawei.com \
    --cc=wangbinghui@hisilicon.com \
    --cc=wangbintian@gmail.com \
    --cc=will.deacon@arm.com \
    --cc=xuejiancheng@huawei.com \
    --cc=xuwei5@hisilicon.com \
    --cc=xuyiping@hisilicon.com \
    --cc=yanhaifeng@gmail.com \
    --cc=z.liuxinliang@huawei.com \
    --cc=zhangfei.gao@linaro.org \
    --cc=zhenwei.wang@hisilicon.com \
    /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.