From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/12] clk: mmp: add mmp private gate clock
Date: Wed, 03 Sep 2014 10:55:37 -0700 [thread overview]
Message-ID: <20140903175537.11368.98589@quantum> (raw)
In-Reply-To: <1409027904-21859-7-git-send-email-chao.xie@marvell.com>
Quoting Chao Xie (2014-08-25 21:38:18)
> From: Chao Xie <chao.xie@marvell.com>
>
> Some SOCes have this kind of the gate clock
> 1. There are some bits to control the gate not only one bit.
> 2. Some clocks has operations of "out of reset" and "enable".
> To enable clock, we need do "out of reset" and "enable".
> To disable clock, we may not need "set to reset". It depends
> on the SOCes' design.
Are there any other IP blocks affected by the "out of reset" and "set to
reset" states? I wonder if you might benefit from the reset controller
framework? For example see,
drivers/clk/qcom/gcc-apq8084.c
<snip>
> +static int mmp_clk_gate_enable(struct clk_hw *hw)
> +{
> + struct mmp_clk_gate *gate = to_clk_mmp_gate(hw);
> + struct clk *clk = hw->clk;
> + unsigned long flags = 0;
> + unsigned long rate;
> + u32 tmp;
> +
> + if (gate->lock)
> + spin_lock_irqsave(gate->lock, flags);
> +
> + tmp = readl(gate->reg);
> + tmp &= ~gate->mask;
> + tmp |= gate->val_enable;
> + writel(tmp, gate->reg);
> +
> + if (gate->lock)
> + spin_unlock_irqrestore(gate->lock, flags);
> +
> + if (gate->flags & MMP_CLK_GATE_NEED_DELAY) {
> + rate = __clk_get_rate(clk);
> + /* Need delay 2 cycles. */
> + udelay(2000000/rate);
How long are these delays? Long enough to warrant using clk_prepare
instead of clk_enable? Are these clocks enabled from interrupt context?
Regards,
Mike
WARNING: multiple messages have this Message-ID (diff)
From: Mike Turquette <mturquette@linaro.org>
To: Chao Xie <chao.xie@marvell.com>,
haojian.zhuang@gmail.com,
haojian.zhuang@linaro.orgchao.xie@marvell.com,
xiechao_mail@163.com, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/12] clk: mmp: add mmp private gate clock
Date: Wed, 03 Sep 2014 10:55:37 -0700 [thread overview]
Message-ID: <20140903175537.11368.98589@quantum> (raw)
In-Reply-To: <1409027904-21859-7-git-send-email-chao.xie@marvell.com>
Quoting Chao Xie (2014-08-25 21:38:18)
> From: Chao Xie <chao.xie@marvell.com>
>
> Some SOCes have this kind of the gate clock
> 1. There are some bits to control the gate not only one bit.
> 2. Some clocks has operations of "out of reset" and "enable".
> To enable clock, we need do "out of reset" and "enable".
> To disable clock, we may not need "set to reset". It depends
> on the SOCes' design.
Are there any other IP blocks affected by the "out of reset" and "set to
reset" states? I wonder if you might benefit from the reset controller
framework? For example see,
drivers/clk/qcom/gcc-apq8084.c
<snip>
> +static int mmp_clk_gate_enable(struct clk_hw *hw)
> +{
> + struct mmp_clk_gate *gate = to_clk_mmp_gate(hw);
> + struct clk *clk = hw->clk;
> + unsigned long flags = 0;
> + unsigned long rate;
> + u32 tmp;
> +
> + if (gate->lock)
> + spin_lock_irqsave(gate->lock, flags);
> +
> + tmp = readl(gate->reg);
> + tmp &= ~gate->mask;
> + tmp |= gate->val_enable;
> + writel(tmp, gate->reg);
> +
> + if (gate->lock)
> + spin_unlock_irqrestore(gate->lock, flags);
> +
> + if (gate->flags & MMP_CLK_GATE_NEED_DELAY) {
> + rate = __clk_get_rate(clk);
> + /* Need delay 2 cycles. */
> + udelay(2000000/rate);
How long are these delays? Long enough to warrant using clk_prepare
instead of clk_enable? Are these clocks enabled from interrupt context?
Regards,
Mike
WARNING: multiple messages have this Message-ID (diff)
From: Mike Turquette <mturquette@linaro.org>
To: Chao Xie <chao.xie@marvell.com>,
haojian.zhuang@gmail.com, haojian.zhuang@linaro.org,
chao.xie@marvell.com, xiechao_mail@163.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/12] clk: mmp: add mmp private gate clock
Date: Wed, 03 Sep 2014 10:55:37 -0700 [thread overview]
Message-ID: <20140903175537.11368.98589@quantum> (raw)
In-Reply-To: <1409027904-21859-7-git-send-email-chao.xie@marvell.com>
Quoting Chao Xie (2014-08-25 21:38:18)
> From: Chao Xie <chao.xie@marvell.com>
>
> Some SOCes have this kind of the gate clock
> 1. There are some bits to control the gate not only one bit.
> 2. Some clocks has operations of "out of reset" and "enable".
> To enable clock, we need do "out of reset" and "enable".
> To disable clock, we may not need "set to reset". It depends
> on the SOCes' design.
Are there any other IP blocks affected by the "out of reset" and "set to
reset" states? I wonder if you might benefit from the reset controller
framework? For example see,
drivers/clk/qcom/gcc-apq8084.c
<snip>
> +static int mmp_clk_gate_enable(struct clk_hw *hw)
> +{
> + struct mmp_clk_gate *gate = to_clk_mmp_gate(hw);
> + struct clk *clk = hw->clk;
> + unsigned long flags = 0;
> + unsigned long rate;
> + u32 tmp;
> +
> + if (gate->lock)
> + spin_lock_irqsave(gate->lock, flags);
> +
> + tmp = readl(gate->reg);
> + tmp &= ~gate->mask;
> + tmp |= gate->val_enable;
> + writel(tmp, gate->reg);
> +
> + if (gate->lock)
> + spin_unlock_irqrestore(gate->lock, flags);
> +
> + if (gate->flags & MMP_CLK_GATE_NEED_DELAY) {
> + rate = __clk_get_rate(clk);
> + /* Need delay 2 cycles. */
> + udelay(2000000/rate);
How long are these delays? Long enough to warrant using clk_prepare
instead of clk_enable? Are these clocks enabled from interrupt context?
Regards,
Mike
next prev parent reply other threads:[~2014-09-03 17:55 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 4:38 [PATCH 00/12] clk: mmp: clock device tree support Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 01/12] clk: mmp: add prefix "mmp" for structures defined for clk-frac Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 02/12] clk: mmp: add spin lock " Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-09-03 18:04 ` Mike Turquette
2014-09-03 18:04 ` Mike Turquette
2014-09-03 18:04 ` Mike Turquette
2014-09-10 1:30 ` Chao Xie
2014-09-10 1:30 ` Chao Xie
2014-09-10 1:30 ` Chao Xie
2014-08-26 4:38 ` [PATCH 03/12] clk: mmp: add init callback " Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 04/12] clk: mmp: move definiton of mmp_clk_frac to clk.h Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 05/12] clk: mmp: add clock type mix Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 06/12] clk: mmp: add mmp private gate clock Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-09-03 17:55 ` Mike Turquette [this message]
2014-09-03 17:55 ` Mike Turquette
2014-09-03 17:55 ` Mike Turquette
2014-09-04 4:02 ` Chao Xie
2014-09-04 4:02 ` Chao Xie
2014-09-04 4:02 ` Chao Xie
2014-09-04 4:16 ` Chen-Yu Tsai
2014-09-04 4:16 ` Chen-Yu Tsai
2014-09-04 4:16 ` Chen-Yu Tsai
2014-08-26 4:38 ` [PATCH 07/12] clk: mmp: add basic support functions for DT support Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 08/12] clk: mmp: add pxa168 DT support for clock driver Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 09/12] clk: mmp: add pxa910 " Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 10/12] clk: mmp: add mmp2 " Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 11/12] arm: mmp: Make all the dts file to be compiled by Makefile Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` [PATCH 12/12] arm: mmp: Make use of the DT supported clock Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:38 ` Chao Xie
2014-08-26 4:55 ` [PATCH 00/12] clk: mmp: clock device tree support Haojian Zhuang
2014-08-26 4:55 ` Haojian Zhuang
2014-08-26 4:55 ` Haojian Zhuang
-- strict thread matches above, loose matches on Subject: below --
2014-06-10 1:27 Chao Xie
2014-06-10 1:27 ` [PATCH 06/12] clk: mmp: add mmp private gate clock Chao Xie
2014-06-10 1:27 ` Chao Xie
2014-06-10 1:27 ` Chao Xie
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=20140903175537.11368.98589@quantum \
--to=mturquette@linaro.org \
--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 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.