linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
@ 2017-11-07  2:49 Chris Zhong
  2017-11-07  7:54 ` Vladimir Zapolskiy
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Zhong @ 2017-11-07  2:49 UTC (permalink / raw)
  To: heiko
  Cc: Chris Zhong, Rob Herring, Mark Rutland, Russell King,
	linux-arm-kernel, linux-rockchip, devicetree, linux-kernel

The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
GPIO1_D6, this pin should be pull down then pull up to reset the phy.
Add a phy-reset property in emac, make the phy can be reset when emac
power on.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---

 arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts b/arch/arm/boot/dts/rk3066a-rayeager.dts
index 570157f..6064a0a 100644
--- a/arch/arm/boot/dts/rk3066a-rayeager.dts
+++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
@@ -173,6 +173,8 @@
 	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
 	phy = <&phy0>;
 	phy-supply = <&vcc_rmii>;
+	phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
+	phy-reset-duration = <10>; /* millisecond */
 	status = "okay";
 
 	phy0: ethernet-phy@0 {
-- 
2.7.4

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07  2:49 [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac Chris Zhong
@ 2017-11-07  7:54 ` Vladimir Zapolskiy
  2017-11-07  9:51   ` Chris Zhong
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vladimir Zapolskiy @ 2017-11-07  7:54 UTC (permalink / raw)
  To: Chris Zhong, Sergei Shtylyov, Roger Quadros
  Cc: heiko, Rob Herring, Mark Rutland, Russell King, linux-arm-kernel,
	linux-rockchip, devicetree, linux-kernel, netdev

Hello Chris,

On 11/07/2017 04:49 AM, Chris Zhong wrote:
> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
> Add a phy-reset property in emac, make the phy can be reset when emac
> power on.

for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
please reference to Documentation/devicetree/bindings/net/mdio.txt

Can you try to reuse them instead of adding new custom properties?

As a side question, which is mainly addressed to Sergei and Roger,
I don't quite understand why PHY properties were initially added to
MAC/MDIO bus device tree nodes, in my opinion they must be moved under
PHY device tree nodes.

--
With best wishes,
Vladimir

> 
> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
> ---
> 
>  arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts b/arch/arm/boot/dts/rk3066a-rayeager.dts
> index 570157f..6064a0a 100644
> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
> @@ -173,6 +173,8 @@
>  	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>  	phy = <&phy0>;
>  	phy-supply = <&vcc_rmii>;
> +	phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
> +	phy-reset-duration = <10>; /* millisecond */
>  	status = "okay";
>  
>  	phy0: ethernet-phy@0 {
> 

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07  7:54 ` Vladimir Zapolskiy
@ 2017-11-07  9:51   ` Chris Zhong
  2017-11-07 18:26     ` Florian Fainelli
  2017-11-07 15:59   ` Andrew Lunn
  2017-11-09  8:20   ` Roger Quadros
  2 siblings, 1 reply; 9+ messages in thread
From: Chris Zhong @ 2017-11-07  9:51 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sergei Shtylyov, Roger Quadros
  Cc: heiko, Rob Herring, Mark Rutland, Russell King, linux-arm-kernel,
	linux-rockchip, devicetree, linux-kernel, netdev



