sun8i-v40-bananapi-m2-berry.dts 7.0 KB

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