diff mbox series

[net-next,1/2] dt-bindings: net: dp83822: Add TI dp83822 phy

Message ID 20200514173055.15013-2-dmurphy@ti.com
State Changes Requested
Delegated to: David Miller
Headers show
Series DP83822 Fiber enablement | expand

Commit Message

Dan Murphy May 14, 2020, 5:30 p.m. UTC
Add a dt binding for the TI dp83822 ethernet phy device.

CC: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 .../devicetree/bindings/net/ti,dp83822.yaml   | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,dp83822.yaml

Comments

Andrew Lunn May 14, 2020, 6:39 p.m. UTC | #1
On Thu, May 14, 2020 at 12:30:54PM -0500, Dan Murphy wrote:
> Add a dt binding for the TI dp83822 ethernet phy device.
> 
> CC: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../devicetree/bindings/net/ti,dp83822.yaml   | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/ti,dp83822.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/ti,dp83822.yaml b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
> new file mode 100644
> index 000000000000..60afd43ad3b6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
> +# Copyright (C) 2020 Texas Instruments Incorporated
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/net/ti,dp83822.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: TI DP83822 ethernet PHY
> +
> +allOf:
> +  - $ref: "ethernet-controller.yaml#"
> +
> +maintainers:
> +  - Dan Murphy <dmurphy@ti.com>
> +
> +description: |
> +  The DP83822 is a low-power, single-port, 10/100 Mbps Ethernet PHY. It
> +  provides all of the physical layer functions needed to transmit and receive
> +  data over standard, twisted-pair cables or to connect to an external,
> +  fiber-optic transceiver. Additionally, the DP83822 provides flexibility to
> +  connect to a MAC through a standard MII, RMII, or RGMII interface

Hi Dan

You say 10/100 Mbps Ethernet PHY, but then list RGMII?

> +
> +  Specifications about the charger can be found at:
> +    http://www.ti.com/lit/ds/symlink/dp83822i.pdf
> +
> +properties:
> +  reg:
> +    maxItems: 1
> +
> +  ti,signal-polarity-low:
> +    type: boolean
> +    description: |
> +       DP83822 PHY in Fiber mode only.
> +       Sets the DP83822 to detect a link drop condition when the signal goes
> +       high.  If not set then link drop will occur when the signal goes low.

Are we talking about the LOS line from the SFP cage? In the SFF/SFP
binding we have:

- los-gpios : GPIO phandle and a specifier of the Receiver Loss of Signal
  Indication input gpio signal, active (signal lost) high

It would be nice to have a consistent naming.

Is it required the LOS signal is connected to the PHY? Russell King
has some patches which allows the Marvell PHY to be used as a media
converter. In that setting, i think the SFP signals are connected to
GPIOs not the PHY. The SFP core can then control the transmit disable,
module insertion detection etc. So i'm wondering if you need a
property to indicate the LOS is not connected to the PHY?

	 Andrew
Dan Murphy May 14, 2020, 7:38 p.m. UTC | #2
Andrew

On 5/14/20 1:39 PM, Andrew Lunn wrote:
> On Thu, May 14, 2020 at 12:30:54PM -0500, Dan Murphy wrote:
>> Add a dt binding for the TI dp83822 ethernet phy device.
>>
>> CC: Rob Herring <robh+dt@kernel.org>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>>   .../devicetree/bindings/net/ti,dp83822.yaml   | 49 +++++++++++++++++++
>>   1 file changed, 49 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/net/ti,dp83822.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/net/ti,dp83822.yaml b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
>> new file mode 100644
>> index 000000000000..60afd43ad3b6
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
>> @@ -0,0 +1,49 @@
>> +# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
>> +# Copyright (C) 2020 Texas Instruments Incorporated
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/net/ti,dp83822.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: TI DP83822 ethernet PHY
>> +
>> +allOf:
>> +  - $ref: "ethernet-controller.yaml#"
>> +
>> +maintainers:
>> +  - Dan Murphy <dmurphy@ti.com>
>> +
>> +description: |
>> +  The DP83822 is a low-power, single-port, 10/100 Mbps Ethernet PHY. It
>> +  provides all of the physical layer functions needed to transmit and receive
>> +  data over standard, twisted-pair cables or to connect to an external,
>> +  fiber-optic transceiver. Additionally, the DP83822 provides flexibility to
>> +  connect to a MAC through a standard MII, RMII, or RGMII interface
> Hi Dan
>
> You say 10/100 Mbps Ethernet PHY, but then list RGMII?
Copied from the data sheet.
>
>> +
>> +  Specifications about the charger can be found at:
>> +    http://www.ti.com/lit/ds/symlink/dp83822i.pdf
>> +
>> +properties:
>> +  reg:
>> +    maxItems: 1
>> +
>> +  ti,signal-polarity-low:
>> +    type: boolean
>> +    description: |
>> +       DP83822 PHY in Fiber mode only.
>> +       Sets the DP83822 to detect a link drop condition when the signal goes
>> +       high.  If not set then link drop will occur when the signal goes low.
> Are we talking about the LOS line from the SFP cage? In the SFF/SFP
> binding we have:
>
> - los-gpios : GPIO phandle and a specifier of the Receiver Loss of Signal
>    Indication input gpio signal, active (signal lost) high
>
> It would be nice to have a consistent naming.

