sun7i-a20-bananapi.dts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /*
  2. * Copyright 2014 Hans de Goede <[email protected]>
  3. *
  4. * Hans de Goede <[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 "sun7i-a20.dtsi"
  46. #include "sunxi-common-regulators.dtsi"
  47. #include <dt-bindings/gpio/gpio.h>
  48. #include <dt-bindings/interrupt-controller/irq.h>
  49. / {
  50. model = "LeMaker Banana Pi";
  51. compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
  52. aliases {
  53. serial0 = &uart0;
  54. serial1 = &uart3;
  55. serial2 = &uart7;
  56. };
  57. chosen {
  58. stdout-path = "serial0:115200n8";
  59. };
  60. hdmi-connector {
  61. compatible = "hdmi-connector";
  62. type = "a";
  63. port {
  64. hdmi_con_in: endpoint {
  65. remote-endpoint = <&hdmi_out_con>;
  66. };
  67. };
  68. };
  69. leds {
  70. compatible = "gpio-leds";
  71. led {
  72. label = "bananapi:green:usr";
  73. gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
  74. };
  75. };
  76. reg_gmac_3v3: gmac-3v3 {
  77. compatible = "regulator-fixed";
  78. regulator-name = "gmac-3v3";
  79. regulator-min-microvolt = <3300000>;
  80. regulator-max-microvolt = <3300000>;
  81. startup-delay-us = <100000>;
  82. enable-active-high;
  83. gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
  84. };
  85. };
  86. &ahci {
  87. status = "okay";
  88. };
  89. &codec {
  90. status = "okay";
  91. };
  92. &cpu0 {
  93. cpu-supply = <&reg_dcdc2>;
  94. operating-points =
  95. /* kHz uV */
  96. <960000 1400000>,
  97. <912000 1400000>,
  98. <864000 1350000>,
  99. <720000 1250000>,
  100. <528000 1150000>,
  101. <312000 1100000>,
  102. <144000 1050000>;
  103. };
  104. &de {
  105. status = "okay";
  106. };
  107. &ehci0 {
  108. status = "okay";
  109. };
  110. &ehci1 {
  111. status = "okay";
  112. };
  113. &gmac {
  114. pinctrl-names = "default";
  115. pinctrl-0 = <&gmac_rgmii_pins>;
  116. phy-handle = <&phy1>;
  117. phy-mode = "rgmii-id";
  118. phy-supply = <&reg_gmac_3v3>;
  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. &i2c0 {
  130. status = "okay";
  131. axp209: pmic@34 {
  132. reg = <0x34>;
  133. interrupt-parent = <&nmi_intc>;
  134. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  135. };
  136. };
  137. &i2c2 {
  138. status = "okay";
  139. };
  140. &ir0 {
  141. pinctrl-names = "default";
  142. pinctrl-0 = <&ir0_rx_pin>;
  143. status = "okay";
  144. };
  145. &gmac_mdio {
  146. phy1: ethernet-phy@1 {
  147. reg = <1>;
  148. };
  149. };
  150. &mmc0 {
  151. vmmc-supply = <&reg_vcc3v3>;
  152. bus-width = <4>;
  153. cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
  154. status = "okay";
  155. };
  156. &ohci0 {
  157. status = "okay";
  158. };
  159. &ohci1 {
  160. status = "okay";
  161. };
  162. &otg_sram {
  163. status = "okay";
  164. };
  165. &pio {
  166. vcc-pa-supply = <&reg_vcc3v3>;
  167. vcc-pc-supply = <&reg_vcc3v3>;
  168. vcc-pe-supply = <&reg_vcc3v3>;
  169. vcc-pf-supply = <&reg_vcc3v3>;
  170. vcc-pg-supply = <&reg_vcc3v3>;
  171. gpio-line-names =
  172. /* PA */
  173. "ERXD3", "ERXD2", "ERXD1", "ERXD0", "ETXD3",
  174. "ETXD2", "ETXD1", "ETXD0",
  175. "ERXCK", "ERXERR", "ERXDV", "EMDC", "EMDIO",
  176. "ETXEN", "ETXCK", "ECRS",
  177. "ECOL", "ETXERR", "", "", "", "", "", "",
  178. "", "", "", "", "", "", "", "",
  179. /* PB */
  180. "PMU-SCK", "PMU-SDA", "", "", "", "", "", "",
  181. "", "USB0-DRV", "", "", "", "", "", "",
  182. "", "", "", "", "SCL", "SDA", "", "",
  183. "", "", "", "", "", "", "", "",
  184. /* PC */
  185. "", "", "", "", "", "", "", "",
  186. "", "", "", "", "", "", "", "",
  187. "", "", "", "", "", "", "", "",
  188. "", "", "", "", "", "", "", "",
  189. /* PD */
  190. "", "", "", "", "", "", "", "",
  191. "", "", "", "", "", "", "", "",
  192. "", "", "", "", "", "", "", "",
  193. "", "", "", "", "", "", "", "",
  194. /* PE */
  195. "", "", "", "", "", "", "", "",
  196. "", "", "", "", "", "", "", "",
  197. "", "", "", "", "", "", "", "",
  198. "", "", "", "", "", "", "", "",
  199. /* PF */
  200. "SD0-D1", "SD0-D0", "SD0-CLK", "SD0-CMD", "SD0-D3",
  201. "SD0-D2", "", "",
  202. "", "", "", "", "", "", "", "",
  203. "", "", "", "", "", "", "", "",
  204. "", "", "", "", "", "", "", "",
  205. /* PG */
  206. "", "", "", "", "", "", "", "",
  207. "", "", "", "", "", "", "", "",
  208. "", "", "", "", "", "", "", "",
  209. "", "", "", "", "", "", "", "",
  210. /* PH */
  211. "TXD0", "RXD0", "IO-1", "PH3", "USB0-IDDET", "PH5", "", "",
  212. "", "", "SD0-DET", "", "", "", "", "",
  213. "", "", "", "", "IO-4", "IO-5", "", "EMAC-PWR-EN",
  214. "LED1", "", "", "", "", "", "", "",
  215. /* PI */
  216. "", "", "", "IO-GCLK", "", "", "", "",
  217. "", "", "SPI-CE0", "SPI-CLK", "SPI-MOSI",
  218. "SPI-MISO", "SPI-CE1", "",
  219. "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",
  220. "", "", "", "", "", "", "", "";
  221. };
  222. #include "axp209.dtsi"
  223. &reg_dcdc2 {
  224. regulator-always-on;
  225. regulator-min-microvolt = <1000000>;
  226. regulator-max-microvolt = <1400000>;
  227. regulator-name = "vdd-cpu";
  228. };
  229. &reg_dcdc3 {
  230. regulator-always-on;
  231. regulator-min-microvolt = <1000000>;
  232. regulator-max-microvolt = <1400000>;
  233. regulator-name = "vdd-int-dll";
  234. };
  235. &reg_ldo1 {
  236. regulator-name = "vdd-rtc";
  237. };
  238. &reg_ldo2 {
  239. regulator-always-on;
  240. regulator-min-microvolt = <3000000>;
  241. regulator-max-microvolt = <3000000>;
  242. regulator-name = "avcc";
  243. };
  244. &reg_usb0_vbus {
  245. status = "okay";
  246. };
  247. &reg_usb1_vbus {
  248. status = "okay";
  249. };
  250. &reg_usb2_vbus {
  251. status = "okay";
  252. };
  253. &spi0 {
  254. pinctrl-names = "default";
  255. pinctrl-0 = <&spi0_pi_pins>,
  256. <&spi0_cs0_pi_pin>,
  257. <&spi0_cs1_pi_pin>;
  258. status = "okay";
  259. };
  260. &uart0 {
  261. pinctrl-names = "default";
  262. pinctrl-0 = <&uart0_pb_pins>;
  263. status = "okay";
  264. };
  265. &uart3 {
  266. pinctrl-names = "default";
  267. pinctrl-0 = <&uart3_ph_pins>;
  268. status = "okay";
  269. };
  270. &uart7 {
  271. pinctrl-names = "default";
  272. pinctrl-0 = <&uart7_pi_pins>;
  273. status = "okay";
  274. };
  275. &usb_otg {
  276. dr_mode = "otg";
  277. status = "okay";
  278. };
  279. &usb_power_supply {
  280. status = "okay";
  281. };
  282. &usbphy {
  283. usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
  284. usb0_vbus_power-supply = <&usb_power_supply>;
  285. usb0_vbus-supply = <&reg_usb0_vbus>;
  286. usb1_vbus-supply = <&reg_usb1_vbus>;
  287. usb2_vbus-supply = <&reg_usb2_vbus>;
  288. status = "okay";
  289. };