sun8i-a83t-cubietruck-plus.dts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. /*
  2. * Copyright 2015 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 = "Cubietech Cubietruck Plus";
  49. compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
  50. aliases {
  51. ethernet0 = &emac;
  52. serial0 = &uart0;
  53. };
  54. chosen {
  55. stdout-path = "serial0:115200n8";
  56. };
  57. hdmi-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 = "cubietruck-plus:blue:usr";
  70. gpios = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */
  71. };
  72. led-1 {
  73. label = "cubietruck-plus:orange:usr";
  74. gpios = <&pio 3 26 GPIO_ACTIVE_HIGH>; /* PD26 */
  75. };
  76. led-2 {
  77. label = "cubietruck-plus:white:usr";
  78. gpios = <&pio 3 27 GPIO_ACTIVE_HIGH>; /* PD27 */
  79. };
  80. led-3 {
  81. label = "cubietruck-plus:green:usr";
  82. gpios = <&pio 4 4 GPIO_ACTIVE_HIGH>; /* PE4 */
  83. };
  84. };
  85. usb-hub {
  86. /* I2C is not connected */
  87. compatible = "smsc,usb3503";
  88. initial-mode = <1>; /* initialize in HUB mode */
  89. disabled-ports = <1>;
  90. intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  91. reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
  92. connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
  93. refclk-frequency = <19200000>;
  94. };
  95. reg_usb1_vbus: reg-usb1-vbus {
  96. compatible = "regulator-fixed";
  97. regulator-name = "usb1-vbus";
  98. regulator-min-microvolt = <5000000>;
  99. regulator-max-microvolt = <5000000>;
  100. regulator-boot-on;
  101. enable-active-high;
  102. gpio = <&pio 3 29 GPIO_ACTIVE_HIGH>; /* PD29 */
  103. };
  104. reg_usb2_vbus: reg-usb2-vbus {
  105. compatible = "regulator-fixed";
  106. regulator-name = "usb2-vbus";
  107. regulator-min-microvolt = <5000000>;
  108. regulator-max-microvolt = <5000000>;
  109. regulator-boot-on;
  110. enable-active-high;
  111. gpio = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
  112. };
  113. sound {
  114. compatible = "simple-audio-card";
  115. simple-audio-card,name = "On-board SPDIF";
  116. simple-audio-card,cpu {
  117. sound-dai = <&spdif>;
  118. };
  119. simple-audio-card,codec {
  120. sound-dai = <&spdif_out>;
  121. };
  122. };
  123. spdif_out: spdif-out {
  124. #sound-dai-cells = <0>;
  125. compatible = "linux,spdif-dit";
  126. };
  127. wifi_pwrseq: wifi_pwrseq {
  128. compatible = "mmc-pwrseq-simple";
  129. clocks = <&ac100_rtc 1>;
  130. clock-names = "ext_clock";
  131. /* The WiFi low power clock must be 32768 Hz */
  132. assigned-clocks = <&ac100_rtc 1>;
  133. assigned-clock-rates = <32768>;
  134. /* enables internal regulator and de-asserts reset */
  135. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
  136. };
  137. };
  138. &cpu0 {
  139. cpu-supply = <&reg_dcdc2>;
  140. };
  141. &cpu100 {
  142. cpu-supply = <&reg_dcdc3>;
  143. };
  144. &de {
  145. status = "okay";
  146. };
  147. &ehci0 {
  148. /* GL830 USB-to-SATA bridge here */
  149. status = "okay";
  150. };
  151. &ehci1 {
  152. /* USB3503 HSIC USB 2.0 hub here */
  153. status = "okay";
  154. };
  155. &emac {
  156. pinctrl-names = "default";
  157. pinctrl-0 = <&emac_rgmii_pins>;
  158. phy-supply = <&reg_dldo4>;
  159. phy-handle = <&rgmii_phy>;
  160. phy-mode = "rgmii-id";
  161. status = "okay";
  162. };
  163. &hdmi {
  164. status = "okay";
  165. };
  166. &hdmi_out {
  167. hdmi_out_con: endpoint {
  168. remote-endpoint = <&hdmi_con_in>;
  169. };
  170. };
  171. &mdio {
  172. rgmii_phy: ethernet-phy@1 {
  173. compatible = "ethernet-phy-ieee802.3-c22";
  174. reg = <1>;
  175. };
  176. };
  177. &mmc0 {
  178. pinctrl-names = "default";
  179. pinctrl-0 = <&mmc0_pins>;
  180. vmmc-supply = <&reg_dcdc1>;
  181. bus-width = <4>;
  182. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  183. status = "okay";
  184. };
  185. &mmc1 {
  186. vmmc-supply = <&reg_dcdc1>;
  187. vqmmc-supply = <&reg_sw>;
  188. mmc-pwrseq = <&wifi_pwrseq>;
  189. bus-width = <4>;
  190. non-removable;
  191. status = "okay";
  192. };
  193. &mmc2 {
  194. pinctrl-names = "default";
  195. pinctrl-0 = <&mmc2_8bit_emmc_pins>;
  196. vmmc-supply = <&reg_dcdc1>;
  197. bus-width = <8>;
  198. non-removable;
  199. cap-mmc-hw-reset;
  200. status = "okay";
  201. };
  202. &r_rsb {
  203. status = "okay";
  204. axp81x: pmic@3a3 {
  205. compatible = "x-powers,axp818", "x-powers,axp813";
  206. reg = <0x3a3>;
  207. interrupt-parent = <&r_intc>;
  208. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  209. eldoin-supply = <&reg_dcdc1>;
  210. swin-supply = <&reg_dcdc1>;
  211. x-powers,drive-vbus-en;
  212. };
  213. ac100: codec@e89 {
  214. compatible = "x-powers,ac100";
  215. reg = <0xe89>;
  216. ac100_codec: codec {
  217. compatible = "x-powers,ac100-codec";
  218. interrupt-parent = <&r_pio>;
  219. interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
  220. #clock-cells = <0>;
  221. clock-output-names = "4M_adda";
  222. };
  223. ac100_rtc: rtc {
  224. compatible = "x-powers,ac100-rtc";
  225. interrupt-parent = <&r_intc>;
  226. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  227. clocks = <&ac100_codec>;
  228. #clock-cells = <1>;
  229. clock-output-names = "cko1_rtc",
  230. "cko2_rtc",
  231. "cko3_rtc";
  232. };
  233. };
  234. };
  235. #include "axp81x.dtsi"
  236. &ac_power_supply {
  237. status = "okay";
  238. };
  239. &battery_power_supply {
  240. status = "okay";
  241. };
  242. &reg_aldo1 {
  243. regulator-always-on;
  244. regulator-min-microvolt = <1800000>;
  245. regulator-max-microvolt = <1800000>;
  246. regulator-name = "vcc-1v8";
  247. };
  248. &reg_aldo2 {
  249. regulator-always-on;
  250. regulator-min-microvolt = <1800000>;
  251. regulator-max-microvolt = <1800000>;
  252. regulator-name = "dram-pll";
  253. };
  254. &reg_aldo3 {
  255. regulator-always-on;
  256. regulator-min-microvolt = <3000000>;
  257. regulator-max-microvolt = <3000000>;
  258. regulator-name = "avcc";
  259. };
  260. &reg_dcdc1 {
  261. /*
  262. * The schematics say this should be 3.3V, but the FEX file says
  263. * it should be 3V. The latter makes sense, as the WiFi module's
  264. * I/O is indirectly powered from DCDC1, through SW. It is rated
  265. * at 2.98V maximum.
  266. */
  267. regulator-always-on;
  268. regulator-min-microvolt = <3000000>;
  269. regulator-max-microvolt = <3000000>;
  270. regulator-name = "vcc-3v";
  271. };
  272. &reg_dcdc2 {
  273. regulator-always-on;
  274. regulator-min-microvolt = <700000>;
  275. regulator-max-microvolt = <1100000>;
  276. regulator-name = "vdd-cpua";
  277. };
  278. &reg_dcdc3 {
  279. regulator-always-on;
  280. regulator-min-microvolt = <700000>;
  281. regulator-max-microvolt = <1100000>;
  282. regulator-name = "vdd-cpub";
  283. };
  284. &reg_dcdc4 {
  285. regulator-min-microvolt = <700000>;
  286. regulator-max-microvolt = <1100000>;
  287. regulator-name = "vdd-gpu";
  288. };
  289. &reg_dcdc5 {
  290. regulator-always-on;
  291. regulator-min-microvolt = <1500000>;
  292. regulator-max-microvolt = <1500000>;
  293. regulator-name = "vcc-dram";
  294. };
  295. &reg_dcdc6 {
  296. regulator-always-on;
  297. regulator-min-microvolt = <900000>;
  298. regulator-max-microvolt = <900000>;
  299. regulator-name = "vdd-sys";
  300. };
  301. &reg_dldo2 {
  302. regulator-min-microvolt = <3300000>;
  303. regulator-max-microvolt = <3300000>;
  304. regulator-name = "dp-pwr";
  305. };
  306. &reg_dldo3 {
  307. regulator-always-on;
  308. regulator-min-microvolt = <2500000>;
  309. regulator-max-microvolt = <2500000>;
  310. regulator-name = "ephy-io";
  311. };
  312. &reg_dldo4 {
  313. /*
  314. * The PHY requires 20ms after all voltages are applied until core
  315. * logic is ready and 30ms after the reset pin is de-asserted.
  316. * Set a 100ms delay to account for PMIC ramp time and board traces.
  317. */
  318. regulator-enable-ramp-delay = <100000>;
  319. regulator-min-microvolt = <3300000>;
  320. regulator-max-microvolt = <3300000>;
  321. regulator-name = "ephy";
  322. };
  323. &reg_drivevbus {
  324. regulator-name = "usb0-vbus";
  325. status = "okay";
  326. };
  327. &reg_eldo1 {
  328. regulator-min-microvolt = <1200000>;
  329. regulator-max-microvolt = <1200000>;
  330. regulator-name = "dp-bridge-1";
  331. };
  332. &reg_eldo2 {
  333. regulator-min-microvolt = <1200000>;
  334. regulator-max-microvolt = <1200000>;
  335. regulator-name = "dp-bridge-2";
  336. };
  337. &reg_fldo1 {
  338. /* TODO should be handled by USB PHY */
  339. regulator-always-on;
  340. regulator-min-microvolt = <1080000>;
  341. regulator-max-microvolt = <1320000>;
  342. regulator-name = "vdd12-hsic";
  343. };
  344. &reg_fldo2 {
  345. /*
  346. * Despite the embedded CPUs core not being used in any way,
  347. * this must remain on or the system will hang.
  348. */
  349. regulator-always-on;
  350. regulator-min-microvolt = <700000>;
  351. regulator-max-microvolt = <1100000>;
  352. regulator-name = "vdd-cpus";
  353. };
  354. &reg_rtc_ldo {
  355. regulator-name = "vcc-rtc";
  356. };
  357. &reg_sw {
  358. regulator-name = "vcc-wifi-io";
  359. };
  360. &spdif {
  361. status = "okay";
  362. };
  363. &uart0 {
  364. pinctrl-names = "default";
  365. pinctrl-0 = <&uart0_pb_pins>;
  366. status = "okay";
  367. };
  368. &uart1 {
  369. pinctrl-names = "default";
  370. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  371. uart-has-rtscts;
  372. status = "okay";
  373. bluetooth {
  374. compatible = "brcm,bcm4330-bt";
  375. clocks = <&ac100_rtc 1>;
  376. clock-names = "lpo";
  377. vbat-supply = <&reg_dcdc1>;
  378. vddio-supply = <&reg_sw>;
  379. device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
  380. host-wakeup-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
  381. shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
  382. };
  383. };
  384. &usb_otg {
  385. dr_mode = "otg";
  386. status = "okay";
  387. };
  388. &usb_power_supply {
  389. status = "okay";
  390. };
  391. &usbphy {
  392. usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
  393. usb0_vbus_power-supply = <&usb_power_supply>;
  394. usb0_vbus-supply = <&reg_drivevbus>;
  395. usb1_vbus-supply = <&reg_usb1_vbus>;
  396. usb2_vbus-supply = <&reg_usb2_vbus>;
  397. status = "okay";
  398. };