sun9i-a80-cubieboard4.dts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /*
  2. * Copyright 2015 Tyler Baker
  3. *
  4. * Tyler Baker <[email protected]>
  5. * Chen-Yu Tsai <[email protected]>
  6. *
  7. * This file is dual-licensed: you can use it either under the terms
  8. * of the GPL or the X11 license, at your option. Note that this dual
  9. * licensing only applies to this file, and not this project as a
  10. * whole.
  11. *
  12. * a) This file is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This file is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * Or, alternatively,
  23. *
  24. * b) Permission is hereby granted, free of charge, to any person
  25. * obtaining a copy of this software and associated documentation
  26. * files (the "Software"), to deal in the Software without
  27. * restriction, including without limitation the rights to use,
  28. * copy, modify, merge, publish, distribute, sublicense, and/or
  29. * sell copies of the Software, and to permit persons to whom the
  30. * Software is furnished to do so, subject to the following
  31. * conditions:
  32. *
  33. * The above copyright notice and this permission notice shall be
  34. * included in all copies or substantial portions of the Software.
  35. *
  36. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  37. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  38. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  39. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  40. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  41. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  42. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  43. * OTHER DEALINGS IN THE SOFTWARE.
  44. */
  45. /dts-v1/;
  46. #include "sun9i-a80.dtsi"
  47. #include <dt-bindings/gpio/gpio.h>
  48. / {
  49. model = "Cubietech Cubieboard4";
  50. compatible = "cubietech,a80-cubieboard4", "allwinner,sun9i-a80";
  51. aliases {
  52. serial0 = &uart0;
  53. };
  54. chosen {
  55. stdout-path = "serial0:115200n8";
  56. };
  57. leds {
  58. compatible = "gpio-leds";
  59. led-0 {
  60. label = "cubieboard4:green:usr";
  61. gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
  62. };
  63. led-1 {
  64. label = "cubieboard4:red:usr";
  65. gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
  66. };
  67. };
  68. vga-connector {
  69. compatible = "vga-connector";
  70. label = "vga";
  71. ddc-i2c-bus = <&i2c3>;
  72. port {
  73. vga_con_in: endpoint {
  74. remote-endpoint = <&vga_dac_out>;
  75. };
  76. };
  77. };
  78. vga-dac {
  79. compatible = "corpro,gm7123", "adi,adv7123";
  80. vdd-supply = <&reg_dcdc1>;
  81. ports {
  82. #address-cells = <1>;
  83. #size-cells = <0>;
  84. port@0 {
  85. reg = <0>;
  86. vga_dac_in: endpoint {
  87. remote-endpoint = <&tcon0_out_vga>;
  88. };
  89. };
  90. port@1 {
  91. reg = <1>;
  92. vga_dac_out: endpoint {
  93. remote-endpoint = <&vga_con_in>;
  94. };
  95. };
  96. };
  97. };
  98. wifi_pwrseq: wifi-pwrseq {
  99. compatible = "mmc-pwrseq-simple";
  100. clocks = <&ac100_rtc 1>;
  101. clock-names = "ext_clock";
  102. /* enables internal regulator and de-asserts reset */
  103. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
  104. };
  105. };
  106. &de {
  107. status = "okay";
  108. };
  109. &gmac {
  110. pinctrl-names = "default";
  111. pinctrl-0 = <&gmac_rgmii_pins>;
  112. phy-handle = <&phy1>;
  113. phy-mode = "rgmii-id";
  114. phy-supply = <&reg_cldo1>;
  115. status = "okay";
  116. };
  117. &i2c3 {
  118. pinctrl-names = "default";
  119. pinctrl-0 = <&i2c3_pins>;
  120. status = "okay";
  121. };
  122. &mdio {
  123. phy1: ethernet-phy@1 {
  124. reg = <1>;
  125. };
  126. };
  127. &mmc0 {
  128. pinctrl-names = "default";
  129. pinctrl-0 = <&mmc0_pins>;
  130. vmmc-supply = <&reg_dcdc1>;
  131. bus-width = <4>;
  132. cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH18 */
  133. status = "okay";
  134. };
  135. &mmc1 {
  136. pinctrl-names = "default";
  137. pinctrl-0 = <&mmc1_pins>;
  138. vmmc-supply = <&reg_dldo1>;
  139. vqmmc-supply = <&reg_cldo3>;
  140. mmc-pwrseq = <&wifi_pwrseq>;
  141. bus-width = <4>;
  142. non-removable;
  143. status = "okay";
  144. };
  145. &mmc1_pins {
  146. bias-pull-up;
  147. };
  148. &mmc2 {
  149. pinctrl-names = "default";
  150. pinctrl-0 = <&mmc2_8bit_pins>;
  151. vmmc-supply = <&reg_dcdc1>;
  152. bus-width = <8>;
  153. non-removable;
  154. cap-mmc-hw-reset;
  155. status = "okay";
  156. };
  157. &mmc2_8bit_pins {
  158. /* Increase drive strength for DDR modes */
  159. drive-strength = <40>;
  160. };
  161. &osc32k {
  162. /* osc32k input is from AC100 */
  163. clocks = <&ac100_rtc 0>;
  164. };
  165. &pio {
  166. vcc-pa-supply = <&reg_ldo_io1>;
  167. vcc-pb-supply = <&reg_aldo2>;
  168. vcc-pc-supply = <&reg_dcdc1>;
  169. vcc-pd-supply = <&reg_dc1sw>;
  170. vcc-pe-supply = <&reg_eldo2>;
  171. vcc-pf-supply = <&reg_dcdc1>;
  172. vcc-pg-supply = <&reg_ldo_io0>;
  173. vcc-ph-supply = <&reg_dcdc1>;
  174. };
  175. &r_ir {
  176. status = "okay";
  177. };
  178. &r_pio {
  179. vcc-pl-supply = <&reg_dldo2>;
  180. vcc-pm-supply = <&reg_eldo3>;
  181. };
  182. &r_rsb {
  183. status = "okay";
  184. axp809: pmic@3a3 {
  185. reg = <0x3a3>;
  186. interrupt-parent = <&nmi_intc>;
  187. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  188. regulators {
  189. reg_aldo1: aldo1 {
  190. /*
  191. * TODO: This should be handled by the
  192. * USB PHY driver.
  193. */
  194. regulator-always-on;
  195. regulator-min-microvolt = <3000000>;
  196. regulator-max-microvolt = <3000000>;
  197. regulator-name = "vcc33-usbh";
  198. };
  199. reg_aldo2: aldo2 {
  200. regulator-min-microvolt = <1800000>;
  201. regulator-max-microvolt = <1800000>;
  202. regulator-name = "vcc-pb-io-cam";
  203. };
  204. aldo3 {
  205. /* unused */
  206. };
  207. reg_dc1sw: dc1sw {
  208. regulator-name = "vcc-pd";
  209. };
  210. reg_dc5ldo: dc5ldo {
  211. regulator-always-on;
  212. regulator-min-microvolt = <800000>;
  213. regulator-max-microvolt = <1100000>;
  214. regulator-name = "vdd-cpus-09-usbh";
  215. };
  216. reg_dcdc1: dcdc1 {
  217. regulator-always-on;
  218. regulator-min-microvolt = <3000000>;
  219. regulator-max-microvolt = <3000000>;
  220. regulator-name = "vcc-3v";
  221. };
  222. reg_dcdc2: dcdc2 {
  223. regulator-min-microvolt = <800000>;
  224. regulator-max-microvolt = <1100000>;
  225. regulator-name = "vdd-gpu";
  226. };
  227. reg_dcdc3: dcdc3 {
  228. regulator-always-on;
  229. regulator-min-microvolt = <800000>;
  230. regulator-max-microvolt = <1100000>;
  231. regulator-name = "vdd-cpua";
  232. };
  233. reg_dcdc4: dcdc4 {
  234. regulator-always-on;
  235. regulator-min-microvolt = <800000>;
  236. regulator-max-microvolt = <1100000>;
  237. regulator-name = "vdd-sys-usb0-hdmi";
  238. };
  239. reg_dcdc5: dcdc5 {
  240. regulator-always-on;
  241. regulator-min-microvolt = <1425000>;
  242. regulator-max-microvolt = <1575000>;
  243. regulator-name = "vcc-dram";
  244. };
  245. reg_dldo1: dldo1 {
  246. /*
  247. * The WiFi chip supports a wide range
  248. * (3.0 ~ 4.8V) of voltages, and so does
  249. * this regulator (3.0 ~ 4.2V), but
  250. * Allwinner SDK always sets it to 3.3V.
  251. */
  252. regulator-min-microvolt = <3300000>;
  253. regulator-max-microvolt = <3300000>;
  254. regulator-name = "vcc-wifi";
  255. };
  256. reg_dldo2: dldo2 {
  257. regulator-min-microvolt = <3000000>;
  258. regulator-max-microvolt = <3000000>;
  259. regulator-name = "vcc-pl";
  260. };
  261. reg_eldo1: eldo1 {
  262. regulator-min-microvolt = <1200000>;
  263. regulator-max-microvolt = <1200000>;
  264. regulator-name = "vcc-dvdd-cam";
  265. };
  266. reg_eldo2: eldo2 {
  267. regulator-min-microvolt = <1800000>;
  268. regulator-max-microvolt = <1800000>;
  269. regulator-name = "vcc-pe";
  270. };
  271. reg_eldo3: eldo3 {
  272. regulator-min-microvolt = <3000000>;
  273. regulator-max-microvolt = <3000000>;
  274. regulator-name = "vcc-pm-codec-io1";
  275. };
  276. reg_ldo_io0: ldo_io0 {
  277. regulator-min-microvolt = <3000000>;
  278. regulator-max-microvolt = <3000000>;
  279. regulator-name = "vcc-pg";
  280. };
  281. reg_ldo_io1: ldo_io1 {
  282. regulator-min-microvolt = <2500000>;
  283. regulator-max-microvolt = <2500000>;
  284. regulator-name = "vcc-pa-gmac-2v5";
  285. };
  286. reg_rtc_ldo: rtc_ldo {
  287. regulator-name = "vcc-rtc-vdd1v8-io";
  288. };
  289. sw {
  290. /* unused */
  291. };
  292. };
  293. };
  294. axp806: pmic@745 {
  295. compatible = "x-powers,axp806";
  296. reg = <0x745>;
  297. interrupt-parent = <&nmi_intc>;
  298. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  299. interrupt-controller;
  300. #interrupt-cells = <1>;
  301. bldoin-supply = <&reg_dcdce>;
  302. regulators {
  303. reg_s_aldo1: aldo1 {
  304. regulator-always-on;
  305. regulator-min-microvolt = <3000000>;
  306. regulator-max-microvolt = <3000000>;
  307. regulator-name = "avcc";
  308. };
  309. aldo2 {
  310. /*
  311. * unused, but use a different name to
  312. * avoid name clash with axp809's aldo's
  313. */
  314. regulator-name = "s_aldo2";
  315. };
  316. aldo3 {
  317. /*
  318. * unused, but use a different name to
  319. * avoid name clash with axp809's aldo's
  320. */
  321. regulator-name = "s_aldo3";
  322. };
  323. reg_bldo1: bldo1 {
  324. regulator-always-on;
  325. regulator-min-microvolt = <1700000>;
  326. regulator-max-microvolt = <1900000>;
  327. regulator-name = "vcc18-efuse-adc-display-csi";
  328. };
  329. reg_bldo2: bldo2 {
  330. regulator-always-on;
  331. regulator-min-microvolt = <1700000>;
  332. regulator-max-microvolt = <1900000>;
  333. regulator-name =
  334. "vdd18-drampll-vcc18-pll-cpvdd";
  335. };
  336. bldo3 {
  337. /* unused */
  338. };
  339. reg_bldo4: bldo4 {
  340. regulator-min-microvolt = <1100000>;
  341. regulator-max-microvolt = <1300000>;
  342. regulator-name = "vcc12-hsic";
  343. };
  344. reg_cldo1: cldo1 {
  345. /*
  346. * This was 3V in the original design, but
  347. * 3.3V is the recommended supply voltage
  348. * for the Ethernet PHY.
  349. */
  350. regulator-min-microvolt = <3300000>;
  351. regulator-max-microvolt = <3300000>;
  352. /*
  353. * The PHY requires 20ms after all voltages
  354. * are applied until core logic is ready and
  355. * 30ms after the reset pin is de-asserted.
  356. * Set a 100ms delay to account for PMIC
  357. * ramp time and board traces.
  358. */
  359. regulator-enable-ramp-delay = <100000>;
  360. regulator-name = "vcc-gmac-phy";
  361. };
  362. reg_cldo2: cldo2 {
  363. regulator-min-microvolt = <2800000>;
  364. regulator-max-microvolt = <2800000>;
  365. regulator-name = "afvcc-cam";
  366. };
  367. reg_cldo3: cldo3 {
  368. regulator-min-microvolt = <3000000>;
  369. regulator-max-microvolt = <3000000>;
  370. regulator-name = "vcc-io-wifi-codec-io2";
  371. };
  372. reg_dcdca: dcdca {
  373. regulator-always-on;
  374. regulator-min-microvolt = <800000>;
  375. regulator-max-microvolt = <1100000>;
  376. regulator-name = "vdd-cpub";
  377. };
  378. reg_dcdcd: dcdcd {
  379. regulator-always-on;
  380. regulator-min-microvolt = <800000>;
  381. regulator-max-microvolt = <1100000>;
  382. regulator-name = "vdd-vpu";
  383. };
  384. reg_dcdce: dcdce {
  385. regulator-always-on;
  386. regulator-min-microvolt = <2100000>;
  387. regulator-max-microvolt = <2100000>;
  388. regulator-name = "vcc-bldo-codec-ldoin";
  389. };
  390. sw {
  391. /*
  392. * unused, but use a different name to
  393. * avoid name clash with axp809's sw
  394. */
  395. regulator-name = "s_sw";
  396. };
  397. };
  398. };
  399. ac100: codec@e89 {
  400. compatible = "x-powers,ac100";
  401. reg = <0xe89>;
  402. ac100_codec: codec {
  403. compatible = "x-powers,ac100-codec";
  404. interrupt-parent = <&r_pio>;
  405. interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
  406. #clock-cells = <0>;
  407. clock-output-names = "4M_adda";
  408. };
  409. ac100_rtc: rtc {
  410. compatible = "x-powers,ac100-rtc";
  411. interrupt-parent = <&nmi_intc>;
  412. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  413. clocks = <&ac100_codec>;
  414. #clock-cells = <1>;
  415. clock-output-names = "cko1_rtc",
  416. "cko2_rtc",
  417. "cko3_rtc";
  418. };
  419. };
  420. };
  421. #include "axp809.dtsi"
  422. &tcon0 {
  423. pinctrl-names = "default";
  424. pinctrl-0 = <&lcd0_rgb888_pins>;
  425. };
  426. &tcon0_out {
  427. tcon0_out_vga: endpoint {
  428. remote-endpoint = <&vga_dac_in>;
  429. };
  430. };
  431. &uart0 {
  432. pinctrl-names = "default";
  433. pinctrl-0 = <&uart0_ph_pins>;
  434. status = "okay";
  435. };