Skip to contentSkip to conversation

Add en8811h phy driver and devicetree binding doc

RFC PATCH In review Eric Woudstra 3 participants 5 messages Dec 16, 2023 – Dec 18, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add en8811h phy driver and devicetree binding doc

Add the Airoha EN8811H 2.5 Gigabit PHY.

The phy supports 100/1000/2500 Mbps with auto negotiotion only.

The driver uses two firmware files, which are added to linux-firmware already.

This patch series adds the driver and the devicetree binding documentation.

Eric Woudstra (2):
Add en8811h bindings documentation yaml
Add the Airoha EN8811H PHY driver

 .../bindings/net/airoha,en8811h.yaml          |   42 +
 drivers/net/phy/Kconfig                       |    5 +
 drivers/net/phy/Makefile                      |    1 +
 drivers/net/phy/air_en8811h.c                 | 1044 +++++++++++++++++
 4 files changed, 1092 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml
 create mode 100644 drivers/net/phy/air_en8811h.c
Signature · 1 line
2.42.1
#1 lore raw

RFC PATCH 1/2 Add en8811h bindings documentation yaml

The en8811h phy can be set with serdes polarity reversed on rx and/or tx.

---
 .../bindings/net/airoha,en8811h.yaml          | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml
Documentation/devicetree/bindings/net/airoha,en8811h.yaml new file +42 -0
new file mode 100644
index 000000000000..96febd8ed6fa
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/airoha,en8811h.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha EN8811H PHY
+
+maintainers:
+  - Someone <[email protected]>
+
+description:
+  Bindings for Airoha EN8811H PHY
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+properties:
+  airoha,rx-pol-reverse:
+    type: boolean
+    description:
+      Reverse rx polarity of SERDES.
+
+
+  airoha,tx-pol-reverse:
+    type: boolean
+    description:
+      Reverse tx polarity of SERDES.
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethphy1: ethernet-phy@1 {
+                reg = <1>;
+                airoha,rx-pol-reverse;
+        };
+    };
Signature · 1 line
2.42.1
#2 lore raw

Re: [PATCH RFC net-next 1/2] Add en8811h bindings documentation yaml

Quoted 32 lines · Eric Woudstra

The en8811h phy can be set with serdes polarity reversed on rx and/or tx.

---
 .../bindings/net/airoha,en8811h.yaml          | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml
Documentation/devicetree/bindings/net/airoha,en8811h.yaml new file +18 -0
new file mode 100644
index 000000000000..96febd8ed6fa
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/airoha,en8811h.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha EN8811H PHY
+
+maintainers:
+  - Someone <[email protected]>
+
+description:
+  Bindings for Airoha EN8811H PHY
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+properties:

Documentation/devicetree/bindings/net/airoha,en8811h.yaml line 28

Quoted 10 lines
Documentation/devicetree/bindings/net/airoha,en8811h.yaml new file +10 -0
+  airoha,rx-pol-reverse:
+    type: boolean
+    description:
+      Reverse rx polarity of SERDES.
+
+
+  airoha,tx-pol-reverse:
+    type: boolean
+    description:
+      Reverse tx polarity of SERDES.

Is this to deal with wiring up the SERDES backwards? Is there a more detailed description in the data sheet?

Andrew

#3 lore raw

Re: [PATCH RFC net-next 1/2] Add en8811h bindings documentation yaml

Quoted 6 lines

Is this to deal with wiring up the SERDES backwards? Is there a more detailed description in the data sheet?

Sadly, I have not received the datasheet. All comes from studying different versions of the driver.

On the BananiPi-R3 Mini the RX pair is reversed:

	phy14: ethernet-phy@14 {
		reg = <14>;
		interrupts-extended = <&pio 48 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&pio 49 GPIO_ACTIVE_LOW>;
		reset-assert-us = <10000>;
		reset-deassert-us = <20000>;
		phy-mode = "2500base-x";
		full-duplex;
		pause;
		airoha,rx-pol-reverse;

		leds {
			#address-cells = <1>;
			#size-cells = <0>;

			led@0 { /* en8811_a_gpio5 */
				reg = <0>;
				color = <LED_COLOR_ID_YELLOW>;
				function = LED_FUNCTION_LAN;
				function-enumerator = <1>;
				default-state = "keep";
				linux,default-trigger = "netdev";
			};
			led@1 { /* en8811_a_gpio4 */
				reg = <1>;
				color = <LED_COLOR_ID_GREEN>;
				function = LED_FUNCTION_LAN;
				function-enumerator = <2>;
				default-state = "keep";
				linux,default-trigger = "netdev";
			};
		};
	};