Add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Subsystems (4)
v4 cover Add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Hello,
This series adds support for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY, commonly used in enterprise and industrial networking applications. The PHY supports 10/100/1000 Mbps operation with RGMII interface and includes features such as IEEE 802.3az Energy Efficient Ethernet, IEEE 1588 SyncE.
The driver implements extended register access via indirect addressing (registers 0x1E/0x1F) and provides comprehensive device tree support for RGMII delay configuration. The rx-internal-delay-ps and tx-internal-delay-ps properties allow precise tuning of clock delays in 150 ps steps from 0 to 2250 ps.
This PHY is used on the NDA platform with 1G Ethernet tile and has been tested on that hardware with successful link establishment and RGMII delay tuning.
$ make dt_binding_check DT_SCHEMA_FILES=dapu,dap8211r.yaml SCHEMA Documentation/devicetree/bindings/processed-schema.json DTEX Documentation/devicetree/bindings/net/dapu,dap8211r.example.dts DTC [C] Documentation/devicetree/bindings/net/dapu,dap8211r.example.dt
$ grep -i "dap8211r" Documentation/devicetree/bindings/processed-schema.json
"http://devicetree.org/schemas/net/dapu,dap8211r.yaml": {
"$filename": "/home/a-shimko/patchwork/linux/Documentation/devicetree/bindings/net/dapu,dap8211r.yaml",
"$id": "http://devicetree.org/schemas/net/dapu,dap8211r.yaml#",
"title": "DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY",Working with xgmac.
Board side:
$ arping -I eth0 192.168.5.100 ARPING 192.168.5.1 from 192.168.5.100 eth0 Unicast reply from 192.168.5.1 [board.mac.addr] 8.543ms Unicast reply from 192.168.5.1 [board.mac.addr] 3.295ms Unicast reply from 192.168.5.1 [board.mac.addr] 4.301ms Unicast reply from 192.168.5.1 [board.mac.addr] 4.096ms Unicast reply from 192.168.5.1 [board.mac.addr] 2.872ms ...
Unfortunately, there is a dependence on the axibus speed here
$ iperf3 -c 192.168.5.1 Connecting to host 192.168.5.1, port 5201 [ 5] local 192.168.5.100 port 58936 connected to 192.168.5.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 7.88 MBytes 65.8 Mbits/sec 0 150 KBytes [ 5] 1.00-2.00 sec 8.50 MBytes 71.4 Mbits/sec 0 165 KBytes [ 5] 2.00-3.00 sec 8.25 MBytes 69.2 Mbits/sec 0 165 KBytes [ 5] 3.00-4.01 sec 8.50 MBytes 71.1 Mbits/sec 0 165 KBytes [ 5] 4.01-5.00 sec 8.38 MBytes 70.3 Mbits/sec 0 165 KBytes [ 5] 5.00-6.00 sec 8.50 MBytes 71.5 Mbits/sec 0 165 KBytes [ 5] 6.00-7.01 sec 8.62 MBytes 72.0 Mbits/sec 0 174 KBytes [ 5] 7.01-8.00 sec 8.62 MBytes 72.8 Mbits/sec 0 174 KBytes [ 5] 8.00-9.00 sec 8.62 MBytes 72.2 Mbits/sec 0 174 KBytes [ 5] 9.00-10.04 sec 8.62 MBytes 69.9 Mbits/sec 0 174 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.04 sec 84.6 MBytes 70.7 Mbits/sec 0 sender [ 5] 0.00-10.12 sec 84.8 MBytes 70.3 Mbits/sec receiveriperf Done.
$ ethtool -t eth0 ... The test extra info: 1. MAC Loopback 0 2. MAC Loopback (diff. queues) 0 3. PHY Loopback 0 ...
ELP side:
...
17:29:11.974973 ARP, Reply ELP is-at elp.mac.addr(oui Unknown), length 28 17:29:12.975199 ARP, Request who-has ELP tell 192.168.5.100, length 46 17:29:12.975217 ARP, Reply ELP is-at elp.mac.addr(oui Unknown), length 28 17:29:13.975022 ARP, Request who-has ELP tell 192.168.5.100, length 46 17:29:13.975035 ARP, Reply ELP is-at elp.mac.addr(oui Unknown), length 28 17:29:14.974837 ARP, Request who-has ELP tell 192.168.5.100, length 46 17:29:14.974849 ARP, Reply ELP is-at elp.mac.addr(oui Unknown), length 28 17:29:15.975026 ARP, Request who-has ELP tell 192.168.5.100, length 46
...
Accepted connection from 192.168.5.100, port 58932
[ 5] local 192.168.5.1 port 5201 connected to 192.168.5.100 port 58936
[ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 7.12 MBytes 59.7 Mbits/sec [ 5] 1.00-2.00 sec 8.50 MBytes 71.3 Mbits/sec [ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec [ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec [ 5] 4.00-5.00 sec 8.50 MBytes 71.3 Mbits/sec [ 5] 5.00-6.00 sec 8.38 MBytes 70.3 Mbits/sec [ 5] 6.00-7.00 sec 8.62 MBytes 72.4 Mbits/sec [ 5] 7.00-8.00 sec 8.62 MBytes 72.3 Mbits/sec [ 5] 8.00-9.00 sec 8.62 MBytes 72.4 Mbits/sec [ 5] 9.00-10.00 sec 8.62 MBytes 72.4 Mbits/sec [ 5] 10.00-10.12 sec 896 KBytes 62.3 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.12 sec 84.8 MBytes 70.3 Mbits/sec receiver
DTS node example:ðernet_1g_tile {
...
phy-mode = "rgmii-rxid";
phy-handle = <&phy1>;
...
mdio: mdio {
phy1: ethernet-phy@1 {
...
compatible = "ethernet-phy-id0008.011b";
rx-internal-delay-ps = <1050>;
...
}; };
};
--
Best regards,
Artem Shimko
ChangeLog:
v3 --> v4
- Drop dapu,tx-inverted-clk (vendor-specific property removed)
- Fix driver behavior in relation to rgmii modes
- Apply software reset before RGMII register writes
v2 --> v3
- Use phy_get_internal_delay() for delay validation and selection
- Add poll timeout for reset using read_poll_timeout()
v1 --> v2
- Drop debugfs interface
- Simplify RGMII delay reading logic using of_property_read_u32()
- Fix missing newline at end of dapu,dap8211r.yaml (yamllint error)
- Simplify delay property description in DT binding
- Rename tx-inverted-clk to dapu,tx-inverted-clk (vendor prefix)
- Replace enum with multipleOf + maximum for delay validation
- Fix compatible string and tx-internal-delay-ps value in example
- Remove rounding logic, return -EINVAL for unsupported delay values
- Respect DT delay properties for all RGMII modes
- Add polling for self-clearing reset bit instead of fixed sleep
- Remove unused packet generator macros (DAP8211R_PKGC5 and related)
Artem Shimko (2):
dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding
net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
.../bindings/net/dapu,dap8211r.yaml | 63 ++++++ drivers/net/phy/Kconfig | 10 + drivers/net/phy/Makefile | 1 + drivers/net/phy/dap8211r.c | 206 ++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/dapu,dap8211r.yaml create mode 100644 drivers/net/phy/dap8211r.c
Signature · 1 line
2.43.0
PATCH v4 1/2 dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding
Add device tree binding documentation for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY.
The PHY supports TX and RX clock delays in 150 ps steps from 0 to 2250 ps, with a default of 1950 ps if not specified.
--- .../bindings/net/dapu,dap8211r.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/dapu,dap8211r.yaml
Documentation/devicetree/bindings/net/dapu,dap8211r.yaml new file +63 -0
@@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dapu,dap8211r.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY + +maintainers: + - Artem Shimko <[email protected]> + +description: | + The DAP8211R(I) is a Gigabit Ethernet PHY with RGMII interface, + supporting IEEE 802.3az Energy Efficient Ethernet, IEEE 1588 SyncE, + and an internal packet generator for diagnostics. + + Specifications: + - 10BASE-Te, 100BASE-TX, 1000BASE-T + - RGMII with configurable TX/RX clock delays (150 ps steps, 0-2250 ps) + - IEEE 802.3az-2010 Energy Efficient Ethernet + - IEEE 1588 SyncE support + - Internal packet generator and checker for link diagnostics + +allOf: + - $ref: ethernet-phy.yaml# + +properties: + compatible: + const: ethernet-phy-id0008.011b + + reg: + maxItems: 1 + + rx-internal-delay-ps: + description: + RGMII RX clock delay in picoseconds (0 to maximum). + multipleOf: 150 + maximum: 2250 + default: 1950 + + tx-internal-delay-ps: + description: + RGMII TX clock delay in picoseconds (0 to maximum). + multipleOf: 150 + maximum: 2250 + default: 1950 + +unevaluatedProperties: false + +examples: + - | + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@1 { + compatible = "ethernet-phy-id0008.011b"; + reg = <1>; + rx-internal-delay-ps = <2100>; + tx-internal-delay-ps = <2100>; + }; + }; +
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH net-next v4 1/2] dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The vendor prefix 'dapu' used in the binding filename is missing from the global…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The vendor prefix 'dapu' used in the binding filename is missing from the global vendor-prefixes.yaml file. --
--- Patch [1]: [PATCH net-next v4 1/2] dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding --- commit 6db277d294bbbe2617770040fd7c694fff198374
Author: Artem Shimko <[email protected]>
dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding
This commit adds device tree binding documentation for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY. It specifies support for configuring TX and RX clock delays.
Documentation/devicetree/bindings/net/dapu,dap8211r.yaml line 4
Quoted 10 lines
Documentation/devicetree/bindings/net/dapu,dap8211r.yaml new file +4
-0@@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dapu,dap8211r.yaml#
[Severity: Low]
Does this patch series also need to add the 'dapu' vendor prefix to Documentation/devicetree/bindings/vendor-prefixes.yaml?
It appears 'dapu' is used in the filename and compatible string, which will cause make dt_binding_check to emit warnings if the prefix is missing from the global registry.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH net-next v4 1/2] dt-bindings: net: add DAPU Telecom DAP8211R(I) PHY binding
Quoted 7 lines · On Tue, Jul 28, 2026 at 10:53 AM <[email protected]> wrote:
[Severity: Low]
Does this patch series also need to add the 'dapu' vendor prefix toDocumentation/devicetree/bindings/vendor-prefixes.yaml?It appears 'dapu' is used in the filename and compatible string, which will cause make
dt_binding_checkto emit warnings if the prefix is missing from the global registry.
I don't know.
But it seems it's finally clear how to use yamllint =) found the issue
$ make dt_binding_check DT_SCHEMA_FILES=dapu,dap8211r.yaml SCHEMA Documentation/devicetree/bindings/processed-schema.json CHKDT ./Documentation/devicetree/bindings LINT ./Documentation/devicetree/bindings STYLE ./Documentation/devicetree/bindings DTEX Documentation/devicetree/bindings/net/dapu,dap8211r.example.dts DTC [C] Documentation/devicetree/bindings/net/dapu,dap8211r.example.dtb $ yamllint Documentation/devicetree/bindings/net/dapu,dap8211r.yaml Documentation/devicetree/bindings/net/dapu,dap8211r.yaml 63:1 error too many blank lines (1 > 0) (empty-lines)
--
Best regards,
Artem
PATCH v4 2/2 net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
In reply to Artem ShimkoAdd a new PHY driver for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY, which is commonly used in enterprise and industrial networking applications.
The driver implements extended register access via indirect addressing through corresponding registers, and provides comprehensive device tree support for RGMII delay configuration. The rx-internal-delay-ps and tx-internal-delay-ps properties allow precise tuning of clock delays in 150 ps steps from 0 to 2250 ps.
--- drivers/net/phy/Kconfig | 10 ++ drivers/net/phy/Makefile | 1 + drivers/net/phy/dap8211r.c | 206 +++++++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 drivers/net/phy/dap8211r.c
drivers/net/phy/Kconfig +10 -0
@@ -237,6 +237,16 @@ config DAVICOM_PHY help Currently supports dm9161e and dm9131 +config DAP8211R_PHY + tristate "DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY" + depends on OF + help + Support for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY. + This PHY is designed for enterprise and industrial networking + applications, supporting 10/100/1000 Mbps operation. + RGMII with: configurable TX/RX clock delays, optional flag to enable + 180-degree TX clock phase shift and internal packet generator. + config ICPLUS_PHY tristate "ICPlus PHYs" help
drivers/net/phy/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_BROADCOM_PHY) += broadcom.o obj-$(CONFIG_CICADA_PHY) += cicada.o obj-$(CONFIG_CORTINA_PHY) += cortina.o obj-$(CONFIG_DAVICOM_PHY) += davicom.o +obj-$(CONFIG_DAP8211R_PHY) += dap8211r.o obj-$(CONFIG_DP83640_PHY) += dp83640.o obj-$(CONFIG_DP83822_PHY) += dp83822.o obj-$(CONFIG_DP83848_PHY) += dp83848.o
drivers/net/phy/dap8211r.c new file +206 -0
206 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH net-next v4 2/2] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] The Kconfig help text claims support for device tree flags enabling a 180-degree TX clock phase…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The Kconfig help text claims support for device tree flags enabling a 180-degree TX clock phase shift and an internal packet generator, but the driver implements neither.
- [Medium] Inconsistent handling of RGMII delay device tree properties relative to the selected phy-mode.
--
--- Patch [2]: [PATCH net-next v4 2/2] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver --- commit 8189e886a8887b076e59fb9f9e71196f6089538d
Author: Artem Shimko <[email protected]>
net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
This commit introduces a new PHY driver for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY. It implements extended register access via indirect addressing and configures RGMII TX/RX clock delays through device tree properties.
Quoted 4 lines
drivers/net/phy/Kconfig +0
-0
[ ... ]
drivers/net/phy/Kconfig config DAVICOM_PHY · line 254
Quoted 13 lines
drivers/net/phy/Kconfig +9
-0@@ -243,6 +243,16 @@ config DAVICOM_PHY help Currently supports dm9161e and dm9131 +config DAP8211R_PHY + tristate "DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY" + depends on OF + help + Support for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY. + This PHY is designed for enterprise and industrial networking + applications, supporting 10/100/1000 Mbps operation. + RGMII with: configurable TX/RX clock delays, optional flag to enable + 180-degree TX clock phase shift and internal packet generator.
[Severity: Medium]
Are the 180-degree TX clock phase shift and internal packet generator features actually implemented in this driver?
The help text advertises these features for users configuring the kernel, but looking at the driver code, there doesn't seem to be any implementation for them. Could this mislead users who expect these features to be available based on the documentation?
Quoted 9 lines
drivers/net/phy/Kconfig +1
-0+ config ICPLUS_PHY tristate "ICPlus PHYs" helpdrivers/net/phy/dap8211r.c new file +0
-0
[ ... ]
Quoted 2 lines
drivers/net/phy/dap8211r.c new file +2
-0+static int dap8211r_config_init (struct phy_device *phydev) +{
[ ... ]
drivers/net/phy/dap8211r.c line 139
Quoted 13 lines
drivers/net/phy/dap8211r.c new file +13
-0+switch (phydev->interface) { +case PHY_INTERFACE_MODE_RGMII : +if (rx_internal_delay <0 ) + rx_internal_delay =0 ; + +if (tx_internal_delay <0 ) + tx_internal_delay =0 ; +break ; +case PHY_INTERFACE_MODE_RGMII_RXID : +if (rx_internal_delay <0 ) + rx_internal_delay =DAP8211R_DEFAULT_DEL_SEL ; + + tx_internal_delay =0 ;
[Severity: Medium]
Is it intentional to silently drop an explicitly provided tx-internal-delay-ps property when using PHY_INTERFACE_MODE_RGMII_RXID?
For PHY_INTERFACE_MODE_RGMII, explicit delay properties are kept and applied. However, in dap8211r_config_init(), tx_internal_delay is hardcoded to 0 for the rgmii-rxid mode.
This might lead to unexpected configuration drops if a device tree specifies phy-mode = "rgmii-rxid" along with a tx-internal-delay-ps property, as the requested delay will be ignored without warning.
Quoted 2 lines
drivers/net/phy/dap8211r.c new file +2
-0+break ; +case PHY_INTERFACE_MODE_RGMII_ID :
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH net-next v4 2/2] net: phy: add DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY driver
Quoted 10 lines · On Tue, Jul 28, 2026 at 10:53 AM <[email protected]> wrote:
drivers/net/phy/Kconfig config DAVICOM_PHY · line 248
Quoted 9 lines
drivers/net/phy/Kconfig +9
-0+config DAP8211R_PHY + tristate "DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY" + depends on OF + help + Support for the DAPU Telecom DAP8211R(I) Gigabit Ethernet PHY. + This PHY is designed for enterprise and industrial networking + applications, supporting 10/100/1000 Mbps operation. + RGMII with: configurable TX/RX clock delays, optional flag to enable + 180-degree TX clock phase shift and internal packet generator.
Quoted 8 lines
[Severity: Medium]
Are the 180-degree TX clock phase shift and internal packet generator features actually implemented in this driver?The help text advertises these features for users configuring the kernel, but looking at the driver code, there doesn't seem to be any implementation for them. Could this mislead users who expect these features to be available based on the documentation?
Yes, I'll fix it.
Quoted 18 lines
drivers/net/phy/dap8211r.c line 139
Quoted 13 lines
drivers/net/phy/dap8211r.c new file +13
-0+switch (phydev->interface) { +case PHY_INTERFACE_MODE_RGMII : +if (rx_internal_delay <0 ) + rx_internal_delay =0 ; + +if (tx_internal_delay <0 ) + tx_internal_delay =0 ; +break ; +case PHY_INTERFACE_MODE_RGMII_RXID : +if (rx_internal_delay <0 ) + rx_internal_delay =DAP8211R_DEFAULT_DEL_SEL ; + + tx_internal_delay =0 ;[Severity: Medium]
Is it intentional to silently drop an explicitly provided tx-internal-delay-ps property when usingPHY_INTERFACE_MODE_RGMII_RXID?
Quoted 7 lines
For
PHY_INTERFACE_MODE_RGMII, explicit delay properties are kept and applied. However, indap8211r_config_init(),tx_internal_delayis hardcoded to 0 for the rgmii-rxid mode.This might lead to unexpected configuration drops if a device tree specifies phy-mode = "rgmii-rxid" along with a tx-internal-delay-ps property, as the requested delay will be ignored without warning.
Yes, this is intentional.
The RGMII interface modes are defined as:RGMII_RXID: MAC provides TX delay, PHY provides RX delayRGMII_TXID: MAC provides RX delay, PHY provides TX delayRGMII_ID: Both delays are handled by the PHY
For RGMII_RXID, the TX delay is not expected to be provided via dts, so any TX delay value specified in DT for the PHY would be incorrect and is therefore ignored. The same applies to RGMII_TXID for RX delays.
I did this to keep the switch statement simpler. I thought it would be better than adding these features to its cases.
--
Best regards,
Artem