Skip to contentSkip to conversation

DP83TD510 Single Pair 10Mbps Ethernet PHY

PATCH Superseded Dan Murphy 2 participants 7 messages Oct 20, 2020

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Dan Murphy

author
#0 lore raw

v2 cover DP83TD510 Single Pair 10Mbps Ethernet PHY

Hello

The DP83TD510 is an Ethernet PHY supporting single pair of twisted wires. The PHY is capable of 10Mbps communication over long distances and exceeds the IEEE 802.3cg 10BASE-T1L single-pair Ethernet specification. The PHY supports various voltage level signalling and can be forced to support a specific voltage or allowed to perfrom auto negotiation on the voltage level. The default for the PHY is auto negotiation but if the PHY is forced to a specific voltage then the LP must also support the same voltage.

Add the 10BASE-T1L linkmodes for ethtool to properly advertise the PHY's capability.

Dan

Dan Murphy (3):
ethtool: Add 10base-T1L link mode entries
dt-bindings: dp83td510: Add binding for DP83TD510 Ethernet PHY
net: phy: dp83td510: Add support for the DP83TD510 Ethernet PHY

 .../devicetree/bindings/net/ti,dp83td510.yaml |  72 +++
 drivers/net/phy/Kconfig                       |   6 +
 drivers/net/phy/Makefile                      |   1 +
 drivers/net/phy/dp83td510.c                   | 600 ++++++++++++++++++
 drivers/net/phy/phy-core.c                    |   4 +-
 include/uapi/linux/ethtool.h                  |   2 +
 net/ethtool/common.c                          |   2 +
 net/ethtool/linkmodes.c                       |   2 +
 8 files changed, 688 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/ti,dp83td510.yaml
 create mode 100644 drivers/net/phy/dp83td510.c
Signature · 1 line
2.28.0.585.ge1cfff676549
author
#1 lore raw

PATCH v2 1/3 ethtool: Add 10base-T1L link mode entries

Add entries for the 10base-T1L full and half duplex supported modes.

$ ethtool eth0
        Supported ports: [ TP    MII  ]
        Supported link modes:   10baseT1L/Half 10baseT1L/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT1L/Half 10baseT1L/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 1
        Transceiver: external
        Supports Wake-on: gs
        Wake-on: d
        SecureOn password: 00:00:00:00:00:00
        Current message level: 0x00000000 (0)

Link detected: yes

---
 drivers/net/phy/phy-core.c   | 4 +++-
 include/uapi/linux/ethtool.h | 2 ++
 net/ethtool/common.c         | 2 ++
 net/ethtool/linkmodes.c      | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)
drivers/net/phy/phy-core.c +3 -1
index 8d333d3084ed..616fae7f0c86 100644
@@ -13,7 +13,7 @@
  */
 const char *phy_speed_to_str(int speed)
 {
-	BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 92,
+	BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 94,
 		"Enum ethtool_link_mode_bit_indices and phylib are out of sync. "
 		"If a speed or mode has been added please update phy_speed_to_str "
 		"and the PHY settings array.\n");
@@ -175,6 +175,8 @@ static const struct phy_setting settings[] = {
 	/* 10M */
 	PHY_SETTING(     10, FULL,     10baseT_Full		),
 	PHY_SETTING(     10, HALF,     10baseT_Half		),
+	PHY_SETTING(     10, FULL,     10baseT1L_Full		),
+	PHY_SETTING(     10, HALF,     10baseT1L_Half		),
 };
 #undef PHY_SETTING
 
include/uapi/linux/ethtool.h +2 -0
index 9ca87bc73c44..16b6ea7548d3 100644
@@ -1619,6 +1619,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT	 = 89,
 	ETHTOOL_LINK_MODE_100baseFX_Half_BIT		 = 90,
 	ETHTOOL_LINK_MODE_100baseFX_Full_BIT		 = 91,
+	ETHTOOL_LINK_MODE_10baseT1L_Half_BIT		 = 92,
+	ETHTOOL_LINK_MODE_10baseT1L_Full_BIT		 = 93,
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
 };
net/ethtool/common.c +2 -0
index 24036e3055a1..95f87febc742 100644
@@ -194,6 +194,8 @@ const char link_mode_names[][ETH_GSTRING_LEN] = {
 	__DEFINE_LINK_MODE_NAME(400000, CR4, Full),
 	__DEFINE_LINK_MODE_NAME(100, FX, Half),
 	__DEFINE_LINK_MODE_NAME(100, FX, Full),
+	__DEFINE_LINK_MODE_NAME(10, T1L, Half),
+	__DEFINE_LINK_MODE_NAME(10, T1L, Full),
 };
 static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
 
