220-ARM-dts-orange-pi-zero-plus.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. From 0e2da1a792a21e3933e17727920ed3c35a3ba57a Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Sun, 11 Mar 2018 15:13:30 +0100
  4. Subject: [PATCH] arm64: allwinner: H5: Add Xunlong Orange Pi Zero Plus
  5. The Xunlong Orange Pi Zero Plus is single board computer.
  6. - H5 Quad-core 64-bit Cortex-A53
  7. - 512MB DDR3
  8. - microSD slot
  9. - Debug TTL UART
  10. - 1000M/100M/10M Ethernet RJ45
  11. - Realtek RTL8189FTV
  12. - Spi flash (2MB)
  13. - One USB 2.0 HOST, One USB 2.0 OTG
  14. This is based on a patch from armbian:
  15. https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/sunxi-add-orangepi-zero-plus.patch
  16. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  17. ---
  18. arch/arm64/boot/dts/allwinner/Makefile | 1 +
  19. .../dts/allwinner/sun50i-h5-orangepi-zero-plus.dts | 147 +++++++++++++++++++++
  20. 2 files changed, 148 insertions(+)
  21. create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
  22. --- a/arch/arm64/boot/dts/allwinner/Makefile
  23. +++ b/arch/arm64/boot/dts/allwinner/Makefile
  24. @@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-p
  25. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
  26. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
  27. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
  28. +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
  29. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
  30. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
  31. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
  32. --- /dev/null
  33. +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
  34. @@ -0,0 +1,147 @@
  35. +/*
  36. + * Copyright (C) 2016 ARM Ltd.
  37. + * Copyright (C) 2018 Hauke Mehrtens <hauke@hauke-m.de>
  38. + *
  39. + * SPDX-License-Identifier: (GPL-2.0+ OR X11)
  40. + */
  41. +
  42. +/dts-v1/;
  43. +#include "sun50i-h5.dtsi"
  44. +
  45. +#include <dt-bindings/gpio/gpio.h>
  46. +#include <dt-bindings/input/input.h>
  47. +#include <dt-bindings/pinctrl/sun4i-a10.h>
  48. +
  49. +/ {
  50. + model = "Xunlong Orange Pi Zero Plus";
  51. + compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5";
  52. +
  53. + reg_vcc3v3: vcc3v3 {
  54. + compatible = "regulator-fixed";
  55. + regulator-name = "vcc3v3";
  56. + regulator-min-microvolt = <3300000>;
  57. + regulator-max-microvolt = <3300000>;
  58. + };
  59. +
  60. + aliases {
  61. + ethernet0 = &emac;
  62. + ethernet1 = &rtl8189ftv;
  63. + serial0 = &uart0;
  64. + };
  65. +
  66. + chosen {
  67. + stdout-path = "serial0:115200n8";
  68. + };
  69. +
  70. + leds {
  71. + compatible = "gpio-leds";
  72. +
  73. + pwr {
  74. + label = "orangepi:green:pwr";
  75. + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
  76. + default-state = "on";
  77. + };
  78. +
  79. + status {
  80. + label = "orangepi:red:status";
  81. + gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
  82. + };
  83. + };
  84. +
  85. + reg_gmac_3v3: gmac-3v3 {
  86. + compatible = "regulator-fixed";
  87. + regulator-name = "gmac-3v3";
  88. + regulator-min-microvolt = <3300000>;
  89. + regulator-max-microvolt = <3300000>;
  90. + startup-delay-us = <100000>;
  91. + enable-active-high;
  92. + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
  93. + };
  94. +};
  95. +
  96. +&ehci0 {
  97. + status = "okay";
  98. +};
  99. +
  100. +&ehci1 {
  101. + status = "okay";
  102. +};
  103. +
  104. +&emac {
  105. + pinctrl-names = "default";
  106. + pinctrl-0 = <&emac_rgmii_pins>;
  107. + phy-supply = <&reg_gmac_3v3>;
  108. + phy-handle = <&ext_rgmii_phy>;
  109. + phy-mode = "rgmii";
  110. + status = "okay";
  111. +};
  112. +
  113. +&external_mdio {
  114. + ext_rgmii_phy: ethernet-phy@1 {
  115. + compatible = "ethernet-phy-ieee802.3-c22";
  116. + reg = <1>;
  117. + };
  118. +};
  119. +
  120. +&mmc0 {
  121. + pinctrl-names = "default";
  122. + pinctrl-0 = <&mmc0_pins_a>;
  123. + vmmc-supply = <&reg_vcc3v3>;
  124. + bus-width = <4>;
  125. + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  126. + status = "okay";
  127. +};
  128. +
  129. +&mmc1 {
  130. + pinctrl-names = "default";
  131. + pinctrl-0 = <&mmc1_pins_a>;
  132. + vmmc-supply = <&reg_vcc3v3>;
  133. + bus-width = <4>;
  134. + non-removable;
  135. + status = "okay";
  136. +
  137. + /*
  138. + * Explicitly define the sdio device, so that we can add an ethernet
  139. + * alias for it (which e.g. makes u-boot set a mac-address).
  140. + */
  141. + rtl8189ftv: sdio_wifi@1 {
  142. + reg = <1>;
  143. + };
  144. +};
  145. +
  146. +&spi0 {
  147. + status = "okay";
  148. +
  149. + flash@0 {
  150. + #address-cells = <1>;
  151. + #size-cells = <1>;
  152. + compatible = "mxicy,mx25l1606e", "winbond,w25q128";
  153. + reg = <0>;
  154. + spi-max-frequency = <40000000>;
  155. + };
  156. +};
  157. +
  158. +&ohci0 {
  159. + status = "okay";
  160. +};
  161. +
  162. +&ohci1 {
  163. + status = "okay";
  164. +};
  165. +
  166. +&uart0 {
  167. + pinctrl-names = "default";
  168. + pinctrl-0 = <&uart0_pins_a>;
  169. + status = "okay";
  170. +};
  171. +
  172. +&usb_otg {
  173. + dr_mode = "peripheral";
  174. + status = "okay";
  175. +};
  176. +
  177. +&usbphy {
  178. + /* USB Type-A ports' VBUS is always on */
  179. + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
  180. + status = "okay";
  181. +};