sun7i-a20-cubietruck.dts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. /*
  2. * Copyright 2013 Oliver Schinagl
  3. *
  4. * Oliver Schinagl <[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 = "Cubietech Cubietruck";
  51. compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
  52. aliases {
  53. serial0 = &uart0;
  54. };
  55. chosen {
  56. stdout-path = "serial0:115200n8";
  57. };
  58. hdmi-connector {
  59. compatible = "hdmi-connector";
  60. type = "a";
  61. port {
  62. hdmi_con_in: endpoint {
  63. remote-endpoint = <&hdmi_out_con>;
  64. };
  65. };
  66. };
  67. leds {
  68. compatible = "gpio-leds";
  69. led-0 {
  70. label = "cubietruck:blue:usr";
  71. gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
  72. };
  73. led-1 {
  74. label = "cubietruck:orange:usr";
  75. gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
  76. };
  77. led-2 {
  78. label = "cubietruck:white:usr";
  79. gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>;
  80. };
  81. led-3 {
  82. label = "cubietruck:green:usr";
  83. gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;
  84. };
  85. };
  86. mmc3_pwrseq: mmc3_pwrseq {
  87. compatible = "mmc-pwrseq-simple";
  88. reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
  89. clocks = <&ccu CLK_OUT_A>;
  90. clock-names = "ext_clock";
  91. };
  92. sound {
  93. compatible = "simple-audio-card";
  94. simple-audio-card,name = "On-board SPDIF";
  95. simple-audio-card,cpu {
  96. sound-dai = <&spdif>;
  97. };
  98. simple-audio-card,codec {
  99. sound-dai = <&spdif_out>;
  100. };
  101. };
  102. spdif_out: spdif-out {
  103. #sound-dai-cells = <0>;
  104. compatible = "linux,spdif-dit";
  105. };
  106. };
  107. &ahci {
  108. target-supply = <&reg_ahci_5v>;
  109. status = "okay";
  110. };
  111. &codec {
  112. status = "okay";
  113. };
  114. &cpu0 {
  115. cpu-supply = <&reg_dcdc2>;
  116. };
  117. &de {
  118. status = "okay";
  119. };
  120. &ehci0 {
  121. status = "okay";
  122. };
  123. &ehci1 {
  124. status = "okay";
  125. };
  126. &gmac {
  127. pinctrl-names = "default";
  128. pinctrl-0 = <&gmac_rgmii_pins>;
  129. phy-handle = <&phy1>;
  130. phy-mode = "rgmii-id";
  131. status = "okay";
  132. };
  133. &hdmi {
  134. status = "okay";
  135. };
  136. &hdmi_out {
  137. hdmi_out_con: endpoint {
  138. remote-endpoint = <&hdmi_con_in>;
  139. };
  140. };
  141. &i2c0 {
  142. status = "okay";
  143. axp209: pmic@34 {
  144. reg = <0x34>;
  145. interrupt-parent = <&nmi_intc>;
  146. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  147. };
  148. };
  149. &i2c1 {
  150. pinctrl-names = "default";
  151. status = "okay";
  152. };
  153. &i2c2 {
  154. status = "okay";
  155. };
  156. &ir0 {
  157. pinctrl-names = "default";
  158. pinctrl-0 = <&ir0_rx_pin>;
  159. status = "okay";
  160. };
  161. &gmac_mdio {
  162. phy1: ethernet-phy@1 {
  163. reg = <1>;
  164. };
  165. };
  166. &mmc0 {
  167. vmmc-supply = <&reg_vcc3v3>;
  168. bus-width = <4>;
  169. cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
  170. status = "okay";
  171. };
  172. &mmc3 {
  173. vmmc-supply = <&reg_vcc3v3>;
  174. mmc-pwrseq = <&mmc3_pwrseq>;
  175. bus-width = <4>;
  176. non-removable;
  177. status = "okay";
  178. brcmf: wifi@1 {
  179. reg = <1>;
  180. compatible = "brcm,bcm4329-fmac";
  181. interrupt-parent = <&pio>;
  182. interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
  183. interrupt-names = "host-wake";
  184. };
  185. };
  186. &ohci0 {
  187. status = "okay";
  188. };
  189. &ohci1 {
  190. status = "okay";
  191. };
  192. &otg_sram {
  193. status = "okay";
  194. };
  195. &pio {
  196. /* Pin outputs low power clock for WiFi and BT */
  197. pinctrl-0 = <&clk_out_a_pin>;
  198. pinctrl-names = "default";
  199. };
  200. &pwm {
  201. pinctrl-names = "default";
  202. pinctrl-0 = <&pwm0_pin>, <&pwm1_pin>;
  203. status = "okay";
  204. };
  205. &reg_ahci_5v {
  206. gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
  207. status = "okay";
  208. };
  209. #include "axp209.dtsi"
  210. &ac_power_supply {
  211. status = "okay";
  212. };
  213. &battery_power_supply {
  214. status = "okay";
  215. };
  216. &reg_dcdc2 {
  217. regulator-always-on;
  218. regulator-min-microvolt = <1000000>;
  219. regulator-max-microvolt = <1450000>;
  220. regulator-name = "vdd-cpu";
  221. };
  222. &reg_dcdc3 {
  223. regulator-always-on;
  224. regulator-min-microvolt = <1000000>;
  225. regulator-max-microvolt = <1400000>;
  226. regulator-name = "vdd-int-dll";
  227. };
  228. &reg_ldo1 {
  229. regulator-name = "vdd-rtc";
  230. };
  231. &reg_ldo2 {
  232. regulator-always-on;
  233. regulator-min-microvolt = <3000000>;
  234. regulator-max-microvolt = <3000000>;
  235. regulator-name = "avcc";
  236. };
  237. &reg_usb0_vbus {
  238. gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
  239. status = "okay";
  240. };
  241. &reg_usb1_vbus {
  242. status = "okay";
  243. };
  244. &reg_usb2_vbus {
  245. status = "okay";
  246. };
  247. &spdif {
  248. pinctrl-names = "default";
  249. pinctrl-0 = <&spdif_tx_pin>;
  250. status = "okay";
  251. };
  252. &uart0 {
  253. pinctrl-names = "default";
  254. pinctrl-0 = <&uart0_pb_pins>;
  255. status = "okay";
  256. };
  257. &uart2 {
  258. pinctrl-names = "default";
  259. pinctrl-0 = <&uart2_pi_pins>, <&uart2_cts_rts_pi_pins>;
  260. uart-has-rtscts;
  261. status = "okay";
  262. bluetooth {
  263. compatible = "brcm,bcm20702a1";
  264. clocks = <&ccu CLK_OUT_A>;
  265. clock-names = "lpo";
  266. device-wakeup-gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
  267. host-wakeup-gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
  268. shutdown-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
  269. max-speed = <1500000>;
  270. };
  271. };
  272. &usb_otg {
  273. dr_mode = "otg";
  274. status = "okay";
  275. };
  276. &usb_power_supply {
  277. status = "okay";
  278. };
  279. &usbphy {
  280. usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
  281. usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
  282. usb0_vbus_power-supply = <&usb_power_supply>;
  283. usb0_vbus-supply = <&reg_usb0_vbus>;
  284. usb1_vbus-supply = <&reg_usb1_vbus>;
  285. usb2_vbus-supply = <&reg_usb2_vbus>;
  286. status = "okay";
  287. };