0600-3-6-dt-bindings-net-dsa-add-new-MT7531-binding-to-support-MT7531.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 <[email protected]>
  6. X-Patchwork-Id: 1206955
  7. X-Patchwork-Delegate: [email protected]
  8. Return-Path: <[email protected]>
  9. X-Original-To: [email protected]
  10. Delivered-To: [email protected]
  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. [email protected];
  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 [email protected]
  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 <[email protected]>;
  24. Tue, 10 Dec 2019 19:15:01 +1100 (AEDT)
  25. Received: ([email protected]) by vger.kernel.org via listexpand
  26. id S1727133AbfLJIPA (ORCPT
  27. <rfc822;[email protected]>);
  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;[email protected]>); 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 <[email protected]>)
  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 <[email protected]>
  51. To: <[email protected]>, <[email protected]>,
  52. <[email protected]>, <[email protected]>,
  53. <[email protected]>, <[email protected]>
  54. CC: <[email protected]>, <[email protected]>,
  55. <[email protected]>,
  56. <[email protected]>, <[email protected]>,
  57. <[email protected]>, <[email protected]>,
  58. <[email protected]>, Landen Chao <[email protected]>
  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: <[email protected]>
  65. References: <[email protected]>
  66. MIME-Version: 1.0
  67. X-MTK: N
  68. Sender: [email protected]
  69. Precedence: bulk
  70. List-ID: <netdev.vger.kernel.org>
  71. X-Mailing-List: [email protected]
  72. Add devicetree binding to support the compatible mt7531 switch as used
  73. in the MediaTek MT7531 switch.
  74. Signed-off-by: Sean Wang <[email protected]>
  75. Signed-off-by: Landen Chao <[email protected]>
  76. ---
  77. .../devicetree/bindings/net/dsa/mt7530.txt | 77 ++++++++++++++++++-
  78. 1 file changed, 74 insertions(+), 3 deletions(-)
  79. --- a/Documentation/devicetree/bindings/net/dsa/mt7530.txt
  80. +++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt
  81. @@ -5,6 +5,7 @@ Required properties:
  82. - compatible: may be compatible = "mediatek,mt7530"
  83. or compatible = "mediatek,mt7621"
  84. + or compatible = "mediatek,mt7531"
  85. - #address-cells: Must be 1.
  86. - #size-cells: Must be 0.
  87. - mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part
  88. @@ -32,10 +33,13 @@ Required properties for the child nodes
  89. - reg: Port address described must be 6 for CPU port and from 0 to 5 for
  90. user ports.
  91. -- phy-mode: String, must be either "trgmii" or "rgmii" for port labeled
  92. - "cpu".
  93. +- phy-mode: String, the follow value would be acceptable for port labeled "cpu"
  94. + If compatible mediatek,mt7530 or mediatek,mt7621 is set,
  95. + must be either "trgmii" or "rgmii"
  96. + If compatible mediatek,mt7531 is set,
  97. + must be either "sgmii", "1000base-x" or "2500base-x"
  98. -Port 5 of the switch is muxed between:
  99. +Port 5 of mt7530 and mt7621 switch is muxed between:
  100. 1. GMAC5: GMAC5 can interface with another external MAC or PHY.
  101. 2. PHY of port 0 or port 4: PHY interfaces with an external MAC like 2nd GMAC
  102. of the SOC. Used in many setups where port 0/4 becomes the WAN port.
  103. @@ -308,3 +312,70 @@ Example 3: MT7621: Port 5 is connected t
  104. };
  105. };
  106. };
  107. +
  108. +Example 4:
  109. +
  110. +&eth {
  111. + gmac0: mac@0 {
  112. + compatible = "mediatek,eth-mac";
  113. + reg = <0>;
  114. + phy-mode = "2500base-x";
  115. +
  116. + fixed-link {
  117. + speed = <1000>;
  118. + full-duplex;
  119. + pause;
  120. + };
  121. + };
  122. +
  123. + &mdio0 {
  124. + switch@0 {
  125. + compatible = "mediatek,mt7531";
  126. + reg = <0>;
  127. + reset-gpios = <&pio 54 0>;
  128. +
  129. + ports {
  130. + #address-cells = <1>;
  131. + #size-cells = <0>;
  132. + reg = <0>;
  133. +
  134. + port@0 {
  135. + reg = <0>;
  136. + label = "lan0";
  137. + };
  138. +
  139. + port@1 {
  140. + reg = <1>;
  141. + label = "lan1";
  142. + };
  143. +
  144. + port@2 {
  145. + reg = <2>;
  146. + label = "lan2";
  147. + };
  148. +
  149. + port@3 {
  150. + reg = <3>;
  151. + label = "lan3";
  152. + };
  153. +
  154. + port@4 {
  155. + reg = <4>;
  156. + label = "wan";
  157. + };
  158. +
  159. + port@6 {
  160. + reg = <6>;
  161. + label = "cpu";
  162. + ethernet = <&gmac0>;
  163. + phy-mode = "2500base-x";
  164. +
  165. + fixed-link {
  166. + speed = <1000>;
  167. + full-duplex;
  168. + pause;
  169. + };
  170. + };
  171. + };
  172. + };
  173. + };