4a511a28669afbdbba9db9cb65e56cd079ee63f9
[openwrt/openwrt.git] / target / linux / gemini / patches-4.14 / 0034-ARM-dts-Add-ethernet-to-a-bunch-of-platforms.patch
1 From 6d5af7093aea4f18e040e73db2ad99aaa0c0f77e Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Sun, 19 Nov 2017 11:04:23 +0100
4 Subject: [PATCH] ARM: dts: Add ethernet to a bunch of platforms
5
6 These platforms have the PHY defined already so we just
7 need to add a single device node to each of them to activate
8 the ethernet device.
9
10 The PHY skew/delay settings for pin control is known from a
11 few vendor trees and old OpenWRT patch sets.
12
13 This is a modified version of upstream commit
14 95220046a62c00b5afb1aa7c1971989d427db977,
15 just dropping the NAS4220B changes.
16
17 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
18 ---
19 arch/arm/boot/dts/gemini-dlink-dns-313.dts | 62 ++++++++++++++++++++++++++++++
20 arch/arm/boot/dts/gemini-wbd222.dts | 7 ++++
21 2 files changed, 69 insertions(+)
22
23 diff --git a/arch/arm/boot/dts/gemini-dlink-dns-313.dts b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
24 index 685719a0b8c0..df46375457b6 100644
25 --- a/arch/arm/boot/dts/gemini-dlink-dns-313.dts
26 +++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
27 @@ -215,6 +215,56 @@
28 groups = "gpio1dgrp";
29 };
30 };
31 + pinctrl-gmii {
32 + mux {
33 + function = "gmii";
34 + groups = "gmii_gmac0_grp";
35 + };
36 + /*
37 + * In the vendor Linux tree, these values are set for the C3
38 + * version of the SL3512 ASIC with the comment "benson suggest"
39 + */
40 + conf0 {
41 + pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV";
42 + skew-delay = <0>;
43 + };
44 + conf1 {
45 + pins = "T8 GMAC0 RXC";
46 + skew-delay = <10>;
47 + };
48 + conf2 {
49 + pins = "T11 GMAC1 RXC";
50 + skew-delay = <15>;
51 + };
52 + conf3 {
53 + pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN";
54 + skew-delay = <7>;
55 + };
56 + conf4 {
57 + pins = "V7 GMAC0 TXC", "P10 GMAC1 TXC";
58 + skew-delay = <10>;
59 + };
60 + conf5 {
61 + /* The data lines all have default skew */
62 + pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
63 + "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
64 + "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
65 + "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
66 + "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
67 + "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
68 + skew-delay = <7>;
69 + };
70 + conf6 {
71 + pins = "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
72 + "R7 GMAC0 TXD2", "P7 GMAC0 TXD3";
73 + skew-delay = <5>;
74 + };
75 + /* Set up drive strength on GMAC0 to 16 mA */
76 + conf7 {
77 + groups = "gmii_gmac0_grp";
78 + drive-strength = <16>;
79 + };
80 + };
81 };
82 };
83
84 @@ -235,6 +285,18 @@
85 pinctrl-0 = <&gpio1_default_pins>;
86 };
87
88 + ethernet@60000000 {
89 + status = "okay";
90 +
91 + ethernet-port@0 {
92 + phy-mode = "rgmii";
93 + phy-handle = <&phy0>;
94 + };
95 + ethernet-port@1 {
96 + /* Not used in this platform */
97 + };
98 + };
99 +
100 ata@63000000 {
101 status = "okay";
102 };
103 diff --git a/arch/arm/boot/dts/gemini-wbd222.dts b/arch/arm/boot/dts/gemini-wbd222.dts
104 index 0678d3beb51d..820978d20166 100644
105 --- a/arch/arm/boot/dts/gemini-wbd222.dts
106 +++ b/arch/arm/boot/dts/gemini-wbd222.dts
107 @@ -136,6 +136,13 @@
108 "gpio0bgrp";
109 };
110 };
111 + pinctrl-gmii {
112 + /* This platform use both the ethernet ports */
113 + mux {
114 + function = "gmii";
115 + groups = "gmii_gmac0_grp", "gmii_gmac1_grp";
116 + };
117 + };
118 };
119 };
120
121 --
122 2.14.3
123