> Is it required the LOS signal is connected to the PHY? Russell King
> has some patches which allows the Marvell PHY to be used as a media
> converter. In that setting, i think the SFP signals are connected to
> GPIOs not the PHY. The SFP core can then control the transmit disable,
> module insertion detection etc. So i'm wondering if you need a
> property to indicate the LOS is not connected to the PHY?

The LED_1 pin can be strapped to be an input to the chip for signal loss 
detection.  This is an optional feature of the PHY.

This property defines the polarity for the 822 LED_1/GPIO input pin.

The LOS is not required to be connected to the PHY.  If the preferred 
method is to use the SFP framework and Processor GPIOs then I can remove 
this from the patch set.

And if a user would like to use the feature then they can add it.

Dan


>
> 	 Andrew
Andrew Lunn May 14, 2020, 8:50 p.m. UTC | #3
> > Hi Dan
> > 
> > You say 10/100 Mbps Ethernet PHY, but then list RGMII?
> Copied from the data sheet.

O.K. So maybe it can connect over RGMII, but then only run 100Mbps
over it, rather than 1G.

> The LED_1 pin can be strapped to be an input to the chip for signal loss
> detection.  This is an optional feature of the PHY.
> 
> This property defines the polarity for the 822 LED_1/GPIO input pin.
> 
> The LOS is not required to be connected to the PHY.  If the preferred method
> is to use the SFP framework and Processor GPIOs then I can remove this from
> the patch set.
> 
> And if a user would like to use the feature then they can add it.

Well, both options are supported by the hardware. So i'm wondering if
we need to support both. So one property indicating the LOS is
actually connected to the PHY and a second indicating the polarity?

	 Andrew
Dan Murphy May 14, 2020, 8:51 p.m. UTC | #4
Andrew

On 5/14/20 3:50 PM, Andrew Lunn wrote:
>>> Hi Dan
>>>
>>> You say 10/100 Mbps Ethernet PHY, but then list RGMII?
>> Copied from the data sheet.
> O.K. So maybe it can connect over RGMII, but then only run 100Mbps
> over it, rather than 1G.
Yes.  This is not a 1Gbps PHY.  Max is 100Mbps.
>
>> The LED_1 pin can be strapped to be an input to the chip for signal loss
>> detection.  This is an optional feature of the PHY.
>>
>> This property defines the polarity for the 822 LED_1/GPIO input pin.
>>
>> The LOS is not required to be connected to the PHY.  If the preferred method
>> is to use the SFP framework and Processor GPIOs then I can remove this from
>> the patch set.
>>
>> And if a user would like to use the feature then they can add it.
> Well, both options are supported by the hardware. So i'm wondering if
> we need to support both. So one property indicating the LOS is
> actually connected to the PHY and a second indicating the polarity?

Why would we need 2?  The SFP core would need to know that the LOS is 
connected to the PHY.

The PHY is strapped to configure the LED_1 as a GPIO input.  I am not 
seeing a register that we can force this configuration.

Data sheet says

