020-ARM-dts-sunxi-Restore-EMAC-changes-boards.patch 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. From 4904337fe34fa7fc529d6f4d9ee8b96fe7db310a Mon Sep 17 00:00:00 2001
  2. From: Corentin Labbe <clabbe.montjoie@gmail.com>
  3. Date: Tue, 31 Oct 2017 09:19:12 +0100
  4. Subject: [PATCH] ARM: dts: sunxi: Restore EMAC changes (boards)
  5. The original dwmac-sun8i DT bindings have some issue on how to handle
  6. integrated PHY and was reverted in last RC of 4.13.
  7. But now we have a solution so we need to get back that was reverted.
  8. This patch restore all boards DT about dwmac-sun8i
  9. This reverts partially commit fe45174b72ae ("arm: dts: sunxi: Revert EMAC changes")
  10. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
  11. Acked-by: Florian Fainelli <f.fainelli@gmail.com>
  12. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  13. ---
  14. arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 9 +++++++
  15. arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts | 19 +++++++++++++++
  16. arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 29 +++++++++++++++++++++++
  17. arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 7 ++++++
  18. arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 +++++++
  19. arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 +++++++
  20. arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts | 5 ++++
  21. arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8 +++++++
  22. arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 22 +++++++++++++++++
  23. arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts | 16 +++++++++++++
  24. 10 files changed, 131 insertions(+)
  25. --- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
  26. +++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
  27. @@ -56,6 +56,8 @@
  28. aliases {
  29. serial0 = &uart0;
  30. + /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
  31. + ethernet0 = &emac;
  32. ethernet1 = &xr819;
  33. };
  34. @@ -102,6 +104,13 @@
  35. status = "okay";
  36. };
  37. +&emac {
  38. + phy-handle = <&int_mii_phy>;
  39. + phy-mode = "mii";
  40. + allwinner,leds-active-low;
  41. + status = "okay";
  42. +};
  43. +
  44. &mmc0 {
  45. pinctrl-names = "default";
  46. pinctrl-0 = <&mmc0_pins_a>;
  47. --- a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
  48. +++ b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
  49. @@ -52,6 +52,7 @@
  50. compatible = "sinovoip,bpi-m2-plus", "allwinner,sun8i-h3";
  51. aliases {
  52. + ethernet0 = &emac;
  53. serial0 = &uart0;
  54. serial1 = &uart1;
  55. };
  56. @@ -114,6 +115,24 @@
  57. status = "okay";
  58. };
  59. +&emac {
  60. + pinctrl-names = "default";
  61. + pinctrl-0 = <&emac_rgmii_pins>;
  62. + phy-supply = <&reg_gmac_3v3>;
  63. + phy-handle = <&ext_rgmii_phy>;
  64. + phy-mode = "rgmii";
  65. +
  66. + allwinner,leds-active-low;
  67. + status = "okay";
  68. +};
  69. +
  70. +&external_mdio {
  71. + ext_rgmii_phy: ethernet-phy@1 {
  72. + compatible = "ethernet-phy-ieee802.3-c22";
  73. + reg = <0>;
  74. + };
  75. +};
  76. +
  77. &ir {
  78. pinctrl-names = "default";
  79. pinctrl-0 = <&ir_pins_a>;
  80. --- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
  81. +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
  82. @@ -45,6 +45,16 @@
  83. / {
  84. model = "FriendlyArm NanoPi M1 Plus";
  85. compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
  86. +
  87. + reg_gmac_3v3: gmac-3v3 {
  88. + compatible = "regulator-fixed";
  89. + regulator-name = "gmac-3v3";
  90. + regulator-min-microvolt = <3300000>;
  91. + regulator-max-microvolt = <3300000>;
  92. + startup-delay-us = <100000>;
  93. + enable-active-high;
  94. + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
  95. + };
  96. };
  97. &ehci1 {
  98. @@ -55,6 +65,25 @@
  99. status = "okay";
  100. };
  101. +&emac {
  102. + pinctrl-names = "default";
  103. + pinctrl-0 = <&emac_rgmii_pins>;
  104. + phy-supply = <&reg_gmac_3v3>;
  105. + phy-handle = <&ext_rgmii_phy>;
  106. + phy-mode = "rgmii";
  107. +
  108. + allwinner,leds-active-low;
  109. +
  110. + status = "okay";
  111. +};
  112. +
  113. +&external_mdio {
  114. + ext_rgmii_phy: ethernet-phy@1 {
  115. + compatible = "ethernet-phy-ieee802.3-c22";
  116. + reg = <7>;
  117. + };
  118. +};
  119. +
  120. &ohci1 {
  121. status = "okay";
  122. };
  123. --- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
  124. +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
  125. @@ -46,3 +46,10 @@
  126. model = "FriendlyARM NanoPi NEO";
  127. compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
  128. };
  129. +
  130. +&emac {
  131. + phy-handle = <&int_mii_phy>;
  132. + phy-mode = "mii";
  133. + allwinner,leds-active-low;
  134. + status = "okay";
  135. +};
  136. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
  137. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
  138. @@ -54,6 +54,7 @@
  139. aliases {
  140. serial0 = &uart0;
  141. /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
  142. + ethernet0 = &emac;
  143. ethernet1 = &rtl8189;
  144. };
  145. @@ -117,6 +118,13 @@
  146. status = "okay";
  147. };
  148. +&emac {
  149. + phy-handle = <&int_mii_phy>;
  150. + phy-mode = "mii";
  151. + allwinner,leds-active-low;
  152. + status = "okay";
  153. +};
  154. +
  155. &ir {
  156. pinctrl-names = "default";
  157. pinctrl-0 = <&ir_pins_a>;
  158. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
  159. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
  160. @@ -52,6 +52,7 @@
  161. compatible = "xunlong,orangepi-one", "allwinner,sun8i-h3";
  162. aliases {
  163. + ethernet0 = &emac;
  164. serial0 = &uart0;
  165. };
  166. @@ -97,6 +98,13 @@
  167. status = "okay";
  168. };
  169. +&emac {
  170. + phy-handle = <&int_mii_phy>;
  171. + phy-mode = "mii";
  172. + allwinner,leds-active-low;
  173. + status = "okay";
  174. +};
  175. +
  176. &mmc0 {
  177. pinctrl-names = "default";
  178. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
  179. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts
  180. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts
  181. @@ -53,6 +53,11 @@
  182. };
  183. };
  184. +&emac {
  185. + /* LEDs changed to active high on the plus */
  186. + /delete-property/ allwinner,leds-active-low;
  187. +};
  188. +
  189. &mmc1 {
  190. pinctrl-names = "default";
  191. pinctrl-0 = <&mmc1_pins_a>;
  192. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
  193. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
  194. @@ -52,6 +52,7 @@
  195. compatible = "xunlong,orangepi-pc", "allwinner,sun8i-h3";
  196. aliases {
  197. + ethernet0 = &emac;
  198. serial0 = &uart0;
  199. };
  200. @@ -113,6 +114,13 @@
  201. status = "okay";
  202. };
  203. +&emac {
  204. + phy-handle = <&int_mii_phy>;
  205. + phy-mode = "mii";
  206. + allwinner,leds-active-low;
  207. + status = "okay";
  208. +};
  209. +
  210. &ir {
  211. pinctrl-names = "default";
  212. pinctrl-0 = <&ir_pins_a>;
  213. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
  214. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
  215. @@ -47,6 +47,10 @@
  216. model = "Xunlong Orange Pi Plus / Plus 2";
  217. compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3";
  218. + aliases {
  219. + ethernet0 = &emac;
  220. + };
  221. +
  222. reg_gmac_3v3: gmac-3v3 {
  223. compatible = "regulator-fixed";
  224. regulator-name = "gmac-3v3";
  225. @@ -74,6 +78,24 @@
  226. status = "okay";
  227. };
  228. +&emac {
  229. + pinctrl-names = "default";
  230. + pinctrl-0 = <&emac_rgmii_pins>;
  231. + phy-supply = <&reg_gmac_3v3>;
  232. + phy-handle = <&ext_rgmii_phy>;
  233. + phy-mode = "rgmii";
  234. +
  235. + allwinner,leds-active-low;
  236. + status = "okay";
  237. +};
  238. +
  239. +&external_mdio {
  240. + ext_rgmii_phy: ethernet-phy@1 {
  241. + compatible = "ethernet-phy-ieee802.3-c22";
  242. + reg = <0>;
  243. + };
  244. +};
  245. +
  246. &mmc2 {
  247. pinctrl-names = "default";
  248. pinctrl-0 = <&mmc2_8bit_pins>;
  249. --- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts
  250. +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts
  251. @@ -61,3 +61,19 @@
  252. gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
  253. };
  254. };
  255. +
  256. +&emac {
  257. + pinctrl-names = "default";
  258. + pinctrl-0 = <&emac_rgmii_pins>;
  259. + phy-supply = <&reg_gmac_3v3>;
  260. + phy-handle = <&ext_rgmii_phy>;
  261. + phy-mode = "rgmii";
  262. + status = "okay";
  263. +};
  264. +
  265. +&external_mdio {
  266. + ext_rgmii_phy: ethernet-phy@1 {
  267. + compatible = "ethernet-phy-ieee802.3-c22";
  268. + reg = <1>;
  269. + };
  270. +};