1
0

061-arm-dts-sun50i-support-for-nanopi-neo-plus2-board.patch 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. From 54cc3330c2334a0cea8cafc105a29c5d67f9fd32 Mon Sep 17 00:00:00 2001
  2. From: Antony Antony <antony@phenome.org>
  3. Date: Fri, 2 Mar 2018 10:50:48 +0100
  4. Subject: [PATCH] arm64: allwinner: h5: add NanoPi NEO Plus2 DT support
  5. Add initial DT for NanoPi NEO Plus2 by FriendlyARM
  6. - Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU
  7. - 1 GB DDR3 RAM
  8. - 8GB eMMC flash (Samsung KLM8G1WEPD-B031)
  9. - micro SD card slot
  10. - Gigabit Ethernet (external RTL8211E-VB-CG chip)
  11. - 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module)
  12. - 2x USB 2.0 host ports & 2x USB via headers
  13. Kernel 4.15 commit d7341305863b
  14. Kernel 4.16 commit 27d7f9297027
  15. Signed-off-by: Antony Antony <antony@phenome.org>
  16. --- a/arch/arm64/boot/dts/allwinner/Makefile
  17. +++ b/arch/arm64/boot/dts/allwinner/Makefile
  18. @@ -9,6 +9,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-or
  19. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
  20. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
  21. dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
  22. +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
  23. always := $(dtb-y)
  24. subdir-y := $(dts-dirs)
  25. --- /dev/null
  26. +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
  27. @@ -0,0 +1,210 @@
  28. +/*
  29. + * Copyright (C) 2017 Antony Antony <antony@phenome.org>
  30. + * Copyright (C) 2016 ARM Ltd.
  31. + *
  32. + * This file is dual-licensed: you can use it either under the terms
  33. + * of the GPL or the X11 license, at your option. Note that this dual
  34. + * licensing only applies to this file, and not this project as a
  35. + * whole.
  36. + *
  37. + * a) This file is free software; you can redistribute it and/or
  38. + * modify it under the terms of the GNU General Public License as
  39. + * published by the Free Software Foundation; either version 2 of the
  40. + * License, or (at your option) any later version.
  41. + *
  42. + * This file is distributed in the hope that it will be useful,
  43. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  44. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  45. + * GNU General Public License for more details.
  46. + *
  47. + * Or, alternatively,
  48. + *
  49. + * b) Permission is hereby granted, free of charge, to any person
  50. + * obtaining a copy of this software and associated documentation
  51. + * files (the "Software"), to deal in the Software without
  52. + * restriction, including without limitation the rights to use,
  53. + * copy, modify, merge, publish, distribute, sublicense, and/or
  54. + * sell copies of the Software, and to permit persons to whom the
  55. + * Software is furnished to do so, subject to the following
  56. + * conditions:
  57. + *
  58. + * The above copyright notice and this permission notice shall be
  59. + * included in all copies or substantial portions of the Software.
  60. + *
  61. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  62. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  63. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  64. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  65. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  66. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  67. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  68. + * OTHER DEALINGS IN THE SOFTWARE.
  69. + */
  70. +
  71. +/dts-v1/;
  72. +#include "sun50i-h5.dtsi"
  73. +
  74. +#include <dt-bindings/gpio/gpio.h>
  75. +#include <dt-bindings/input/input.h>
  76. +#include <dt-bindings/pinctrl/sun4i-a10.h>
  77. +
  78. +/ {
  79. + model = "FriendlyARM NanoPi NEO Plus2";
  80. + compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
  81. +
  82. + aliases {
  83. + ethernet0 = &emac;
  84. + serial0 = &uart0;
  85. + };
  86. +
  87. + chosen {
  88. + stdout-path = "serial0:115200n8";
  89. + };
  90. +
  91. + leds {
  92. + compatible = "gpio-leds";
  93. +
  94. + pwr {
  95. + label = "nanopi:green:pwr";
  96. + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
  97. + default-state = "on";
  98. + };
  99. +
  100. + status {
  101. + label = "nanopi:red:status";
  102. + gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
  103. + };
  104. + };
  105. +
  106. + reg_gmac_3v3: gmac-3v3 {
  107. + compatible = "regulator-fixed";
  108. + pinctrl-names = "default";
  109. + regulator-name = "gmac-3v3";
  110. + regulator-min-microvolt = <3300000>;
  111. + regulator-max-microvolt = <3300000>;
  112. + startup-delay-us = <100000>;
  113. + enable-active-high;
  114. + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
  115. + };
  116. +
  117. + reg_vcc3v3: vcc3v3 {
  118. + compatible = "regulator-fixed";
  119. + regulator-name = "vcc3v3";
  120. + regulator-min-microvolt = <3300000>;
  121. + regulator-max-microvolt = <3300000>;
  122. + };
  123. +
  124. + vdd_cpux: gpio-regulator {
  125. + compatible = "regulator-gpio";
  126. + pinctrl-names = "default";
  127. + regulator-name = "vdd-cpux";
  128. + regulator-type = "voltage";
  129. + regulator-boot-on;
  130. + regulator-always-on;
  131. + regulator-min-microvolt = <1100000>;
  132. + regulator-max-microvolt = <1300000>;
  133. + regulator-ramp-delay = <50>; /* 4ms */
  134. + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
  135. + gpios-states = <0x1>;
  136. + states = <1100000 0x0
  137. + 1300000 0x1>;
  138. + };
  139. +
  140. + wifi_pwrseq: wifi_pwrseq {
  141. + compatible = "mmc-pwrseq-simple";
  142. + pinctrl-names = "default";
  143. + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
  144. + post-power-on-delay-ms = <200>;
  145. + };
  146. +};
  147. +
  148. +&codec {
  149. + allwinner,audio-routing =
  150. + "Line Out", "LINEOUT",
  151. + "MIC1", "Mic",
  152. + "Mic", "MBIAS";
  153. + status = "okay";
  154. +};
  155. +
  156. +&ehci0 {
  157. + status = "okay";
  158. +};
  159. +
  160. +&ehci3 {
  161. + status = "okay";
  162. +};
  163. +
  164. +&emac {
  165. + pinctrl-names = "default";
  166. + pinctrl-0 = <&emac_rgmii_pins>;
  167. + phy-supply = <&reg_gmac_3v3>;
  168. + phy-handle = <&ext_rgmii_phy>;
  169. + phy-mode = "rgmii";
  170. + status = "okay";
  171. +};
  172. +
  173. +&external_mdio {
  174. + ext_rgmii_phy: ethernet-phy@7 {
  175. + compatible = "ethernet-phy-ieee802.3-c22";
  176. + reg = <7>;
  177. + };
  178. +};
  179. +
  180. +&mmc0 {
  181. + pinctrl-names = "default";
  182. + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
  183. + vmmc-supply = <&reg_vcc3v3>;
  184. + bus-width = <4>;
  185. + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  186. + status = "okay";
  187. +};
  188. +
  189. +&mmc1 {
  190. + pinctrl-names = "default";
  191. + pinctrl-0 = <&mmc1_pins_a>;
  192. + vmmc-supply = <&reg_vcc3v3>;
  193. + vqmmc-supply = <&reg_vcc3v3>;
  194. + mmc-pwrseq = <&wifi_pwrseq>;
  195. + bus-width = <4>;
  196. + non-removable;
  197. + status = "okay";
  198. +
  199. + brcmf: wifi@1 {
  200. + reg = <1>;
  201. + compatible = "brcm,bcm4329-fmac";
  202. + };
  203. +};
  204. +
  205. +&mmc2 {
  206. + pinctrl-names = "default";
  207. + pinctrl-0 = <&mmc2_8bit_pins>;
  208. + vmmc-supply = <&reg_vcc3v3>;
  209. + bus-width = <8>;
  210. + non-removable;
  211. + cap-mmc-hw-reset;
  212. + status = "okay";
  213. +};
  214. +
  215. +&ohci0 {
  216. + status = "okay";
  217. +};
  218. +
  219. +&ohci3 {
  220. + status = "okay";
  221. +};
  222. +
  223. +&uart0 {
  224. + pinctrl-names = "default";
  225. + pinctrl-0 = <&uart0_pins_a>;
  226. + status = "okay";
  227. +};
  228. +
  229. +&usb_otg {
  230. + dr_mode = "host";
  231. + status = "okay";
  232. +};
  233. +
  234. +&usbphy {
  235. + /* USB Type-A ports' VBUS is always on */
  236. + status = "okay";
  237. +};