sun7i-a20-cubietruck.dts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. /*
  2. * Copyright 2013 Oliver Schinagl
  3. *
  4. * Oliver Schinagl <oliver@schinagl.nl>
  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. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50. / {
  51. model = "Cubietech Cubietruck";
  52. compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
  53. aliases {
  54. serial0 = &uart0;
  55. };
  56. chosen {
  57. stdout-path = "serial0:115200n8";
  58. };
  59. leds {
  60. compatible = "gpio-leds";
  61. pinctrl-names = "default";
  62. pinctrl-0 = <&led_pins_cubietruck>;
  63. blue {
  64. label = "cubietruck:blue:usr";
  65. gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
  66. };
  67. orange {
  68. label = "cubietruck:orange:usr";
  69. gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
  70. };
  71. white {
  72. label = "cubietruck:white:usr";
  73. gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>;
  74. };
  75. green {
  76. label = "cubietruck:green:usr";
  77. gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;
  78. };
  79. };
  80. mmc3_pwrseq: mmc3_pwrseq {
  81. compatible = "mmc-pwrseq-simple";
  82. pinctrl-names = "default";
  83. pinctrl-0 = <&mmc3_pwrseq_pin_cubietruck>;
  84. reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
  85. };
  86. sound {
  87. compatible = "simple-audio-card";
  88. simple-audio-card,name = "On-board SPDIF";
  89. simple-audio-card,cpu {
  90. sound-dai = <&spdif>;
  91. };
  92. simple-audio-card,codec {
  93. sound-dai = <&spdif_out>;
  94. };
  95. };
  96. spdif_out: spdif-out {
  97. #sound-dai-cells = <0>;
  98. compatible = "linux,spdif-dit";
  99. };
  100. };
  101. &ahci {
  102. target-supply = <&reg_ahci_5v>;
  103. status = "okay";
  104. };
  105. &codec {
  106. status = "okay";
  107. };
  108. &cpu0 {
  109. cpu-supply = <&reg_dcdc2>;
  110. };
  111. &ehci0 {
  112. status = "okay";
  113. };
  114. &ehci1 {
  115. status = "okay";
  116. };
  117. &gmac {
  118. pinctrl-names = "default";
  119. pinctrl-0 = <&gmac_pins_rgmii_a>;
  120. phy = <&phy1>;
  121. phy-mode = "rgmii";
  122. status = "okay";
  123. phy1: ethernet-phy@1 {
  124. reg = <1>;
  125. };
  126. };
  127. &i2c0 {
  128. pinctrl-names = "default";
  129. pinctrl-0 = <&i2c0_pins_a>;
  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. &i2c1 {
  138. pinctrl-names = "default";
  139. pinctrl-0 = <&i2c1_pins_a>;
  140. status = "okay";
  141. };
  142. &i2c2 {
  143. pinctrl-names = "default";
  144. pinctrl-0 = <&i2c2_pins_a>;
  145. status = "okay";
  146. };
  147. &ir0 {
  148. pinctrl-names = "default";
  149. pinctrl-0 = <&ir0_rx_pins_a>;
  150. status = "okay";
  151. };
  152. &mmc0 {
  153. pinctrl-names = "default";
  154. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  155. vmmc-supply = <&reg_vcc3v3>;
  156. bus-width = <4>;
  157. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  158. cd-inverted;
  159. status = "okay";
  160. };
  161. &mmc3 {
  162. pinctrl-names = "default";
  163. pinctrl-0 = <&mmc3_pins_a>;
  164. vmmc-supply = <&reg_vcc3v3>;
  165. mmc-pwrseq = <&mmc3_pwrseq>;
  166. bus-width = <4>;
  167. non-removable;
  168. status = "okay";
  169. brcmf: bcrmf@1 {
  170. reg = <1>;
  171. compatible = "brcm,bcm4329-fmac";
  172. interrupt-parent = <&pio>;
  173. interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
  174. interrupt-names = "host-wake";
  175. };
  176. };
  177. &mmc3_pins_a {
  178. /* AP6210 requires pull-up */
  179. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  180. };
  181. &ohci0 {
  182. status = "okay";
  183. };
  184. &ohci1 {
  185. status = "okay";
  186. };
  187. &otg_sram {
  188. status = "okay";
  189. };
  190. &pio {
  191. ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
  192. allwinner,pins = "PH12";
  193. allwinner,function = "gpio_out";
  194. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  195. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  196. };
  197. led_pins_cubietruck: led_pins@0 {
  198. allwinner,pins = "PH7", "PH11", "PH20", "PH21";
  199. allwinner,function = "gpio_out";
  200. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  201. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  202. };
  203. mmc3_pwrseq_pin_cubietruck: mmc3_pwrseq_pin@0 {
  204. allwinner,pins = "PH9";
  205. allwinner,function = "gpio_out";
  206. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  207. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  208. };
  209. usb0_vbus_pin_a: usb0_vbus_pin@0 {
  210. allwinner,pins = "PH17";
  211. allwinner,function = "gpio_out";
  212. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  213. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  214. };
  215. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  216. allwinner,pins = "PH19";
  217. allwinner,function = "gpio_in";
  218. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  219. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  220. };
  221. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  222. allwinner,pins = "PH22";
  223. allwinner,function = "gpio_in";
  224. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  225. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  226. };
  227. };
  228. &pwm {
  229. pinctrl-names = "default";
  230. pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>;
  231. status = "okay";
  232. };
  233. &reg_ahci_5v {
  234. pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
  235. gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
  236. status = "okay";
  237. };
  238. #include "axp209.dtsi"
  239. &reg_dcdc2 {
  240. regulator-always-on;
  241. regulator-min-microvolt = <1000000>;
  242. regulator-max-microvolt = <1450000>;
  243. regulator-name = "vdd-cpu";
  244. };
  245. &reg_dcdc3 {
  246. regulator-always-on;
  247. regulator-min-microvolt = <1000000>;
  248. regulator-max-microvolt = <1400000>;
  249. regulator-name = "vdd-int-dll";
  250. };
  251. &reg_ldo1 {
  252. regulator-name = "vdd-rtc";
  253. };
  254. &reg_ldo2 {
  255. regulator-always-on;
  256. regulator-min-microvolt = <3000000>;
  257. regulator-max-microvolt = <3000000>;
  258. regulator-name = "avcc";
  259. };
  260. &reg_usb0_vbus {
  261. pinctrl-0 = <&usb0_vbus_pin_a>;
  262. gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
  263. status = "okay";
  264. };
  265. &reg_usb1_vbus {
  266. status = "okay";
  267. };
  268. &reg_usb2_vbus {
  269. status = "okay";
  270. };
  271. &spdif {
  272. pinctrl-names = "default";
  273. pinctrl-0 = <&spdif_tx_pins_a>;
  274. status = "okay";
  275. };
  276. &uart0 {
  277. pinctrl-names = "default";
  278. pinctrl-0 = <&uart0_pins_a>;
  279. status = "okay";
  280. };
  281. &usb_otg {
  282. dr_mode = "otg";
  283. status = "okay";
  284. };
  285. &usbphy {
  286. pinctrl-names = "default";
  287. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  288. usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
  289. usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
  290. usb0_vbus-supply = <&reg_usb0_vbus>;
  291. usb1_vbus-supply = <&reg_usb1_vbus>;
  292. usb2_vbus-supply = <&reg_usb2_vbus>;
  293. status = "okay";
  294. };