ffc63dcc7cbdb39ae7b8c1e5e8d61a415e5caec1
[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 --- /dev/null
31 +++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt
32 @@ -0,0 +1,92 @@
33 +Mediatek MT7530 Ethernet switch
34 +================================
35 +
36 +Required properties:
37 +
38 +- compatible: Must be compatible = "mediatek,mt7530";
39 +- #address-cells: Must be 1.
40 +- #size-cells: Must be 0.
41 +- mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part
42 + on multi-chip module belong to MT7623A has or the remotely standalone
43 + chip as the function MT7623N reference board provided for.
44 +- core-supply: Phandle to the regulator node necessary for the core power.
45 +- io-supply: Phandle to the regulator node necessary for the I/O power.
46 + See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt
47 + for details for the regulator setup on these boards.
48 +
49 +If the property mediatek,mcm isn't defined, following property is required
50 +
51 +- reset-gpios: Should be a gpio specifier for a reset line.
52 +
53 +Else, following properties are required
54 +
55 +- resets : Phandle pointing to the system reset controller with
56 + line index for the ethsys.
57 +- reset-names : Should be set to "mcm".
58 +
59 +Required properties for the child nodes within ports container:
60 +
61 +- reg: Port address described must be 6 for CPU port and from 0 to 5 for
62 + user ports.
63 +- phy-mode: String, must be either "trgmii" or "rgmii" for port labeled
64 + "cpu".
65 +
66 +See Documentation/devicetree/bindings/dsa/dsa.txt for a list of additional
67 +required, optional properties and how the integrated switch subnodes must
68 +be specified.
69 +
70 +Example:
71 +
72 + &mdio0 {
73 + switch@0 {
74 + compatible = "mediatek,mt7530";
75 + #address-cells = <1>;
76 + #size-cells = <0>;
77 + reg = <0>;
78 +
79 + core-supply = <&mt6323_vpa_reg>;
80 + io-supply = <&mt6323_vemc3v3_reg>;
81 + reset-gpios = <&pio 33 0>;
82 +
83 + ports {
84 + #address-cells = <1>;
85 + #size-cells = <0>;
86 + reg = <0>;
87 + port@0 {
88 + reg = <0>;
89 + label = "lan0";
90 + };
91 +
92 + port@1 {
93 + reg = <1>;
94 + label = "lan1";
95 + };
96 +
97 + port@2 {
98 + reg = <2>;
99 + label = "lan2";
100 + };
101 +
102 + port@3 {
103 + reg = <3>;
104 + label = "lan3";
105 + };
106 +
107 + port@4 {
108 + reg = <4>;
109 + label = "wan";
110 + };
111 +
112 + port@6 {
113 + reg = <6>;
114 + label = "cpu";
115 + ethernet = <&gmac0>;
116 + phy-mode = "trgmii";
117 + fixed-link {
118 + speed = <1000>;
119 + full-duplex;
120 + };
121 + };
122 + };
123 + };
124 + };