sun8i-r16-bananapi-m2m.dts 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. /*
  2. * Copyright (c) 2017 Free Electrons <[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-a33.dtsi"
  44. #include <dt-bindings/gpio/gpio.h>
  45. / {
  46. model = "BananaPi M2 Magic";
  47. compatible = "sinovoip,bananapi-m2m", "allwinner,sun8i-a33";
  48. aliases {
  49. i2c0 = &i2c0;
  50. i2c1 = &i2c1;
  51. i2c2 = &i2c2;
  52. serial0 = &uart0;
  53. serial1 = &uart1;
  54. };
  55. chosen {
  56. stdout-path = "serial0:115200n8";
  57. };
  58. leds {
  59. compatible = "gpio-leds";
  60. led-0 {
  61. label = "bpi-m2m:blue:usr";
  62. gpios = <&pio 2 7 GPIO_ACTIVE_LOW>;
  63. };
  64. led-1 {
  65. label = "bpi-m2m:green:usr";
  66. gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>;
  67. };
  68. led-2 {
  69. label = "bpi-m2m:red:power";
  70. gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
  71. default-state = "on";
  72. };
  73. };
  74. reg_vcc5v0: vcc5v0 {
  75. compatible = "regulator-fixed";
  76. regulator-name = "vcc5v0";
  77. regulator-min-microvolt = <5000000>;
  78. regulator-max-microvolt = <5000000>;
  79. };
  80. wifi_pwrseq: wifi_pwrseq {
  81. compatible = "mmc-pwrseq-simple";
  82. reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
  83. clocks = <&rtc CLK_OSC32K_FANOUT>;
  84. clock-names = "ext_clock";
  85. };
  86. };
  87. &codec {
  88. status = "okay";
  89. };
  90. &cpu0 {
  91. cpu-supply = <&reg_dcdc3>;
  92. };
  93. &cpu0_opp_table {
  94. opp-1104000000 {
  95. opp-hz = /bits/ 64 <1104000000>;
  96. opp-microvolt = <1320000>;
  97. clock-latency-ns = <244144>; /* 8 32k periods */
  98. };
  99. opp-1200000000 {
  100. opp-hz = /bits/ 64 <1200000000>;
  101. opp-microvolt = <1320000>;
  102. clock-latency-ns = <244144>; /* 8 32k periods */
  103. };
  104. };
  105. &dai {
  106. status = "okay";
  107. };
  108. &ehci0 {
  109. status = "okay";
  110. };
  111. &mmc0 {
  112. vmmc-supply = <&reg_dcdc1>;
  113. bus-width = <4>;
  114. cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
  115. status = "okay";
  116. };
  117. &mmc1 {
  118. pinctrl-names = "default";
  119. pinctrl-0 = <&mmc1_pg_pins>;
  120. vmmc-supply = <&reg_aldo1>;
  121. mmc-pwrseq = <&wifi_pwrseq>;
  122. bus-width = <4>;
  123. non-removable;
  124. status = "okay";
  125. };
  126. &mmc2 {
  127. pinctrl-names = "default";
  128. pinctrl-0 = <&mmc2_8bit_pins>;
  129. vmmc-supply = <&reg_dcdc1>;
  130. bus-width = <8>;
  131. non-removable;
  132. cap-mmc-hw-reset;
  133. status = "okay";
  134. };
  135. &ohci0 {
  136. status = "okay";
  137. };
  138. &r_rsb {
  139. status = "okay";
  140. axp22x: pmic@3a3 {
  141. compatible = "x-powers,axp223";
  142. reg = <0x3a3>;
  143. interrupt-parent = <&r_intc>;
  144. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  145. eldoin-supply = <&reg_dcdc1>;
  146. x-powers,drive-vbus-en;
  147. };
  148. };
  149. #include "axp223.dtsi"
  150. &ac_power_supply {
  151. status = "okay";
  152. };
  153. &reg_aldo1 {
  154. regulator-always-on;
  155. regulator-min-microvolt = <3000000>;
  156. regulator-max-microvolt = <3000000>;
  157. regulator-name = "vcc-io";
  158. };
  159. &reg_aldo2 {
  160. regulator-always-on;
  161. regulator-min-microvolt = <2500000>;
  162. regulator-max-microvolt = <2500000>;
  163. regulator-name = "vdd-dll";
  164. };
  165. &reg_aldo3 {
  166. regulator-always-on;
  167. regulator-min-microvolt = <3000000>;
  168. regulator-max-microvolt = <3000000>;
  169. regulator-name = "avcc";
  170. };
  171. &reg_dc1sw {
  172. regulator-name = "vcc-lcd";
  173. };
  174. &reg_dc5ldo {
  175. regulator-always-on;
  176. regulator-min-microvolt = <900000>;
  177. regulator-max-microvolt = <1400000>;
  178. regulator-name = "vdd-cpus";
  179. };
  180. &reg_dcdc1 {
  181. regulator-always-on;
  182. regulator-min-microvolt = <3000000>;
  183. regulator-max-microvolt = <3000000>;
  184. regulator-name = "vcc-3v0";
  185. };
  186. &reg_dcdc2 {
  187. regulator-always-on;
  188. regulator-min-microvolt = <900000>;
  189. regulator-max-microvolt = <1400000>;
  190. regulator-name = "vdd-sys";
  191. };
  192. &reg_dcdc3 {
  193. regulator-always-on;
  194. regulator-min-microvolt = <900000>;
  195. regulator-max-microvolt = <1400000>;
  196. regulator-name = "vdd-cpu";
  197. };
  198. &reg_dcdc5 {
  199. regulator-always-on;
  200. regulator-min-microvolt = <1500000>;
  201. regulator-max-microvolt = <1500000>;
  202. regulator-name = "vcc-dram";
  203. };
  204. /*
  205. * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same
  206. * time, with the two being in sync. Since this is not really
  207. * supported right now, just use the two as always on, and we will fix
  208. * it later.
  209. */
  210. &reg_dldo1 {
  211. regulator-always-on;
  212. regulator-min-microvolt = <3300000>;
  213. regulator-max-microvolt = <3300000>;
  214. regulator-name = "vcc-wifi0";
  215. };
  216. &reg_dldo2 {
  217. regulator-always-on;
  218. regulator-min-microvolt = <3300000>;
  219. regulator-max-microvolt = <3300000>;
  220. regulator-name = "vcc-wifi1";
  221. };
  222. &reg_drivevbus {
  223. regulator-name = "usb0-vbus";
  224. status = "okay";
  225. };
  226. &reg_rtc_ldo {
  227. regulator-name = "vcc-rtc";
  228. };
  229. &sound {
  230. status = "okay";
  231. };
  232. &uart0 {
  233. pinctrl-names = "default";
  234. pinctrl-0 = <&uart0_pb_pins>;
  235. status = "okay";
  236. };
  237. &uart1 {
  238. pinctrl-names = "default";
  239. pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
  240. uart-has-rtscts;
  241. status = "okay";
  242. bluetooth {
  243. compatible = "brcm,bcm43438-bt";
  244. clocks = <&rtc CLK_OSC32K_FANOUT>;
  245. clock-names = "lpo";
  246. vbat-supply = <&reg_dldo1>;
  247. vddio-supply = <&reg_aldo3>;
  248. device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
  249. host-wakeup-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
  250. shutdown-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
  251. };
  252. };
  253. &usb_otg {
  254. dr_mode = "otg";
  255. status = "okay";
  256. };
  257. &usb_power_supply {
  258. status = "okay";
  259. };
  260. &usbphy {
  261. usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
  262. usb0_vbus_power-supply = <&usb_power_supply>;
  263. usb0_vbus-supply = <&reg_drivevbus>;
  264. usb1_vbus-supply = <&reg_vcc5v0>;
  265. status = "okay";
  266. };