025-arm64-dts-allwinner-A64-Restore-EMAC-changes.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. From 94f442886711c6c4f4383a1c5a6994a788ba05d8 Mon Sep 17 00:00:00 2001
  2. From: Corentin Labbe <clabbe.montjoie@gmail.com>
  3. Date: Tue, 31 Oct 2017 09:19:13 +0100
  4. Subject: [PATCH] arm64: dts: allwinner: A64: Restore EMAC changes
  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 arm64 DT about dwmac-sun8i for A64
  9. This reverts commit 87e1f5e8bb4b ("arm64: dts: allwinner: 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. .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 16 ++++++++++++++++
  15. .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 15 +++++++++++++++
  16. arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 17 +++++++++++++++++
  17. .../dts/allwinner/sun50i-a64-sopine-baseboard.dts | 16 ++++++++++++++++
  18. arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 20 ++++++++++++++++++++
  19. 5 files changed, 84 insertions(+)
  20. --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
  21. +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
  22. @@ -51,6 +51,7 @@
  23. compatible = "sinovoip,bananapi-m64", "allwinner,sun50i-a64";
  24. aliases {
  25. + ethernet0 = &emac;
  26. serial0 = &uart0;
  27. serial1 = &uart1;
  28. };
  29. @@ -69,6 +70,14 @@
  30. status = "okay";
  31. };
  32. +&emac {
  33. + pinctrl-names = "default";
  34. + pinctrl-0 = <&rgmii_pins>;
  35. + phy-mode = "rgmii";
  36. + phy-handle = <&ext_rgmii_phy>;
  37. + status = "okay";
  38. +};
  39. +
  40. &i2c1 {
  41. pinctrl-names = "default";
  42. pinctrl-0 = <&i2c1_pins>;
  43. @@ -79,6 +88,13 @@
  44. bias-pull-up;
  45. };
  46. +&mdio {
  47. + ext_rgmii_phy: ethernet-phy@1 {
  48. + compatible = "ethernet-phy-ieee802.3-c22";
  49. + reg = <1>;
  50. + };
  51. +};
  52. +
  53. &mmc0 {
  54. pinctrl-names = "default";
  55. pinctrl-0 = <&mmc0_pins>;
  56. --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
  57. +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
  58. @@ -48,3 +48,18 @@
  59. /* TODO: Camera, touchscreen, etc. */
  60. };
  61. +
  62. +&emac {
  63. + pinctrl-names = "default";
  64. + pinctrl-0 = <&rgmii_pins>;
  65. + phy-mode = "rgmii";
  66. + phy-handle = <&ext_rgmii_phy>;
  67. + status = "okay";
  68. +};
  69. +
  70. +&mdio {
  71. + ext_rgmii_phy: ethernet-phy@1 {
  72. + compatible = "ethernet-phy-ieee802.3-c22";
  73. + reg = <1>;
  74. + };
  75. +};
  76. --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
  77. +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
  78. @@ -51,6 +51,7 @@
  79. compatible = "pine64,pine64", "allwinner,sun50i-a64";
  80. aliases {
  81. + ethernet0 = &emac;
  82. serial0 = &uart0;
  83. serial1 = &uart1;
  84. serial2 = &uart2;
  85. @@ -71,6 +72,15 @@
  86. status = "okay";
  87. };
  88. +&emac {
  89. + pinctrl-names = "default";
  90. + pinctrl-0 = <&rmii_pins>;
  91. + phy-mode = "rmii";
  92. + phy-handle = <&ext_rmii_phy1>;
  93. + status = "okay";
  94. +
  95. +};
  96. +
  97. &i2c1 {
  98. pinctrl-names = "default";
  99. pinctrl-0 = <&i2c1_pins>;
  100. @@ -81,6 +91,13 @@
  101. bias-pull-up;
  102. };
  103. +&mdio {
  104. + ext_rmii_phy1: ethernet-phy@1 {
  105. + compatible = "ethernet-phy-ieee802.3-c22";
  106. + reg = <1>;
  107. + };
  108. +};
  109. +
  110. &mmc0 {
  111. pinctrl-names = "default";
  112. pinctrl-0 = <&mmc0_pins>;
  113. --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
  114. +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
  115. @@ -53,6 +53,7 @@
  116. "allwinner,sun50i-a64";
  117. aliases {
  118. + ethernet0 = &emac;
  119. serial0 = &uart0;
  120. };
  121. @@ -76,6 +77,21 @@
  122. status = "okay";
  123. };
  124. +&emac {
  125. + pinctrl-names = "default";
  126. + pinctrl-0 = <&rgmii_pins>;
  127. + phy-mode = "rgmii";
  128. + phy-handle = <&ext_rgmii_phy>;
  129. + status = "okay";
  130. +};
  131. +
  132. +&mdio {
  133. + ext_rgmii_phy: ethernet-phy@1 {
  134. + compatible = "ethernet-phy-ieee802.3-c22";
  135. + reg = <1>;
  136. + };
  137. +};
  138. +
  139. &mmc2 {
  140. pinctrl-names = "default";
  141. pinctrl-0 = <&mmc2_pins>;
  142. --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
  143. +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
  144. @@ -450,6 +450,26 @@
  145. #size-cells = <0>;
  146. };
  147. + emac: ethernet@1c30000 {
  148. + compatible = "allwinner,sun50i-a64-emac";
  149. + syscon = <&syscon>;
  150. + reg = <0x01c30000 0x10000>;
  151. + interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
  152. + interrupt-names = "macirq";
  153. + resets = <&ccu RST_BUS_EMAC>;
  154. + reset-names = "stmmaceth";
  155. + clocks = <&ccu CLK_BUS_EMAC>;
  156. + clock-names = "stmmaceth";
  157. + status = "disabled";
  158. + #address-cells = <1>;
  159. + #size-cells = <0>;
  160. +
  161. + mdio: mdio {
  162. + #address-cells = <1>;
  163. + #size-cells = <0>;
  164. + };
  165. + };
  166. +
  167. gic: interrupt-controller@1c81000 {
  168. compatible = "arm,gic-400";
  169. reg = <0x01c81000 0x1000>,