net/ethtool/linkmodes.c +2 -0
index c5bcb9abc8b9..a8fab6fb1b30 100644
@@ -264,6 +264,8 @@ static const struct link_mode_info link_mode_params[] = {
 	__DEFINE_LINK_MODE_PARAMS(400000, CR4, Full),
 	__DEFINE_LINK_MODE_PARAMS(100, FX, Half),
 	__DEFINE_LINK_MODE_PARAMS(100, FX, Full),
+	__DEFINE_LINK_MODE_PARAMS(10, T1L, Half),
+	__DEFINE_LINK_MODE_PARAMS(10, T1L, Full),
 };
 
 const struct nla_policy ethnl_linkmodes_set_policy[] = {
Signature · 1 line
2.28.0.585.ge1cfff676549
author
#2 lore raw

PATCH v2 2/3 dt-bindings: dp83td510: Add binding for DP83TD510 Ethernet PHY

In reply to Dan Murphy

The DP83TD510 is a 10M single twisted pair Ethernet PHY

---
 .../devicetree/bindings/net/ti,dp83td510.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,dp83td510.yaml
Documentation/devicetree/bindings/net/ti,dp83td510.yaml new file +72 -0
new file mode 100644
index 000000000000..171aed0f2503
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2020 Texas Instruments Incorporated
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/net/ti,dp83td510.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: TI DP83TD510 ethernet PHY
+
+allOf:
+  - $ref: "ethernet-controller.yaml#"
+  - $ref: "ethernet-phy.yaml#"
+
+maintainers:
+  - Dan Murphy <[email protected]>
+
+description: |
+  The PHY is an twisted pair 10Mbps Ethernet PHY that support MII, RMII and
+  RGMII interfaces.
+
+  Specifications about the Ethernet PHY can be found at:
+    http://www.ti.com/lit/ds/symlink/dp83td510e.pdf
+
+properties:
+  reg:
+    maxItems: 1
+
+  tx-fifo-depth:
+    description: |
+       Transmitt FIFO depth for RMII mode.  The PHY only exposes 4 nibble
+       depths. The valid nibble depths are 4, 5, 6 and 8.
+    default: 5
+
+  rx-internal-delay-ps:
+    description: |
+       Setting this property to a non-zero number sets the RX internal delay
+       for the PHY.  The internal delay for the PHY is fixed to 30ns relative
+       to receive data.
+
+  tx-internal-delay-ps:
+    description: |
+       Setting this property to a non-zero number sets the TX internal delay
+       for the PHY.  The internal delay for the PHY has a range of -4 to 4ns
+       relative to transmit data.
+
+  ti,master-slave-mode:
+    $ref: /schemas/types.yaml#definitions/uint32
+    default: 0
+    description: |
+      Force the PHY to be configured to a specific mode.
+      Force Auto Negotiation - 0
+      Force Master mode at 1v p2p - 1
+      Force Master mode at 2.4v p2p - 2
+      Force Slave mode at 1v p2p - 3
+      Force Slave mode at 2.4v p2p - 4
+    enum: [ 0, 1, 2, 3, 4 ]
+
+required:
+  - reg
+
+examples:
+  - |
+    mdio0 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      ethphy0: ethernet-phy@0 {
+        reg = <0>;
+        tx-fifo-depth = <5>;
+        rx-internal-delay-ps = <1>;
+        tx-internal-delay-ps = <1>;
+      };
+    };
Signature · 1 line
2.28.0.585.ge1cfff676549
author
#6 lore raw

PATCH v2 3/3 net: phy: dp83td510: Add support for the DP83TD510 Ethernet PHY

In reply to Dan Murphy

The DP83TD510E is an ultra-low power Ethernet physical layer transceiver that supports 10M single pair cable.

The device supports both 2.4-V p2p and 1-V p2p output voltage as defined by IEEE 802.3cg 10Base-T1L specfications. These modes can be forced via the device tree or the device is defaulted to auto negotiation to determine the proper p2p voltage.

---
 drivers/net/phy/Kconfig     |   6 +
 drivers/net/phy/Makefile    |   1 +
 drivers/net/phy/dp83td510.c | 600 ++++++++++++++++++++++++++++++++++++
 3 files changed, 607 insertions(+)
 create mode 100644 drivers/net/phy/dp83td510.c
drivers/net/phy/Kconfig +6 -0
index 698bea312adc..017252e1504c 100644
@@ -302,6 +302,12 @@ config DP83869_PHY
 	  Currently supports the DP83869 PHY.  This PHY supports copper and
 	  fiber connections.
 
+config DP83TD510_PHY
+	tristate "Texas Instruments DP83TD510 10M Single Pair Ethernet PHY"
+	help
+	  Support for the DP83TD510 Ethernet PHY. This PHY supports a 10M single
+	  pair Ethernet connection.
+
 config VITESSE_PHY
 	tristate "Vitesse PHYs"
 	help
