sun8i-r40-bananapi-m2-ultra.dts 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. /*
  2. * Copyright (C) 2017 Chen-Yu Tsai <[email protected]>
  3. * Copyright (C) 2017 Icenowy Zheng <[email protected]>
  4. *
  5. * This file is dual-licensed: you can use it either under the terms
  6. * of the GPL or the X11 license, at your option. Note that this dual
  7. * licensing only applies to this file, and not this project as a
  8. * whole.
  9. *
  10. * a) This file is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This file is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * Or, alternatively,
  21. *
  22. * b) Permission is hereby granted, free of charge, to any person
  23. * obtaining a copy of this software and associated documentation
  24. * files (the "Software"), to deal in the Software without
  25. * restriction, including without limitation the rights to use,
  26. * copy, modify, merge, publish, distribute, sublicense, and/or
  27. * sell copies of the Software, and to permit persons to whom the
  28. * Software is furnished to do so, subject to the following
  29. * conditions:
  30. *
  31. * The above copyright notice and this permission notice shall be
  32. * included in all copies or substantial portions of the Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  35. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  36. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  37. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  38. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  39. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  40. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  41. * OTHER DEALINGS IN THE SOFTWARE.
  42. */
  43. /dts-v1/;
  44. #include "sun8i-r40.dtsi"
  45. #include "sun8i-r40-cpu-opp.dtsi"
  46. #include <dt-bindings/gpio/gpio.h>
  47. / {
  48. model = "Banana Pi BPI-M2-Ultra";
  49. compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40";
  50. aliases {
  51. ethernet0 = &gmac;
  52. serial0 = &uart0;
  53. };
  54. chosen {
  55. stdout-path = "serial0:115200n8";
  56. };
  57. connector {
  58. compatible = "hdmi-connector";
  59. type = "a";
  60. port {
  61. hdmi_con_in: endpoint {
  62. remote-endpoint = <&hdmi_out_con>;
  63. };
  64. };
  65. };
  66. leds {
  67. compatible = "gpio-leds";
  68. pwr-led {
  69. label = "bananapi:red:pwr";
  70. gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
  71. default-state = "on";
  72. };
  73. user-led-green {
  74. label = "bananapi:green:user";
  75. gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
  76. };
  77. user-led-blue {
  78. label = "bananapi:blue:user";
  79. gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>;
  80. };
  81. };
  82. reg_vcc5v0: vcc5v0 {
  83. compatible = "regulator-fixed";
  84. regulator-name = "vcc5v0";
  85. regulator-min-microvolt = <5000000>;
  86. regulator-max-microvolt = <5000000>;
  87. gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
  88. enable-active-high;
  89. };
  90. wifi_pwrseq: wifi_pwrseq {
  91. compatible = "mmc-pwrseq-simple";
  92. reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
  93. clocks = <&ccu CLK_OUTA>;
  94. clock-names = "ext_clock";
  95. };
  96. };
  97. &ahci {
  98. ahci-supply = <&reg_dldo4>;
  99. phy-supply = <&reg_eldo3>;
  100. status = "okay";
  101. };
  102. &cpu0 {
  103. cpu-supply = <&reg_dcdc2>;
  104. };
  105. &de {
  106. status = "okay";
  107. };
  108. &ehci1 {
  109. status = "okay";
  110. };
  111. &ehci2 {
  112. status = "okay";
  113. };
  114. &gmac {
  115. pinctrl-names = "default";
  116. pinctrl-0 = <&gmac_rgmii_pins>;
  117. phy-handle = <&phy1>;
  118. phy-mode = "rgmii-id";
  119. phy-supply = <&reg_dc1sw>;
  120. status = "okay";
  121. };
  122. &gmac_mdio {
  123. phy1: ethernet-phy@1 {
  124. compatible = "ethernet-phy-ieee802.3-c22";
  125. reg = <1>;
  126. };
  127. };
  128. &hdmi {
  129. status = "okay";
  130. };
  131. &hdmi_out {
  132. hdmi_out_con: endpoint {
  133. remote-endpoint = <&hdmi_con_in>;
  134. };
  135. };
  136. &i2c0 {
  137. status = "okay";
  138. axp22x: pmic@34 {
  139. compatible = "x-powers,axp221";
  140. reg = <0x34>;
  141. interrupt-parent = <&nmi_intc>;
  142. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  143. };
  144. };
  145. #include "axp22x.dtsi"
  146. &ir0 {
  147. status = "okay";
  148. };
  149. &mmc0 {
  150. vmmc-supply = <&reg_dcdc1>;
  151. bus-width = <4>;
  152. cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
  153. status = "okay";
  154. };
  155. &mmc1 {
  156. pinctrl-names = "default";
  157. pinctrl-0 = <&mmc1_pg_pins>;
  158. vmmc-supply = <&reg_dldo2>;
  159. vqmmc-supply = <&reg_dldo1>;
  160. mmc-pwrseq = <&wifi_pwrseq>;
  161. bus-width = <4>;
  162. non-removable;
  163. status = "okay";
  164. };
  165. &mmc2 {
  166. vmmc-supply = <&reg_dcdc1>;
  167. vqmmc-supply = <&reg_dcdc1>;
  168. bus-width = <8>;
  169. non-removable;
  170. status = "okay";
  171. };
  172. &ohci1 {
  173. status = "okay";
  174. };
  175. &ohci2 {
  176. status = "okay";
  177. };
  178. &pio {
  179. pinctrl-names = "default";
  180. pinctrl-0 = <&clk_out_a_pin>;
  181. vcc-pa-supply = <&reg_aldo2>;
  182. vcc-pc-supply = <&reg_dcdc1>;
  183. vcc-pd-supply = <&reg_dcdc1>;
  184. vcc-pe-supply = <&reg_eldo1>;
  185. vcc-pf-supply = <&reg_dcdc1>;
  186. vcc-pg-supply = <&reg_dldo1>;
  187. };
  188. &reg_aldo2 {
  189. regulator-min-microvolt = <2500000>;
  190. regulator-max-microvolt = <2500000>;
  191. regulator-name = "vcc-pa";
  192. };
  193. &reg_aldo3 {
  194. regulator-always-on;
  195. regulator-min-microvolt = <2700000>;
  196. regulator-max-microvolt = <3300000>;
  197. regulator-name = "avcc";
  198. };
  199. &reg_dc1sw {
  200. regulator-min-microvolt = <3300000>;
  201. regulator-max-microvolt = <3300000>;
  202. regulator-name = "vcc-gmac-phy";
  203. };
  204. &reg_dcdc1 {
  205. regulator-always-on;
  206. regulator-min-microvolt = <3300000>;
  207. regulator-max-microvolt = <3300000>;
  208. regulator-name = "vcc-3v3";
  209. };
  210. &reg_dcdc2 {
  211. regulator-always-on;
  212. regulator-min-microvolt = <1000000>;
  213. regulator-max-microvolt = <1300000>;
  214. regulator-name = "vdd-cpu";
  215. };
  216. &reg_dcdc3 {
  217. regulator-always-on;
  218. regulator-min-microvolt = <1000000>;
  219. regulator-max-microvolt = <1300000>;
  220. regulator-name = "vdd-sys";
  221. };
  222. &reg_dcdc5 {
  223. regulator-always-on;
  224. regulator-min-microvolt = <1500000>;
  225. regulator-max-microvolt = <1500000>;
  226. regulator-name = "vcc-dram";
  227. };
  228. &reg_dldo1 {
  229. regulator-min-microvolt = <1800000>;
  230. regulator-max-microvolt = <3300000>;
  231. regulator-name = "vcc-wifi-io";
  232. };
  233. /*
  234. * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
  235. * time, with the two being in sync, to be able to meet maximum power
  236. * consumption during transmits. Since this is not really supported
  237. * right now, just use the two as always on, and we will fix it later.
  238. */
  239. &reg_dldo2 {
  240. regulator-always-on;
  241. regulator-min-microvolt = <3300000>;
  242. regulator-max-microvolt = <3300000>;
  243. regulator-name = "vcc-wifi";
  244. };
  245. &reg_dldo3 {
  246. regulator-always-on;
  247. regulator-min-microvolt = <3300000>;
  248. regulator-max-microvolt = <3300000>;
  249. regulator-name = "vcc-wifi-2";
  250. };
  251. &reg_dldo4 {
  252. regulator-min-microvolt = <2500000>;
  253. regulator-max-microvolt = <2500000>;
  254. regulator-name = "vdd2v5-sata";
  255. };
  256. &reg_eldo3 {
  257. regulator-min-microvolt = <1200000>;
  258. regulator-max-microvolt = <1200000>;
  259. regulator-name = "vdd1v2-sata";
  260. };
  261. &tcon_tv0 {
  262. status = "okay";
  263. };
  264. &uart0 {
  265. pinctrl-names = "default";
  266. pinctrl-0 = <&uart0_pb_pins>;
  267. status = "okay";
  268. };
  269. &uart3 {
  270. pinctrl-names = "default";
  271. pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
  272. uart-has-rtscts;
  273. status = "okay";
  274. bluetooth {
  275. compatible = "brcm,bcm43438-bt";
  276. clocks = <&ccu CLK_OUTA>;
  277. clock-names = "lpo";
  278. vbat-supply = <&reg_dldo2>;
  279. vddio-supply = <&reg_dldo1>;
  280. device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
  281. /* TODO host wake line connected to PMIC GPIO pins */
  282. shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
  283. max-speed = <1500000>;
  284. };
  285. };
  286. &usbphy {
  287. usb1_vbus-supply = <&reg_vcc5v0>;
  288. usb2_vbus-supply = <&reg_vcc5v0>;
  289. status = "okay";
  290. };