Note: To enable 100Base-FX Signal Detection on LED_1 (pin #24), strap 
SD_EN = '1'

So we can read the straps to see if the PHY is connected as the LOS 
input and set the polarity.  But if we are in fiber mode and that pin is 
not strapped for LOS then this setting takes no affect on the PHY.  So 
even reading the straps just allows us to bypass the polarity write.

Dan

>
> 	 Andrew
Andrew Lunn May 14, 2020, 9:04 p.m. UTC | #5
> Why would we need 2?  The SFP core would need to know that the LOS is
> connected to the PHY.

That is possible today. Just don't list the GPIO when declaring the
SFP.

> The PHY is strapped to configure the LED_1 as a GPIO input.  I am
> not seeing a register that we can force this configuration.

Ah, O.K. If it is selected via strapping only, they an additional
property is not needed.

	 Andrew
Rob Herring (Arm) May 28, 2020, 5:48 p.m. UTC | #6
On Thu, May 14, 2020 at 12:30:54PM -0500, Dan Murphy wrote:
> Add a dt binding for the TI dp83822 ethernet phy device.
> 
> CC: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../devicetree/bindings/net/ti,dp83822.yaml   | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/ti,dp83822.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/ti,dp83822.yaml b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
> new file mode 100644
> index 000000000000..60afd43ad3b6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
> +# Copyright (C) 2020 Texas Instruments Incorporated
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/net/ti,dp83822.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: TI DP83822 ethernet PHY
> +
> +allOf:
> +  - $ref: "ethernet-controller.yaml#"

Not an ethernet controller. Drop. (The ethernet-phy.yaml schema will be 
applied based on node name).

> +
> +maintainers:
> +  - Dan Murphy <dmurphy@ti.com>
> +
> +description: |
> +  The DP83822 is a low-power, single-port, 10/100 Mbps Ethernet PHY. It
> +  provides all of the physical layer functions needed to transmit and receive
> +  data over standard, twisted-pair cables or to connect to an external,
> +  fiber-optic transceiver. Additionally, the DP83822 provides flexibility to
> +  connect to a MAC through a standard MII, RMII, or RGMII interface
> +
> +  Specifications about the charger can be found at:
> +    http://www.ti.com/lit/ds/symlink/dp83822i.pdf
> +
> +properties:
> +  reg:
> +    maxItems: 1
> +
> +  ti,signal-polarity-low:

What signal? 

> +    type: boolean
> +    description: |
> +       DP83822 PHY in Fiber mode only.
> +       Sets the DP83822 to detect a link drop condition when the signal goes
> +       high.  If not set then link drop will occur when the signal goes low.

The naming is not clear that low is for link drop. So maybe:

ti,link-loss-low

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/ti,dp83822.yaml b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
new file mode 100644
index 000000000000..60afd43ad3b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,dp83822.yaml
@@ -0,0 +1,49 @@ 
+# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
+# Copyright (C) 2020 Texas Instruments Incorporated
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/net/ti,dp83822.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: TI DP83822 ethernet PHY
+
+allOf:
+  - $ref: "ethernet-controller.yaml#"
+
+maintainers:
+  - Dan Murphy <dmurphy@ti.com>
+
+description: |
+  The DP83822 is a low-power, single-port, 10/100 Mbps Ethernet PHY. It
+  provides all of the physical layer functions needed to transmit and receive
+  data over standard, twisted-pair cables or to connect to an external,
+  fiber-optic transceiver. Additionally, the DP83822 provides flexibility to
+  connect to a MAC through a standard MII, RMII, or RGMII interface
+
+  Specifications about the charger can be found at:
+    http://www.ti.com/lit/ds/symlink/dp83822i.pdf
+
+properties:
+  reg:
+    maxItems: 1
+
+  ti,signal-polarity-low:
+    type: boolean
+    description: |
+       DP83822 PHY in Fiber mode only.
+       Sets the DP83822 to detect a link drop condition when the signal goes
+       high.  If not set then link drop will occur when the signal goes low.
+
+required:
+  - reg
+
+examples:
+  - |
+    mdio0 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      ethphy0: ethernet-phy@0 {
+        reg = <0>;
+        ti,signal-polarity-low;
+      };
+    };