[net-next PATCH v1 1/2] net: dt-bindings: add RGMII TX delay configuration to meson8b-dwmac

Martin Blumenstingl martin.blumenstingl at googlemail.com
Thu Nov 24 06:34:16 PST 2016


This allows configuring the RGMII TX clock delay. This clock is
generated by the Meson 8b / GXBB DWMAC glue. The configuration depends
on the actual hardware (no delay may be needed due to the design of the
actual circuit, the PHY might add this delay, etc.).
The configuration values are provided as preprocessor macros to make the
devicetree files easier to read.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 Documentation/devicetree/bindings/net/meson-dwmac.txt | 11 +++++++++++
 include/dt-bindings/net/dwmac-meson8b.h               | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 include/dt-bindings/net/dwmac-meson8b.h

diff --git a/Documentation/devicetree/bindings/net/meson-dwmac.txt b/Documentation/devicetree/bindings/net/meson-dwmac.txt
index 89e62dd..fe526d0 100644
--- a/Documentation/devicetree/bindings/net/meson-dwmac.txt
+++ b/Documentation/devicetree/bindings/net/meson-dwmac.txt
@@ -25,6 +25,17 @@ Required properties on Meson8b and newer:
 		- "clkin0" - first parent clock of the internal mux
 		- "clkin1" - second parent clock of the internal mux
 
+Optional properties on Meson8b and newer:
+- amlogic,tx-delay:	The internal RGMII TX clock delay configuration.
+			Defaults to DWMAC_MESON8B_TXDLY_QUARTER_CYCLE
+			when not given. All possible values are defined
+			as preprocessor macro in
+			<dt-bindings/net/dwmac-meson8b.h>.
+			The delay is specified as divider for the
+			internal clock (RGMII typically uses a 125MHz
+			clock clock (= 8ns per cycle), so setting
+			DWMAC_MESON8B_TXDLY_QUARTER_CYCLE
+			results in a TX delay of 8ns/4 = 2ns.
 
 Example for Meson6:
 
diff --git a/include/dt-bindings/net/dwmac-meson8b.h b/include/dt-bindings/net/dwmac-meson8b.h
new file mode 100644
index 0000000..4fc149e
--- /dev/null
+++ b/include/dt-bindings/net/dwmac-meson8b.h
@@ -0,0 +1,18 @@
+/*
+ * Devicetree constants for the Amlogic Meson8b and GXBB DWMAC glue layer
+ *
+ * Copyright (C) 2016 Martin Blumenstingl <martin.blumenstingl at googlemail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* TX delay configuration */
+#define DWMAC_MESON8B_TXDLY_OFF				0x0
+#define DWMAC_MESON8B_TXDLY_QUARTER_CYCLE		0x1
+#define DWMAC_MESON8B_TXDLY_HALF_CYCLE			0x2
+#define DWMAC_MESON8B_TXDLY_THREE_QUARTER_CYCLE		0x3
-- 
2.10.2




More information about the linux-amlogic mailing list