drivers/net/phy/Makefile +1 -0
index a13e402074cf..bf62ce211eb4 100644
@@ -56,6 +56,7 @@ obj-$(CONFIG_DP83848_PHY)	+= dp83848.o
 obj-$(CONFIG_DP83867_PHY)	+= dp83867.o
 obj-$(CONFIG_DP83869_PHY)	+= dp83869.o
 obj-$(CONFIG_DP83TC811_PHY)	+= dp83tc811.o
+obj-$(CONFIG_DP83TD510_PHY)	+= dp83td510.o
 obj-$(CONFIG_FIXED_PHY)		+= fixed_phy.o
 obj-$(CONFIG_ICPLUS_PHY)	+= icplus.o
 obj-$(CONFIG_INTEL_XWAY_PHY)	+= intel-xway.o
drivers/net/phy/dp83td510.c new file +600 -0

600 lines not on this page · raw message

Signature · 1 line
2.28.0.585.ge1cfff676549
maintainer
#3 lore raw

Re: [PATCH net-next v2 2/3] dt-bindings: dp83td510: Add binding for DP83TD510 Ethernet PHY

In reply to Dan Murphy

Documentation/devicetree/bindings/net/ti,dp83td510.yaml line 56

Quoted 11 lines
Documentation/devicetree/bindings/net/ti,dp83td510.yaml new file +11 -0
+  ti,master-slave-mode:
+    $ref: /schemas/types.yaml#definitions/uint32
+    default: 0
+    description: |
+      Force the PHY to be configured to a specific mode.
+      Force Auto Negotiation - 0
+      Force Master mode at 1v p2p - 1
+      Force Master mode at 2.4v p2p - 2
+      Force Slave mode at 1v p2p - 3
+      Force Slave mode at 2.4v p2p - 4
+    enum: [ 0, 1, 2, 3, 4 ]

Is this a board hardware property? The fact value 0 means auto-neg suggests not.

We already have ethtool configuration of master/slave for T1 PHYs:

ommit bdbdac7649fac05f88c9f7ab18121a17fb591687

Author: Oleksij Rempel <[email protected]>
Date:   Tue May 5 08:35:05 2020 +0200

ethtool: provide UAPI for PHY master/slave configuration.

This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of auto-negotiation support, we needed to be able to configure the MASTER-SLAVE role of the port manually or from an application in user space.

Please can you look at using that UAPI.

I assume that 1v p2p is the voltage of the signal put onto the twisted pair? I know the Marvell 1000BaseT PHYs allow this to be configured as well, but just downwards to save power. Maybe a PHY tunable would be better?

Humm. Are 1v and 2.4v advertised so it can be auto negotiated? Maybe a PHY tunable is not correct? Is this voltage selection actually more like pause and EEE?

Andrew

maintainer
#4 lore raw

Re: [PATCH net-next v2 2/3] dt-bindings: dp83td510: Add binding for DP83TD510 Ethernet PHY

Quoted 3 lines

Humm. Are 1v and 2.4v advertised so it can be auto negotiated? Maybe a PHY tunable is not correct? Is this voltage selection actually more like pause and EEE?

[Goes and looks at the datasheet]

Register 0x20E, bit 13:

1 = Advertise that the 10BASE-T1L PHY has increased transmit/ receive level ability
0 = Do not advertise that the 10BASE-T1L PHY has increased transmit/receive level ability (default)

So does this mean 2.4v?

Andrew

author
#5 lore raw

Re: [PATCH net-next v2 2/3] dt-bindings: dp83td510: Add binding for DP83TD510 Ethernet PHY

Andrew

Quoted 5 lines · Andrew Lunn
Quoted 3 lines

Humm. Are 1v and 2.4v advertised so it can be auto negotiated? Maybe a PHY tunable is not correct? Is this voltage selection actually more like pause and EEE?

[Goes and looks at the datasheet]

Quoted 8 lines

Register 0x20E, bit 13:

1 = Advertise that the 10BASE-T1L PHY has increased transmit/ receive level ability
0 = Do not advertise that the 10BASE-T1L PHY has increased transmit/receive level ability (default)

So does this mean 2.4v?

This can also be strapped to a certain voltage level.  The device may not have the regulators on board to drive a 2.4v signal. 1v signal AVDD is 1.8v and 2.4v the AVDD needs to be at least 3.3v

This Strap defines the voltage level requested by PHY during auto negotiation. It is reflected in bit 12 of 0x20E. While using Force mode for Linkup, the strap controls the output voltage and reflects in bit 12 of 0x18F6

Bit 12

1 = Enable 2.4 Vpp operating mode
0 = Enable 1.0 Vpp operating mode

So maybe this is a hybrid of tunable for master/slave and a DT for voltage level since the ability of the board to drive the signal can vary.

Dan

Quoted 1 line

Andrew