devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dongpo Li <lidongpo@hisilicon.com>
To: Rob Herring <robh@kernel.org>
Cc: mark.rutland@arm.com, mturquette@baylibre.com,
	sboyd@codeaurora.org, linux@armlinux.org.uk,
	zhangfei.gao@linaro.org, yisen.zhuang@huawei.com,
	salil.mehta@huawei.com, davem@davemloft.net, arnd@arndb.de,
	andrew@lunn.ch, xuejiancheng@hisilicon.com,
	benjamin.chenhao@hisilicon.com, howell.yang@hisilicon.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] net: hix5hd2_gmac: add reset control and clock signals
Date: Mon, 15 Aug 2016 15:07:47 +0800	[thread overview]
Message-ID: <57B16A43.4090600@hisilicon.com> (raw)
In-Reply-To: <20160812184824.GA8959@rob-hp-laptop>

Hi Rob,

On 2016/8/13 2:48, Rob Herring wrote:
> On Thu, Aug 11, 2016 at 05:01:53PM +0800, Dongpo Li wrote:
>> From: Li Dongpo <lidongpo@hisilicon.com>
>>
>> Add three reset control signals, "mac_core_rst", "mac_ifc_rst" and
>> "phy_rst".
>> The following diagram explained how the reset signals work.
>>
>>                         SoC
>> |-----------------------------------------------------
>> |                               ------                |
>> |                               | cpu |               |
>> |                               ------                |
>> |                                  |                  |
>> |                              ------------ AMBA bus  |
>> |                         GMAC     |                  |
>> |                            ----------------------   |
>> | ------------- mac_core_rst | --------------      |  |
>> | |clock and   |-------------->|   mac core  |     |  |
>> | |reset       |             | --------------      |  |
>> | |generator   |----         |       |             |  |
>> | -------------     |        | ----------------    |  |
>> |          |        ---------->| mac interface |   |  |
>> |          |     mac_ifc_rst | ----------------    |  |
>> |          |                 |       |             |  |
>> |          |                 | ------------------  |  |
>> |          |phy_rst          | | RGMII interface | |  |
>> |          |                 | ------------------  |  |
>> |          |                 ----------------------   |
>> |----------|------------------------------------------|
>>            |                          |
>>            |                      ----------
>>            |--------------------- |PHY chip |
>>                                   ----------
>>
>> The "mac_core_rst" represents "mac core reset signal", it resets
>> the mac core including packet processing unit, descriptor processing unit,
>> tx engine, rx engine, control unit.
>> The "mac_ifc_rst" represents "mac interface reset signal", it resets
>> the mac interface. The mac interface unit connects mac core and
>> data interface like MII/RMII/RGMII. After we set a new value of
>> interface mode, we must reset mac interface to reload the new mode value.
>> The "phy_rst" represents "phy reset signal", it does a hardware reset
>> on the PHY chip. This reset signal is optinal if the PHY can work well
>> without the hardware reset.
>>
>> Add one more clock signal, the existing is MAC core clock,
>> and the new one is MAC interface clock.
>>
>> Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
>> ---
>>  .../bindings/net/hisilicon-hix5hd2-gmac.txt        |  16 ++-
>>  drivers/net/ethernet/hisilicon/hix5hd2_gmac.c      | 140 +++++++++++++++++++--
>>  2 files changed, 143 insertions(+), 13 deletions(-)
> 
> 
>>
>> @@ -807,16 +829,26 @@ static int hix5hd2_net_open(struct net_device *dev)
>>  	struct phy_device *phy;
>>  	int ret;
>>  
>> -	ret = clk_prepare_enable(priv->clk);
>> +	ret = clk_prepare_enable(priv->mac_core_clk);
>> +	if (ret < 0) {
>> +		netdev_err(dev, "failed to enable mac core clk %d\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	ret = clk_prepare_enable(priv->mac_ifc_clk);
>>  	if (ret < 0) {
>> -		netdev_err(dev, "failed to enable clk %d\n", ret);
>> +		clk_disable_unprepare(priv->mac_core_clk);
>> +		netdev_err(dev, "failed to enable mac ifc clk %d\n", ret);
> 
> This change will break with existing DTs. The mac_ifc_clk should be 
> optional.
> 
The mac_ifc_clk has existed in the existing hix5hd2. It's not implemented in the MAC driver
because the CLOCK driver implements a "complex" ethernet clock type.
So [PATCH 3/4] and [PATCH 4/4] are following this patch to change the CLOCK driver and existing DTs
at the same time.

> Rob
> 
>>  		return ret;
>>  	}
> 
> .
> 


    Regards,
    Dongpo

.


  reply	other threads:[~2016-08-15  7:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11  9:01 [PATCH 0/4] net: hix5hd2_gmac: add tx sg feature and reset/clock control signals Dongpo Li
     [not found] ` <1470906115-155569-1-git-send-email-lidongpo-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
2016-08-11  9:01   ` [PATCH 1/4] net: hix5hd2_gmac: add tx scatter-gather feature Dongpo Li
2016-08-12 18:43     ` Rob Herring
2016-08-15  6:50       ` Dongpo Li
2016-08-15 16:18         ` Rob Herring
     [not found]           ` <CAL_JsqLgzaPECHdX8yHC3DAUq0jXhgUFE+xVFbeV0OLQXopqxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-16  2:28             ` Dongpo Li
2016-08-11  9:01 ` [PATCH 2/4] net: hix5hd2_gmac: add reset control and clock signals Dongpo Li
     [not found]   ` <1470906115-155569-3-git-send-email-lidongpo-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
2016-08-12 18:48     ` Rob Herring
2016-08-15  7:07       ` Dongpo Li [this message]
2016-08-11  9:01 ` [PATCH 3/4] clk: hix5hd2: change ethernet clock type Dongpo Li
     [not found]   ` <1470906115-155569-4-git-send-email-lidongpo-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
2016-08-11 12:09     ` kbuild test robot
     [not found]       ` <201608112002.qeCiGZLQ%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-08-15  7:49         ` Dongpo Li
2016-08-11  9:01 ` [PATCH 4/4] ARM: dts: hix5hd2: add gmac clock and reset property Dongpo Li

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=57B16A43.4090600@hisilicon.com \
    --to=lidongpo@hisilicon.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=benjamin.chenhao@hisilicon.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=howell.yang@hisilicon.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=sboyd@codeaurora.org \
    --cc=xuejiancheng@hisilicon.com \
    --cc=yisen.zhuang@huawei.com \
    --cc=zhangfei.gao@linaro.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 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).