Skip to contentSkip to conversation

Add OF bindings to Micrel ksz9021 PHY

PATCH New Sean Cross 2 participants 3 messages Aug 21, 2013

Subsystems (4)
lore
Share & tools
lore

Sean Cross

author
#0 lore raw

PATCH v6 1/1 Add OF bindings to Micrel ksz9021 PHY

Some boards require custom parameters be passed to the Micrel PHY. Allow these boards to specify custom timing parameters in the device tree node.

Changes since v5:
- Add -ps suffix to OF keys, indicating picoseconds
- Minor formatting changes to bring in line with coding style

Changes since v4:
- Add an example of parameters on an mdio bus
- Specify values in picoseconds rather than as register values

v4 was accidentally unchanged from v3

Changes since v2:
- limited the scope to just ksz9021 rather than all PHYs

Changes since v1:
- removed redefinition of registers and addresses

Sean Cross (1):
net/phy: micrel: Add OF configuration support for ksz9021

 .../devicetree/bindings/net/micrel-ksz9021.txt     |   49 ++++++++++
 drivers/net/phy/micrel.c                           |  103 +++++++++++++++++++-
 2 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/micrel-ksz9021.txt
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v6 1/1 net/phy: micrel: Add OF configuration support for ksz9021

Some boards require custom PHY configuration, for example due to trace length differences. Add the ability to configure these registers in order to get the PHY to function on boards that need it.

Because PHYs are auto-detected based on MDIO device IDs, allow PHY configuration to be specified in the parent Ethernet device node if no PHY device node is present.

---
 .../devicetree/bindings/net/micrel-ksz9021.txt     |   49 ++++++++++
 drivers/net/phy/micrel.c                           |  103 +++++++++++++++++++-
 2 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/micrel-ksz9021.txt
Documentation/devicetree/bindings/net/micrel-ksz9021.txt new file +49 -0
new file mode 100644
index 0000000..997a63f
@@ -0,0 +1,49 @@
+Micrel KSZ9021 Gigabit Ethernet PHY
+
+Some boards require special tuning values, particularly when it comes to
+clock delays.  You can specify clock delay values by adding
+micrel-specific properties to an Ethernet OF device node.
+
+All skew control options are specified in picoseconds.  The minimum
+value is 0, and the maximum value is 3000.
+
+Optional properties:
+ - rxc-skew-ps : Skew control of RXC pad
+ - rxdv-skew-ps : Skew control of RX CTL pad
+ - txc-skew-ps : Skew control of TXC pad
+ - txen-skew-ps : Skew control of TX_CTL pad
+ - rxd0-skew-ps : Skew control of RX data 0 pad
+ - rxd1-skew-ps : Skew control of RX data 1 pad
+ - rxd2-skew-ps : Skew control of RX data 2 pad
+ - rxd3-skew-ps : Skew control of RX data 3 pad
+ - txd0-skew-ps : Skew control of TX data 0 pad
+ - txd1-skew-ps : Skew control of TX data 1 pad
+ - txd2-skew-ps : Skew control of TX data 2 pad
+ - txd3-skew-ps : Skew control of TX data 3 pad
+
+Examples:
+
+	/* Attach to an Ethernet device with autodetected PHY */
+	&enet {
+		rxc-skew-ps = <3000>;
+		rxdv-skew-ps = <0>;
+		txc-skew-ps = <3000>;
+		txen-skew-ps = <0>;
+		status = "okay";
+	};
+
+	/* Attach to an explicitly-specified PHY */
+	mdio {
+		phy0: ethernet-phy@0 {
+			rxc-skew-ps = <3000>;
+			rxdv-skew-ps = <0>;
+			txc-skew-ps = <3000>;
+			txen-skew-ps = <0>;
+			reg = <0>;
+		};
+	};
+	ethernet@70000 {
+		status = "okay";
+		phy = <&phy0>;
+		phy-mode = "rgmii-id";
+	};
drivers/net/phy/micrel.c +102 -1

133 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer Applied
#2 lore raw

Re: [PATCH v6] net/phy: micrel: Add OF configuration support for ksz9021

From: Sean Cross <[email protected]>
Date: Wed, 21 Aug 2013 01:46:12 +0000

Quoted 9 lines

Some boards require custom PHY configuration, for example due to trace length differences. Add the ability to configure these registers in order to get the PHY to function on boards that need it.

Because PHYs are auto-detected based on MDIO device IDs, allow PHY configuration to be specified in the parent Ethernet device node if no PHY device node is present.

Applied to net-next, thanks.