mediatek: various fixes for v4.9
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.9 / 0091-dsa1.patch
1 From patchwork Wed Mar 29 09:38:19 2017
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [net-next,v3,1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding
6 From: sean.wang@mediatek.com
7 X-Patchwork-Id: 9651093
8 Message-Id: <1490780303-18598-2-git-send-email-sean.wang@mediatek.com>
9 To: <andrew@lunn.ch>, <f.fainelli@gmail.com>,
10 <vivien.didelot@savoirfairelinux.com>, <matthias.bgg@gmail.com>,
11 <robh+dt@kernel.org>, <mark.rutland@arm.com>
12 Cc: devicetree@vger.kernel.org, Landen.Chao@mediatek.com, keyhaede@gmail.com,
13 netdev@vger.kernel.org, sean.wang@mediatek.com,
14 linux-kernel@vger.kernel.org,
15 linux-mediatek@lists.infradead.org, objelf@gmail.com, davem@davemloft.net
16 Date: Wed, 29 Mar 2017 17:38:19 +0800
17
18 From: Sean Wang <sean.wang@mediatek.com>
19
20 Add device-tree binding for Mediatek MT7530 switch.
21
22 Cc: devicetree@vger.kernel.org
23 Signed-off-by: Sean Wang <sean.wang@mediatek.com>
24 Acked-by: Rob Herring <robh@kernel.org>
25 ---
26 .../devicetree/bindings/net/dsa/mt7530.txt | 92 ++++++++++++++++++++++
27 1 file changed, 92 insertions(+)
28 create mode 100644 Documentation/devicetree/bindings/net/dsa/mt7530.txt
29
30 diff --git a/Documentation/devicetree/bindings/net/dsa/mt7530.txt b/Documentation/devicetree/bindings/net/dsa/mt7530.txt
31 new file mode 100644
32 index 0000000..a9bc27b
33 --- /dev/null
34 +++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt
35 @@ -0,0 +1,92 @@
36 +Mediatek MT7530 Ethernet switch
37 +================================
38 +
39 +Required properties:
40 +
41 +- compatible: Must be compatible = "mediatek,mt7530";
42 +- #address-cells: Must be 1.
43 +- #size-cells: Must be 0.
44 +- mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part
45 + on multi-chip module belong to MT7623A has or the remotely standalone
46 + chip as the function MT7623N reference board provided for.
47 +- core-supply: Phandle to the regulator node necessary for the core power.
48 +- io-supply: Phandle to the regulator node necessary for the I/O power.
49 + See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt
50 + for details for the regulator setup on these boards.
51 +
52 +If the property mediatek,mcm isn't defined, following property is required
53 +
54 +- reset-gpios: Should be a gpio specifier for a reset line.
55 +
56 +Else, following properties are required
57 +
58 +- resets : Phandle pointing to the system reset controller with
59 + line index for the ethsys.
60 +- reset-names : Should be set to "mcm".
61 +
62 +Required properties for the child nodes within ports container:
63 +
64 +- reg: Port address described must be 6 for CPU port and from 0 to 5 for
65 + user ports.
66 +- phy-mode: String, must be either "trgmii" or "rgmii" for port labeled
67 + "cpu".
68 +
69 +See Documentation/devicetree/bindings/dsa/dsa.txt for a list of additional
70 +required, optional properties and how the integrated switch subnodes must
71 +be specified.
72 +
73 +Example:
74 +
75 + &mdio0 {
76 + switch@0 {
77 + compatible = "mediatek,mt7530";
78 + #address-cells = <1>;
79 + #size-cells = <0>;
80 + reg = <0>;
81 +
82 + core-supply = <&mt6323_vpa_reg>;
83 + io-supply = <&mt6323_vemc3v3_reg>;
84 + reset-gpios = <&pio 33 0>;
85 +
86 + ports {
87 + #address-cells = <1>;
88 + #size-cells = <0>;
89 + reg = <0>;
90 + port@0 {
91 + reg = <0>;
92 + label = "lan0";
93 + };
94 +
95 + port@1 {
96 + reg = <1>;
97 + label = "lan1";
98 + };
99 +
100 + port@2 {
101 + reg = <2>;
102 + label = "lan2";
103 + };
104 +
105 + port@3 {
106 + reg = <3>;
107 + label = "lan3";
108 + };
109 +
110 + port@4 {
111 + reg = <4>;
112 + label = "wan";
113 + };
114 +
115 + port@6 {
116 + reg = <6>;
117 + label = "cpu";
118 + ethernet = <&gmac0>;
119 + phy-mode = "trgmii";
120 + fixed-link {
121 + speed = <1000>;
122 + full-duplex;
123 + };
124 + };
125 + };
126 + };
127 + };