3ca12b9172ae8ca622f50d690f4aa23fa5f2c253
[oweals/openwrt.git] /
1 From patchwork Tue Dec 10 08:14:39 2019
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Landen Chao <landen.chao@mediatek.com>
6 X-Patchwork-Id: 1206955
7 X-Patchwork-Delegate: davem@davemloft.net
8 Return-Path: <netdev-owner@vger.kernel.org>
9 X-Original-To: patchwork-incoming-netdev@ozlabs.org
10 Delivered-To: patchwork-incoming-netdev@ozlabs.org
11 Authentication-Results: ozlabs.org; spf=none (no SPF record)
12  smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67;
13  helo=vger.kernel.org;
14  envelope-from=netdev-owner@vger.kernel.org;
15  receiver=<UNKNOWN>)
16 Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none)
17  header.from=mediatek.com
18 Authentication-Results: ozlabs.org; dkim=pass (1024-bit key;
19  unprotected) header.d=mediatek.com header.i=@mediatek.com
20  header.b="SuczJHZp"; dkim-atps=neutral
21 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
22  by ozlabs.org (Postfix) with ESMTP id 47XCXj3BBNz9sPh
23  for <patchwork-incoming-netdev@ozlabs.org>;
24  Tue, 10 Dec 2019 19:15:01 +1100 (AEDT)
25 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
26  id S1727133AbfLJIPA (ORCPT
27  <rfc822;patchwork-incoming-netdev@ozlabs.org>);
28  Tue, 10 Dec 2019 03:15:00 -0500
29 Received: from mailgw02.mediatek.com ([210.61.82.184]:45567 "EHLO
30  mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by
31  vger.kernel.org with ESMTP id S1727022AbfLJIO7 (ORCPT
32  <rfc822;netdev@vger.kernel.org>); Tue, 10 Dec 2019 03:14:59 -0500
33 X-UUID: a1d9a42928d44d63b201d5ad84c05baa-20191210
34 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
35  d=mediatek.com; s=dk; 
36  h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From;
37  bh=KJqQ2m7z9H4vre+SZyxgKEGRWb9Edp5pJlYnepJNMyM=; 
38  b=SuczJHZpeY7vF8UsCGorYUAcT2lEUX2E0ciiyQBS1rDLPzTYnufK8OXyAw5Uq8U1m72TGWYCaq1o0VWtI1meJpEmCL2TVK/d+Y+IaacHlO716BmX77+0MU0crczE8zx1Nz2pNh+GicsB6AoC9qbBU+p5egbKDMBhpRaGQNAeBww=;
39 X-UUID: a1d9a42928d44d63b201d5ad84c05baa-20191210
40 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by
41  mailgw02.mediatek.com (envelope-from <landen.chao@mediatek.com>)
42  (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS)
43  with ESMTP id 297826603; Tue, 10 Dec 2019 16:14:47 +0800
44 Received: from mtkcas08.mediatek.inc (172.21.101.126) by
45  mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server
46  (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:38 +0800
47 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc
48  (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via
49  Frontend Transport; Tue, 10 Dec 2019 16:14:26 +0800
50 From: Landen Chao <landen.chao@mediatek.com>
51 To: <andrew@lunn.ch>, <f.fainelli@gmail.com>,
52  <vivien.didelot@savoirfairelinux.com>, <matthias.bgg@gmail.com>,
53  <robh+dt@kernel.org>, <mark.rutland@arm.com>
54 CC: <devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
55  <linux-kernel@vger.kernel.org>,
56  <linux-mediatek@lists.infradead.org>, <davem@davemloft.net>,
57  <sean.wang@mediatek.com>, <opensource@vdorst.com>,
58  <frank-w@public-files.de>, Landen Chao <landen.chao@mediatek.com>
59 Subject: [PATCH net-next 3/6] dt-bindings: net: dsa: add new MT7531 binding
60  to support MT7531
61 Date: Tue, 10 Dec 2019 16:14:39 +0800
62 Message-ID: <1c382fd916b66bfe3ce8ef18c12f954dbcbddbbc.1575914275.git.landen.chao@mediatek.com>
63 X-Mailer: git-send-email 2.18.0
64 In-Reply-To: <cover.1575914275.git.landen.chao@mediatek.com>
65 References: <cover.1575914275.git.landen.chao@mediatek.com>
66 MIME-Version: 1.0
67 X-MTK: N
68 Sender: netdev-owner@vger.kernel.org
69 Precedence: bulk
70 List-ID: <netdev.vger.kernel.org>
71 X-Mailing-List: netdev@vger.kernel.org
72
73 Add devicetree binding to support the compatible mt7531 switch as used
74 in the MediaTek MT7531 switch.
75
76 Signed-off-by: Sean Wang <sean.wang@mediatek.com>
77 Signed-off-by: Landen Chao <landen.chao@mediatek.com>
78 ---
79  .../devicetree/bindings/net/dsa/mt7530.txt    | 77 ++++++++++++++++++-
80  1 file changed, 74 insertions(+), 3 deletions(-)
81
82 diff --git a/Documentation/devicetree/bindings/net/dsa/mt7530.txt b/Documentation/devicetree/bindings/net/dsa/mt7530.txt\r
83 index c5ed5d25f642..dc226a4e402a 100644\r
84 --- a/Documentation/devicetree/bindings/net/dsa/mt7530.txt\r
85 +++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt\r
86 @@ -5,6 +5,7 @@ Required properties:\r
87  \r
88  - compatible: may be compatible = "mediatek,mt7530"\r
89         or compatible = "mediatek,mt7621"\r
90 +       or compatible = "mediatek,mt7531"\r
91  - #address-cells: Must be 1.\r
92  - #size-cells: Must be 0.\r
93  - mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part\r
94 @@ -32,10 +33,13 @@ Required properties for the child nodes within ports container:\r
95  \r
96  - reg: Port address described must be 6 for CPU port and from 0 to 5 for\r
97         user ports.\r
98 -- phy-mode: String, must be either "trgmii" or "rgmii" for port labeled\r
99 -        "cpu".\r
100 +- phy-mode: String, the follow value would be acceptable for port labeled "cpu"\r
101 +       If compatible mediatek,mt7530 or mediatek,mt7621 is set,\r
102 +       must be either "trgmii" or "rgmii"\r
103 +       If compatible mediatek,mt7531 is set,\r
104 +       must be either "sgmii", "1000base-x" or "2500base-x"\r
105  \r
106 -Port 5 of the switch is muxed between:\r
107 +Port 5 of mt7530 and mt7621 switch is muxed between:\r
108  1. GMAC5: GMAC5 can interface with another external MAC or PHY.\r
109  2. PHY of port 0 or port 4: PHY interfaces with an external MAC like 2nd GMAC\r
110     of the SOC. Used in many setups where port 0/4 becomes the WAN port.\r
111 @@ -308,3 +312,70 @@ Example 3: MT7621: Port 5 is connected to external PHY: Port 5 -> external PHY.\r
112                 };\r
113         };\r
114  };\r
115 +\r
116 +Example 4:\r
117 +\r
118 +&eth {\r
119 +       gmac0: mac@0 {\r
120 +               compatible = "mediatek,eth-mac";\r
121 +               reg = <0>;\r
122 +               phy-mode = "2500base-x";\r
123 +\r
124 +               fixed-link {\r
125 +                       speed = <1000>;\r
126 +                       full-duplex;\r
127 +                       pause;\r
128 +               };\r
129 +       };\r
130 +\r
131 +       &mdio0 {\r
132 +               switch@0 {\r
133 +                       compatible = "mediatek,mt7531";\r
134 +                       reg = <0>;\r
135 +                       reset-gpios = <&pio 54 0>;\r
136 +\r
137 +                       ports {\r
138 +                               #address-cells = <1>;\r
139 +                               #size-cells = <0>;\r
140 +                               reg = <0>;\r
141 +\r
142 +                               port@0 {\r
143 +                                       reg = <0>;\r
144 +                                       label = "lan0";\r
145 +                               };\r
146 +\r
147 +                               port@1 {\r
148 +                                       reg = <1>;\r
149 +                                       label = "lan1";\r
150 +                               };\r
151 +\r
152 +                               port@2 {\r
153 +                                       reg = <2>;\r
154 +                                       label = "lan2";\r
155 +                               };\r
156 +\r
157 +                               port@3 {\r
158 +                                       reg = <3>;\r
159 +                                       label = "lan3";\r
160 +                               };\r
161 +\r
162 +                               port@4 {\r
163 +                                       reg = <4>;\r
164 +                                       label = "wan";\r
165 +                               };\r
166 +\r
167 +                               port@6 {\r
168 +                                       reg = <6>;\r
169 +                                       label = "cpu";\r
170 +                                       ethernet = <&gmac0>;\r
171 +                                       phy-mode = "2500base-x";\r
172 +\r
173 +                                       fixed-link {\r
174 +                                               speed = <1000>;\r
175 +                                               full-duplex;\r
176 +                                               pause;\r
177 +                                       };\r
178 +                               };\r
179 +                       };\r
180 +               };\r
181 +       };\r