On 2017年11月07日 15:54, Vladimir Zapolskiy wrote:
> Hello Chris,
>
> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>> Add a phy-reset property in emac, make the phy can be reset when emac
>> power on.
> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
> please reference to Documentation/devicetree/bindings/net/mdio.txt
>
> Can you try to reuse them instead of adding new custom properties?
This phy-reset is from Documentation/devicetree/bindings/net/arc_emac.txt.
And copy from arch/arm/boot/dts/rk3036-kylin.dts.
Can we just use these properties, they are not new.
> As a side question, which is mainly addressed to Sergei and Roger,
> I don't quite understand why PHY properties were initially added to
> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
> PHY device tree nodes.
>
> --
> With best wishes,
> Vladimir
>
>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>> ---
>>
>>   arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts b/arch/arm/boot/dts/rk3066a-rayeager.dts
>> index 570157f..6064a0a 100644
>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>> @@ -173,6 +173,8 @@
>>   	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>   	phy = <&phy0>;
>>   	phy-supply = <&vcc_rmii>;
>> +	phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>> +	phy-reset-duration = <10>; /* millisecond */
>>   	status = "okay";
>>   
>>   	phy0: ethernet-phy@0 {
>>
>
>

-- 
Chris Zhong

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07  7:54 ` Vladimir Zapolskiy
  2017-11-07  9:51   ` Chris Zhong
@ 2017-11-07 15:59   ` Andrew Lunn
  2017-11-09  8:20   ` Roger Quadros
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2017-11-07 15:59 UTC (permalink / raw)
  To: Vladimir Zapolskiy
  Cc: Chris Zhong, Sergei Shtylyov, Roger Quadros, Mark Rutland,
	devicetree, heiko, netdev, Russell King, linux-kernel,
	linux-rockchip, Rob Herring, linux-arm-kernel

> As a side question, which is mainly addressed to Sergei and Roger,
> I don't quite understand why PHY properties were initially added to
> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
> PHY device tree nodes.

If you look at the implementation, they are not actually PHY
properties. They are MDIO properties. It is the MDIO driver using them
to perform an 'MDIO bus reset'. The property names are wrong.

The device tree structure could be better. It mixes the MAC and the
MDIO properties in the same node. It would of been better to have
separate nodes. 

The MDIO core now has equivalent functionality. So yes, it would be
better to use the generic MDIO properties, not these driver
properties.

	 Andrew

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07  9:51   ` Chris Zhong
@ 2017-11-07 18:26     ` Florian Fainelli
  2017-11-08  9:49       ` Chris Zhong
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2017-11-07 18:26 UTC (permalink / raw)
  To: Chris Zhong, Vladimir Zapolskiy, Sergei Shtylyov, Roger Quadros, andrew
  Cc: Mark Rutland, devicetree, heiko, netdev, Russell King,
	linux-kernel, linux-rockchip, Rob Herring, linux-arm-kernel

On 11/07/2017 01:51 AM, Chris Zhong wrote:
> 
> 
> On 2017年11月07日 15:54, Vladimir Zapolskiy wrote:
>> Hello Chris,
>>
>> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>>> Add a phy-reset property in emac, make the phy can be reset when emac
>>> power on.
>> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
>> please reference to Documentation/devicetree/bindings/net/mdio.txt
>>
>> Can you try to reuse them instead of adding new custom properties?
> This phy-reset is from Documentation/devicetree/bindings/net/arc_emac.txt.
> And copy from arch/arm/boot/dts/rk3036-kylin.dts.
> Can we just use these properties, they are not new.

Because it already exists does not mean it's correct, in fact, it is not
at all because it places the reset property for a PHY into the MAC node,
which is just not what this is, what we should be using instead is the
following patch series:

http://patchwork.ozlabs.org/project/netdev/list/?series=9267

http://patchwork.ozlabs.org/patch/828499/
http://patchwork.ozlabs.org/patch/828505/
http://patchwork.ozlabs.org/patch/828501/
http://patchwork.ozlabs.org/patch/828502/

>> As a side question, which is mainly addressed to Sergei and Roger,
>> I don't quite understand why PHY properties were initially added to
>> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
>> PHY device tree nodes.
>>
>> -- 
>> With best wishes,
>> Vladimir
>>
>>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>>> ---
>>>
>>>   arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>> b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>> index 570157f..6064a0a 100644
>>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>> @@ -173,6 +173,8 @@
>>>       pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>>       phy = <&phy0>;
>>>       phy-supply = <&vcc_rmii>;
>>> +    phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>>> +    phy-reset-duration = <10>; /* millisecond */
>>>       status = "okay";
>>>         phy0: ethernet-phy@0 {
>>>
>>
>>
> 


-- 
Florian

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07 18:26     ` Florian Fainelli
@ 2017-11-08  9:49       ` Chris Zhong
  2017-11-09  8:28         ` Roger Quadros
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Zhong @ 2017-11-08  9:49 UTC (permalink / raw)
  To: Florian Fainelli, Vladimir Zapolskiy, Sergei Shtylyov,
	Roger Quadros, andrew
  Cc: Mark Rutland, devicetree, heiko, netdev, Russell King,
	linux-kernel, linux-rockchip, Rob Herring, linux-arm-kernel

Hi Florian Fainelli


On 2017年11月08日 02:26, Florian Fainelli wrote:
> On 11/07/2017 01:51 AM, Chris Zhong wrote:
>>
>> On 2017年11月07日 15:54, Vladimir Zapolskiy wrote:
>>> Hello Chris,
>>>
>>> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>>>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>>>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>>>> Add a phy-reset property in emac, make the phy can be reset when emac
>>>> power on.
>>> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
>>> please reference to Documentation/devicetree/bindings/net/mdio.txt
>>>
>>> Can you try to reuse them instead of adding new custom properties?
>> This phy-reset is from Documentation/devicetree/bindings/net/arc_emac.txt.
>> And copy from arch/arm/boot/dts/rk3036-kylin.dts.
>> Can we just use these properties, they are not new.
> Because it already exists does not mean it's correct, in fact, it is not
> at all because it places the reset property for a PHY into the MAC node,
> which is just not what this is, what we should be using instead is the
> following patch series:
>
> http://patchwork.ozlabs.org/project/netdev/list/?series=9267
>
> http://patchwork.ozlabs.org/patch/828499/
> http://patchwork.ozlabs.org/patch/828505/
> http://patchwork.ozlabs.org/patch/828501/
> http://patchwork.ozlabs.org/patch/828502/
Okay, this series works for me, and I will push a new version patch 
following it,
with a reset-gpios property under phy node.
And hope this series can be applied soon.

Thanks
Chris Zhong


>>> As a side question, which is mainly addressed to Sergei and Roger,
>>> I don't quite understand why PHY properties were initially added to
>>> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
>>> PHY device tree nodes.
>>>
>>> -- 
>>> With best wishes,
>>> Vladimir
>>>
>>>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>>>> ---
>>>>
>>>>    arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>> b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>> index 570157f..6064a0a 100644
>>>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>> @@ -173,6 +173,8 @@
>>>>        pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>>>        phy = <&phy0>;
>>>>        phy-supply = <&vcc_rmii>;
>>>> +    phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>>>> +    phy-reset-duration = <10>; /* millisecond */
>>>>        status = "okay";
>>>>          phy0: ethernet-phy@0 {
>>>>
>>>
>

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-07  7:54 ` Vladimir Zapolskiy
  2017-11-07  9:51   ` Chris Zhong
  2017-11-07 15:59   ` Andrew Lunn
@ 2017-11-09  8:20   ` Roger Quadros
  2 siblings, 0 replies; 9+ messages in thread
From: Roger Quadros @ 2017-11-09  8:20 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Chris Zhong, Sergei Shtylyov
  Cc: heiko, Rob Herring, Mark Rutland, Russell King, linux-arm-kernel,
	linux-rockchip, devicetree, linux-kernel, netdev

Hi,

On 07/11/17 09:54, Vladimir Zapolskiy wrote:
> Hello Chris,
> 
> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>> Add a phy-reset property in emac, make the phy can be reset when emac
>> power on.
> 
> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
> please reference to Documentation/devicetree/bindings/net/mdio.txt
> 
> Can you try to reuse them instead of adding new custom properties?
> 
> As a side question, which is mainly addressed to Sergei and Roger,
> I don't quite understand why PHY properties were initially added to
> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
> PHY device tree nodes.

The PHY reset *has* to be performed at the MDIO bus driver level so that they
can be pin-strap configured correctly and be detected during MDIO bus scan.

- We have boards where PHYs won't be detected if RESET is not done before the scan. (due to invalid h/w pin-strapping config)
- We have boards where a single GPIO line controls reset of all PHYs on the bus.

Due to these reasons the RESET control lies with the MDIO bus driver.

> 
> --
> With best wishes,
> Vladimir
> 
>>
>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>> ---
>>
>>  arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts b/arch/arm/boot/dts/rk3066a-rayeager.dts
>> index 570157f..6064a0a 100644
>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>> @@ -173,6 +173,8 @@
>>  	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>  	phy = <&phy0>;
>>  	phy-supply = <&vcc_rmii>;
>> +	phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>> +	phy-reset-duration = <10>; /* millisecond */
>>  	status = "okay";
>>  
>>  	phy0: ethernet-phy@0 {
>>

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-08  9:49       ` Chris Zhong
@ 2017-11-09  8:28         ` Roger Quadros
  2017-11-09  8:40           ` Roger Quadros
  0 siblings, 1 reply; 9+ messages in thread
From: Roger Quadros @ 2017-11-09  8:28 UTC (permalink / raw)
  To: Chris Zhong, Florian Fainelli, Vladimir Zapolskiy,
	Sergei Shtylyov, andrew
  Cc: Mark Rutland, devicetree, heiko, netdev, Russell King,
	linux-kernel, linux-rockchip, Rob Herring, linux-arm-kernel

On 08/11/17 11:49, Chris Zhong wrote:
> Hi Florian Fainelli
> 
> 
> On 2017年11月08日 02:26, Florian Fainelli wrote:
>> On 11/07/2017 01:51 AM, Chris Zhong wrote:
>>>
>>> On 2017年11月07日 15:54, Vladimir Zapolskiy wrote:
>>>> Hello Chris,
>>>>
>>>> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>>>>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>>>>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>>>>> Add a phy-reset property in emac, make the phy can be reset when emac
>>>>> power on.
>>>> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
>>>> please reference to Documentation/devicetree/bindings/net/mdio.txt
>>>>
>>>> Can you try to reuse them instead of adding new custom properties?
>>> This phy-reset is from Documentation/devicetree/bindings/net/arc_emac.txt.
>>> And copy from arch/arm/boot/dts/rk3036-kylin.dts.
>>> Can we just use these properties, they are not new.
>> Because it already exists does not mean it's correct, in fact, it is not
>> at all because it places the reset property for a PHY into the MAC node,
>> which is just not what this is, what we should be using instead is the
>> following patch series:
>>
>> http://patchwork.ozlabs.org/project/netdev/list/?series=9267
>>
>> http://patchwork.ozlabs.org/patch/828499/
>> http://patchwork.ozlabs.org/patch/828505/
>> http://patchwork.ozlabs.org/patch/828501/
>> http://patchwork.ozlabs.org/patch/828502/
> Okay, this series works for me, and I will push a new version patch following it,
> with a reset-gpios property under phy node.
> And hope this series can be applied soon.
> 

If 'reset-gpios' and 'reset-delay-us' as per [1] works for you
then why not use that?

[1] Documentation/devicetree/bindings/net/mdio.txt

> Thanks
> Chris Zhong
> 
> 
>>>> As a side question, which is mainly addressed to Sergei and Roger,
>>>> I don't quite understand why PHY properties were initially added to
>>>> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
>>>> PHY device tree nodes.
>>>>
>>>> -- 
>>>> With best wishes,
>>>> Vladimir
>>>>
>>>>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>>>>> ---
>>>>>
>>>>>    arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>>>>    1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>> b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>> index 570157f..6064a0a 100644
>>>>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>> @@ -173,6 +173,8 @@
>>>>>        pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>>>>        phy = <&phy0>;
>>>>>        phy-supply = <&vcc_rmii>;
>>>>> +    phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>>>>> +    phy-reset-duration = <10>; /* millisecond */
>>>>>        status = "okay";
>>>>>          phy0: ethernet-phy@0 {
>>>>>
>>>>
>>
> 

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac
  2017-11-09  8:28         ` Roger Quadros
@ 2017-11-09  8:40           ` Roger Quadros
  0 siblings, 0 replies; 9+ messages in thread
From: Roger Quadros @ 2017-11-09  8:40 UTC (permalink / raw)
  To: Chris Zhong, Florian Fainelli, Vladimir Zapolskiy,
	Sergei Shtylyov, andrew
  Cc: Mark Rutland, devicetree, heiko, netdev, Russell King,
	linux-kernel, linux-rockchip, Rob Herring, linux-arm-kernel

On 09/11/17 10:28, Roger Quadros wrote:
> On 08/11/17 11:49, Chris Zhong wrote:
>> Hi Florian Fainelli
>>
>>
>> On 2017年11月08日 02:26, Florian Fainelli wrote:
>>> On 11/07/2017 01:51 AM, Chris Zhong wrote:
>>>>
>>>> On 2017年11月07日 15:54, Vladimir Zapolskiy wrote:
>>>>> Hello Chris,
>>>>>
>>>>> On 11/07/2017 04:49 AM, Chris Zhong wrote:
>>>>>> The ethernet phy of rk3066a-rayeager has a reset pin, it controlled by
>>>>>> GPIO1_D6, this pin should be pull down then pull up to reset the phy.
>>>>>> Add a phy-reset property in emac, make the phy can be reset when emac
>>>>>> power on.
>>>>> for PHY reset there are properties 'reset-gpios' and 'reset-delay-us',
>>>>> please reference to Documentation/devicetree/bindings/net/mdio.txt
>>>>>
>>>>> Can you try to reuse them instead of adding new custom properties?
>>>> This phy-reset is from Documentation/devicetree/bindings/net/arc_emac.txt.
>>>> And copy from arch/arm/boot/dts/rk3036-kylin.dts.
>>>> Can we just use these properties, they are not new.
>>> Because it already exists does not mean it's correct, in fact, it is not
>>> at all because it places the reset property for a PHY into the MAC node,
>>> which is just not what this is, what we should be using instead is the
>>> following patch series:
>>>
>>> http://patchwork.ozlabs.org/project/netdev/list/?series=9267
>>>
>>> http://patchwork.ozlabs.org/patch/828499/
>>> http://patchwork.ozlabs.org/patch/828505/
>>> http://patchwork.ozlabs.org/patch/828501/
>>> http://patchwork.ozlabs.org/patch/828502/
>> Okay, this series works for me, and I will push a new version patch following it,
>> with a reset-gpios property under phy node.
>> And hope this series can be applied soon.
>>
> 
> If 'reset-gpios' and 'reset-delay-us' as per [1] works for you
> then why not use that?
> 
> [1] Documentation/devicetree/bindings/net/mdio.txt

I take back my statement.

You should use the above only if you have a single reset line connected to multiple PHYs
on the same MDIO bus.
In all other cases the reset properties should be part of PHY device node.

However, we need to still ensure that the mdio_bus driver issues the reset. This piece
is still missing in the code.

> 
>> Thanks
>> Chris Zhong
>>
>>
>>>>> As a side question, which is mainly addressed to Sergei and Roger,
>>>>> I don't quite understand why PHY properties were initially added to
>>>>> MAC/MDIO bus device tree nodes, in my opinion they must be moved under
>>>>> PHY device tree nodes.
>>>>>
>>>>> -- 
>>>>> With best wishes,
>>>>> Vladimir
>>>>>
>>>>>> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>>>>>> ---
>>>>>>
>>>>>>    arch/arm/boot/dts/rk3066a-rayeager.dts | 2 ++
>>>>>>    1 file changed, 2 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>>> b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>>> index 570157f..6064a0a 100644
>>>>>> --- a/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>>> +++ b/arch/arm/boot/dts/rk3066a-rayeager.dts
>>>>>> @@ -173,6 +173,8 @@
>>>>>>        pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
>>>>>>        phy = <&phy0>;
>>>>>>        phy-supply = <&vcc_rmii>;
>>>>>> +    phy-reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>; /* PHY_RST */
>>>>>> +    phy-reset-duration = <10>; /* millisecond */
>>>>>>        status = "okay";
>>>>>>          phy0: ethernet-phy@0 {
>>>>>>
>>>>>
>>>
>>
> 

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

end of thread, other threads:[~2017-11-09  8:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07  2:49 [PATCH] ARM: dts: add phy-reset property for rk3066a-rayeager emac Chris Zhong
2017-11-07  7:54 ` Vladimir Zapolskiy
2017-11-07  9:51   ` Chris Zhong
2017-11-07 18:26     ` Florian Fainelli
2017-11-08  9:49       ` Chris Zhong
2017-11-09  8:28         ` Roger Quadros
2017-11-09  8:40           ` Roger Quadros
2017-11-07 15:59   ` Andrew Lunn
2017-11-09  8:20   ` Roger Quadros

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).