sun8i-a83t-bananapi-m3.dts 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /*
  2. * Copyright 2017 Chen-Yu Tsai
  3. *
  4. * Chen-Yu Tsai <[email protected]>
  5. *
  6. * This file is dual-licensed: you can use it either under the terms
  7. * of the GPL or the X11 license, at your option. Note that this dual
  8. * licensing only applies to this file, and not this project as a
  9. * whole.
  10. *
  11. * a) This file is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This file is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * Or, alternatively,
  22. *
  23. * b) Permission is hereby granted, free of charge, to any person
  24. * obtaining a copy of this software and associated documentation
  25. * files (the "Software"), to deal in the Software without
  26. * restriction, including without limitation the rights to use,
  27. * copy, modify, merge, publish, distribute, sublicense, and/or
  28. * sell copies of the Software, and to permit persons to whom the
  29. * Software is furnished to do so, subject to the following
  30. * conditions:
  31. *
  32. * The above copyright notice and this permission notice shall be
  33. * included in all copies or substantial portions of the Software.
  34. *
  35. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  36. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  37. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  38. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  39. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  40. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  41. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  42. * OTHER DEALINGS IN THE SOFTWARE.
  43. */
  44. /dts-v1/;
  45. #include "sun8i-a83t.dtsi"
  46. #include <dt-bindings/gpio/gpio.h>
  47. / {
  48. model = "Banana Pi BPI-M3";
  49. compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t";
  50. aliases {
  51. ethernet0 = &emac;
  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. led-0 {
  69. label = "bananapi-m3:blue:usr";
  70. gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
  71. };
  72. led-1 {
  73. label = "bananapi-m3:green:usr";
  74. gpios = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
  75. };
  76. };
  77. reg_usb1_vbus: reg-usb1-vbus {
  78. compatible = "regulator-fixed";
  79. regulator-name = "usb1-vbus";
  80. regulator-min-microvolt = <5000000>;
  81. regulator-max-microvolt = <5000000>;
  82. regulator-boot-on;
  83. enable-active-high;
  84. gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
  85. };
  86. wifi_pwrseq: wifi_pwrseq {
  87. compatible = "mmc-pwrseq-simple";
  88. clocks = <&ac100_rtc 1>;
  89. clock-names = "ext_clock";
  90. /* The WiFi low power clock must be 32768 Hz */
  91. assigned-clocks = <&ac100_rtc 1>;
  92. assigned-clock-rates = <32768>;
  93. /* enables internal regulator and de-asserts reset */
  94. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
  95. };
  96. };
  97. &cpu0 {
  98. cpu-supply = <&reg_dcdc2>;
  99. };
  100. &cpu100 {
  101. cpu-supply = <&reg_dcdc3>;
  102. };
  103. &de {
  104. status = "okay";
  105. };
  106. &ehci0 {
  107. /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
  108. status = "okay";
  109. /* TODO GL830 USB-to-SATA bridge downstream w/ GPIO power controls */
  110. };
  111. &emac {
  112. pinctrl-names = "default";
  113. pinctrl-0 = <&emac_rgmii_pins>;
  114. phy-supply = <&reg_sw>;
  115. phy-handle = <&rgmii_phy>;
  116. phy-mode = "rgmii-id";
  117. allwinner,rx-delay-ps = <700>;
  118. allwinner,tx-delay-ps = <700>;
  119. status = "okay";
  120. };
  121. &hdmi {
  122. status = "okay";
  123. };
  124. &hdmi_out {
  125. hdmi_out_con: endpoint {
  126. remote-endpoint = <&hdmi_con_in>;
  127. };
  128. };
  129. &mdio {
  130. rgmii_phy: ethernet-phy@1 {
  131. compatible = "ethernet-phy-ieee802.3-c22";
  132. reg = <1>;
  133. };
  134. };
  135. &mmc0 {
  136. pinctrl-names = "default";
  137. pinctrl-0 = <&mmc0_pins>;
  138. vmmc-supply = <&reg_dcdc1>;
  139. bus-width = <4>;
  140. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  141. status = "okay";
  142. };
  143. &mmc1 {
  144. vmmc-supply = <&reg_dldo1>;
  145. vqmmc-supply = <&reg_dldo1>;
  146. mmc-pwrseq = <&wifi_pwrseq>;
  147. bus-width = <4>;
  148. non-removable;
  149. status = "okay";
  150. brcmf: wifi@1 {
  151. reg = <1>;
  152. compatible = "brcm,bcm4329-fmac";
  153. interrupt-parent = <&r_pio>;
  154. interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;
  155. interrupt-names = "host-wake";
  156. };
  157. };
  158. &mmc2 {
  159. pinctrl-names = "default";
  160. pinctrl-0 = <&mmc2_8bit_emmc_pins>;
  161. vmmc-supply = <&reg_dcdc1>;
  162. vqmmc-supply = <&reg_dcdc1>;
  163. bus-width = <8>;
  164. non-removable;
  165. cap-mmc-hw-reset;
  166. status = "okay";
  167. };
  168. &r_cir {
  169. clock-frequency = <3000000>;
  170. status = "okay";
  171. };
  172. &r_rsb {
  173. status = "okay";
  174. axp81x: pmic@3a3 {
  175. compatible = "x-powers,axp813";
  176. reg = <0x3a3>;
  177. interrupt-parent = <&r_intc>;
  178. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  179. eldoin-supply = <&reg_dcdc1>;
  180. fldoin-supply = <&reg_dcdc5>;
  181. swin-supply = <&reg_dcdc1>;
  182. x-powers,drive-vbus-en;
  183. };
  184. ac100: codec@e89 {
  185. compatible = "x-powers,ac100";
  186. reg = <0xe89>;
  187. ac100_codec: codec {
  188. compatible = "x-powers,ac100-codec";
  189. interrupt-parent = <&r_pio>;
  190. interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
  191. #clock-cells = <0>;
  192. clock-output-names = "4M_adda";
  193. };
  194. ac100_rtc: rtc {
  195. compatible = "x-powers,ac100-rtc";
  196. interrupt-parent = <&r_intc>;
  197. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  198. clocks = <&ac100_codec>;
  199. #clock-cells = <1>;
  200. clock-output-names = "cko1_rtc",
  201. "cko2_rtc",
  202. "cko3_rtc";
  203. };
  204. };
  205. };
  206. #include "axp81x.dtsi"
  207. &ac_power_supply {
  208. status = "okay";
  209. };
  210. &battery_power_supply {
  211. status = "okay";
  212. };
  213. &reg_aldo1 {
  214. regulator-always-on;
  215. regulator-min-microvolt = <1800000>;
  216. regulator-max-microvolt = <1800000>;
  217. regulator-name = "vcc-1v8";
  218. };
  219. &reg_aldo2 {
  220. regulator-always-on;
  221. regulator-min-microvolt = <1800000>;
  222. regulator-max-microvolt = <1800000>;
  223. regulator-name = "dram-pll";
  224. };
  225. &reg_aldo3 {
  226. regulator-always-on;
  227. regulator-min-microvolt = <3000000>;
  228. regulator-max-microvolt = <3000000>;
  229. regulator-name = "avcc";
  230. };
  231. &reg_dcdc1 {
  232. /* schematics says 3.1V but FEX file says 3.3V */
  233. regulator-always-on;
  234. regulator-min-microvolt = <3300000>;
  235. regulator-max-microvolt = <3300000>;
  236. regulator-name = "vcc-3v3";
  237. };
  238. &reg_dcdc2 {
  239. regulator-always-on;
  240. regulator-min-microvolt = <700000>;
  241. regulator-max-microvolt = <1100000>;
  242. regulator-name = "vdd-cpua";
  243. };
  244. &reg_dcdc3 {
  245. regulator-always-on;
  246. regulator-min-microvolt = <700000>;
  247. regulator-max-microvolt = <1100000>;
  248. regulator-name = "vdd-cpub";
  249. };
  250. &reg_dcdc4 {
  251. regulator-min-microvolt = <700000>;
  252. regulator-max-microvolt = <1100000>;
  253. regulator-name = "vdd-gpu";
  254. };
  255. &reg_dcdc5 {
  256. regulator-always-on;
  257. regulator-min-microvolt = <1200000>;
  258. regulator-max-microvolt = <1200000>;
  259. regulator-name = "vcc-dram";
  260. };
  261. &reg_dcdc6 {
  262. regulator-always-on;
  263. regulator-min-microvolt = <900000>;
  264. regulator-max-microvolt = <900000>;
  265. regulator-name = "vdd-sys";
  266. };
  267. &reg_dldo1 {
  268. /*
  269. * This powers both the WiFi/BT module's main power, I/O supply,
  270. * and external pull-ups on all the data lines. It should be set
  271. * to the same voltage as the I/O supply (DCDC1 in this case) to
  272. * avoid any leakage or mismatch.
  273. */
  274. regulator-min-microvolt = <3300000>;
  275. regulator-max-microvolt = <3300000>;
  276. regulator-name = "vcc-wifi";
  277. };
  278. &reg_dldo3 {
  279. regulator-always-on;
  280. regulator-min-microvolt = <3300000>;
  281. regulator-max-microvolt = <3300000>;
  282. regulator-name = "vcc-pd";
  283. };
  284. &reg_drivevbus {
  285. regulator-name = "usb0-vbus";
  286. status = "okay";
  287. };
  288. &reg_fldo1 {
  289. regulator-min-microvolt = <1080000>;
  290. regulator-max-microvolt = <1320000>;
  291. regulator-name = "vdd12-hsic";
  292. };
  293. &reg_fldo2 {
  294. /*
  295. * Despite the embedded CPUs core not being used in any way,
  296. * this must remain on or the system will hang.
  297. */
  298. regulator-always-on;
  299. regulator-min-microvolt = <700000>;
  300. regulator-max-microvolt = <1100000>;
  301. regulator-name = "vdd-cpus";
  302. };
  303. &reg_rtc_ldo {
  304. regulator-name = "vcc-rtc";
  305. };
  306. &reg_sw {
  307. /*
  308. * The PHY requires 20ms after all voltages
  309. * are applied until core logic is ready and
  310. * 30ms after the reset pin is de-asserted.
  311. * Set a 100ms delay to account for PMIC
  312. * ramp time and board traces.
  313. */
  314. regulator-enable-ramp-delay = <100000>;
  315. regulator-name = "vcc-ephy";
  316. };
  317. &uart0 {
  318. pinctrl-names = "default";
  319. pinctrl-0 = <&uart0_pb_pins>;
  320. status = "okay";
  321. };
  322. &uart1 {
  323. pinctrl-names = "default";
  324. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  325. uart-has-rtscts;
  326. status = "okay";
  327. bluetooth {
  328. compatible = "brcm,bcm43438-bt";
  329. clocks = <&ac100_rtc 1>;
  330. clock-names = "lpo";
  331. vbat-supply = <&reg_dldo1>;
  332. vddio-supply = <&reg_dldo1>;
  333. device-wakeup-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
  334. host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
  335. shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
  336. };
  337. };
  338. &usb_otg {
  339. dr_mode = "otg";
  340. status = "okay";
  341. };
  342. &usb_power_supply {
  343. status = "okay";
  344. };
  345. &usbphy {
  346. usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
  347. usb0_vbus_power-supply = <&usb_power_supply>;
  348. usb0_vbus-supply = <&reg_drivevbus>;
  349. usb1_vbus-supply = <&reg_usb1_vbus>;
  350. status = "okay";
  351. };