sun9i-a80-optimus.dts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. /*
  2. * Copyright 2014 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 "sun9i-a80.dtsi"
  46. #include <dt-bindings/gpio/gpio.h>
  47. / {
  48. model = "Merrii A80 Optimus Board";
  49. compatible = "merrii,a80-optimus", "allwinner,sun9i-a80";
  50. aliases {
  51. serial0 = &uart0;
  52. serial1 = &uart4;
  53. };
  54. chosen {
  55. stdout-path = "serial0:115200n8";
  56. };
  57. leds {
  58. compatible = "gpio-leds";
  59. /* The LED names match those found on the board */
  60. led2 {
  61. label = "optimus:led2:usr";
  62. gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
  63. };
  64. led3 {
  65. label = "optimus:led3:usr";
  66. gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */
  67. };
  68. led4 {
  69. label = "optimus:led4:usr";
  70. gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>;
  71. };
  72. };
  73. reg_usb1_vbus: usb1-vbus {
  74. compatible = "regulator-fixed";
  75. regulator-name = "usb1-vbus";
  76. regulator-min-microvolt = <5000000>;
  77. regulator-max-microvolt = <5000000>;
  78. enable-active-high;
  79. gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  80. };
  81. reg_usb3_vbus: usb3-vbus {
  82. compatible = "regulator-fixed";
  83. regulator-name = "usb3-vbus";
  84. regulator-min-microvolt = <5000000>;
  85. regulator-max-microvolt = <5000000>;
  86. enable-active-high;
  87. gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  88. };
  89. wifi_pwrseq: wifi-pwrseq {
  90. compatible = "mmc-pwrseq-simple";
  91. clocks = <&ac100_rtc 1>;
  92. clock-names = "ext_clock";
  93. /* enables internal regulator and de-asserts reset */
  94. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
  95. };
  96. };
  97. &ehci0 {
  98. status = "okay";
  99. };
  100. &ehci1 {
  101. /* Enable if HSIC peripheral is connected */
  102. status = "disabled";
  103. };
  104. &ehci2 {
  105. status = "okay";
  106. };
  107. &gmac {
  108. pinctrl-names = "default";
  109. pinctrl-0 = <&gmac_rgmii_pins>;
  110. phy-handle = <&phy1>;
  111. phy-mode = "rgmii-id";
  112. phy-supply = <&reg_cldo1>;
  113. status = "okay";
  114. };
  115. &mdio {
  116. phy1: ethernet-phy@1 {
  117. reg = <1>;
  118. };
  119. };
  120. &mmc0 {
  121. pinctrl-names = "default";
  122. pinctrl-0 = <&mmc0_pins>;
  123. vmmc-supply = <&reg_dcdc1>;
  124. bus-width = <4>;
  125. cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH8 */
  126. status = "okay";
  127. };
  128. &mmc1 {
  129. pinctrl-names = "default";
  130. pinctrl-0 = <&mmc1_pins>;
  131. vmmc-supply = <&reg_dldo1>;
  132. vqmmc-supply = <&reg_cldo3>;
  133. mmc-pwrseq = <&wifi_pwrseq>;
  134. bus-width = <4>;
  135. non-removable;
  136. status = "okay";
  137. };
  138. &mmc1_pins {
  139. bias-pull-up;
  140. };
  141. &mmc2 {
  142. pinctrl-names = "default";
  143. pinctrl-0 = <&mmc2_8bit_pins>;
  144. vmmc-supply = <&reg_dcdc1>;
  145. bus-width = <8>;
  146. non-removable;
  147. cap-mmc-hw-reset;
  148. status = "okay";
  149. };
  150. &mmc2_8bit_pins {
  151. /* Increase drive strength for DDR modes */
  152. drive-strength = <40>;
  153. };
  154. &ohci0 {
  155. status = "okay";
  156. };
  157. &ohci2 {
  158. status = "okay";
  159. };
  160. &osc32k {
  161. /* osc32k input is from AC100 */
  162. clocks = <&ac100_rtc 0>;
  163. };
  164. &pio {
  165. vcc-pa-supply = <&reg_ldo_io1>;
  166. vcc-pb-supply = <&reg_aldo2>;
  167. vcc-pc-supply = <&reg_dcdc1>;
  168. vcc-pd-supply = <&reg_dcdc1>;
  169. vcc-pe-supply = <&reg_eldo2>;
  170. vcc-pf-supply = <&reg_dcdc1>;
  171. vcc-pg-supply = <&reg_ldo_io0>;
  172. vcc-ph-supply = <&reg_dcdc1>;
  173. };
  174. &r_ir {
  175. status = "okay";
  176. };
  177. &r_pio {
  178. vcc-pl-supply = <&reg_dldo2>;
  179. vcc-pm-supply = <&reg_eldo3>;
  180. };
  181. &r_rsb {
  182. status = "okay";
  183. axp809: pmic@3a3 {
  184. reg = <0x3a3>;
  185. interrupt-parent = <&nmi_intc>;
  186. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  187. regulators {
  188. reg_aldo1: aldo1 {
  189. /*
  190. * TODO: This should be handled by the
  191. * USB PHY driver.
  192. */
  193. regulator-always-on;
  194. regulator-min-microvolt = <3000000>;
  195. regulator-max-microvolt = <3000000>;
  196. regulator-name = "vcc33-usbh";
  197. };
  198. reg_aldo2: aldo2 {
  199. regulator-min-microvolt = <1800000>;
  200. regulator-max-microvolt = <1800000>;
  201. regulator-name = "vcc-pb-io-cam";
  202. };
  203. aldo3 {
  204. /* unused */
  205. };
  206. reg_dc5ldo: dc5ldo {
  207. regulator-always-on;
  208. regulator-min-microvolt = <800000>;
  209. regulator-max-microvolt = <1100000>;
  210. regulator-name = "vdd-cpus-09-usbh";
  211. };
  212. dc1sw {
  213. /* unused */
  214. };
  215. reg_dcdc1: dcdc1 {
  216. regulator-always-on;
  217. regulator-min-microvolt = <3000000>;
  218. regulator-max-microvolt = <3000000>;
  219. regulator-name = "vcc-3v";
  220. };
  221. reg_dcdc2: dcdc2 {
  222. regulator-min-microvolt = <800000>;
  223. regulator-max-microvolt = <1100000>;
  224. regulator-name = "vdd-gpu";
  225. };
  226. reg_dcdc3: dcdc3 {
  227. regulator-always-on;
  228. regulator-min-microvolt = <800000>;
  229. regulator-max-microvolt = <1100000>;
  230. regulator-name = "vdd-cpua";
  231. };
  232. reg_dcdc4: dcdc4 {
  233. regulator-always-on;
  234. regulator-min-microvolt = <800000>;
  235. regulator-max-microvolt = <1100000>;
  236. regulator-name = "vdd-sys-usb0-hdmi";
  237. };
  238. reg_dcdc5: dcdc5 {
  239. regulator-always-on;
  240. regulator-min-microvolt = <1425000>;
  241. regulator-max-microvolt = <1575000>;
  242. regulator-name = "vcc-dram";
  243. };
  244. reg_dldo1: dldo1 {
  245. /*
  246. * The WiFi chip supports a wide range
  247. * (3.0 ~ 4.8V) of voltages, and so does
  248. * this regulator (3.0 ~ 4.2V), but
  249. * Allwinner SDK always sets it to 3.3V.
  250. */
  251. regulator-min-microvolt = <3300000>;
  252. regulator-max-microvolt = <3300000>;
  253. regulator-name = "vcc-wifi";
  254. };
  255. reg_dldo2: dldo2 {
  256. regulator-min-microvolt = <3000000>;
  257. regulator-max-microvolt = <3000000>;
  258. regulator-name = "vcc-pl";
  259. };
  260. reg_eldo1: eldo1 {
  261. regulator-min-microvolt = <1200000>;
  262. regulator-max-microvolt = <1200000>;
  263. regulator-name = "vcc-dvdd-cam";
  264. };
  265. reg_eldo2: eldo2 {
  266. regulator-min-microvolt = <1800000>;
  267. regulator-max-microvolt = <1800000>;
  268. regulator-name = "vcc-pe";
  269. };
  270. reg_eldo3: eldo3 {
  271. regulator-min-microvolt = <3000000>;
  272. regulator-max-microvolt = <3000000>;
  273. regulator-name = "vcc-pm-codec-io1";
  274. };
  275. reg_ldo_io0: ldo_io0 {
  276. regulator-min-microvolt = <3000000>;
  277. regulator-max-microvolt = <3000000>;
  278. regulator-name = "vcc-pg";
  279. };
  280. reg_ldo_io1: ldo_io1 {
  281. regulator-min-microvolt = <2500000>;
  282. regulator-max-microvolt = <2500000>;
  283. regulator-name = "vcc-pa-gmac-2v5";
  284. };
  285. reg_rtc_ldo: rtc_ldo {
  286. regulator-name = "vcc-rtc-vdd1v8-io";
  287. };
  288. sw {
  289. /* unused */
  290. };
  291. };
  292. };
  293. axp806: pmic@745 {
  294. compatible = "x-powers,axp806";
  295. reg = <0x745>;
  296. interrupt-parent = <&nmi_intc>;
  297. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  298. interrupt-controller;
  299. #interrupt-cells = <1>;
  300. bldoin-supply = <&reg_dcdce>;
  301. regulators {
  302. reg_s_aldo1: aldo1 {
  303. regulator-always-on;
  304. regulator-min-microvolt = <3000000>;
  305. regulator-max-microvolt = <3000000>;
  306. regulator-name = "avcc";
  307. };
  308. aldo2 {
  309. /*
  310. * unused, but use a different name to
  311. * avoid name clash with axp809's aldo's
  312. */
  313. regulator-name = "s_aldo2";
  314. };
  315. aldo3 {
  316. /*
  317. * unused, but use a different name to
  318. * avoid name clash with axp809's aldo's
  319. */
  320. regulator-name = "s_aldo3";
  321. };
  322. reg_bldo1: bldo1 {
  323. regulator-always-on;
  324. regulator-min-microvolt = <1700000>;
  325. regulator-max-microvolt = <1900000>;
  326. regulator-name = "vcc18-efuse-adc-display-csi";
  327. };
  328. reg_bldo2: bldo2 {
  329. regulator-always-on;
  330. regulator-min-microvolt = <1700000>;
  331. regulator-max-microvolt = <1900000>;
  332. regulator-name =
  333. "vdd18-drampll-vcc18-pll-cpvdd";
  334. };
  335. bldo3 {
  336. /* unused */
  337. };
  338. reg_bldo4: bldo4 {
  339. regulator-min-microvolt = <1100000>;
  340. regulator-max-microvolt = <1300000>;
  341. regulator-name = "vcc12-hsic";
  342. };
  343. reg_cldo1: cldo1 {
  344. /*
  345. * This was 3V in the original design, but
  346. * 3.3V is the recommended supply voltage
  347. * for the Ethernet PHY.
  348. */
  349. regulator-min-microvolt = <3300000>;
  350. regulator-max-microvolt = <3300000>;
  351. /*
  352. * The PHY requires 20ms after all voltages
  353. * are applied until core logic is ready and
  354. * 30ms after the reset pin is de-asserted.
  355. * Set a 100ms delay to account for PMIC
  356. * ramp time and board traces.
  357. */
  358. regulator-enable-ramp-delay = <100000>;
  359. regulator-name = "vcc-gmac-phy";
  360. };
  361. reg_cldo2: cldo2 {
  362. regulator-min-microvolt = <2800000>;
  363. regulator-max-microvolt = <2800000>;
  364. regulator-name = "afvcc-cam";
  365. };
  366. reg_cldo3: cldo3 {
  367. regulator-min-microvolt = <3000000>;
  368. regulator-max-microvolt = <3000000>;
  369. regulator-name = "vcc-io-wifi-codec-io2";
  370. };
  371. reg_dcdca: dcdca {
  372. regulator-always-on;
  373. regulator-min-microvolt = <800000>;
  374. regulator-max-microvolt = <1100000>;
  375. regulator-name = "vdd-cpub";
  376. };
  377. reg_dcdcd: dcdcd {
  378. regulator-always-on;
  379. regulator-min-microvolt = <800000>;
  380. regulator-max-microvolt = <1100000>;
  381. regulator-name = "vdd-vpu";
  382. };
  383. reg_dcdce: dcdce {
  384. regulator-always-on;
  385. regulator-min-microvolt = <2100000>;
  386. regulator-max-microvolt = <2100000>;
  387. regulator-name = "vcc-bldo-codec-ldoin";
  388. };
  389. sw {
  390. /*
  391. * unused, but use a different name to
  392. * avoid name clash with axp809's sw
  393. */
  394. regulator-name = "s_sw";
  395. };
  396. };
  397. };
  398. ac100: codec@e89 {
  399. compatible = "x-powers,ac100";
  400. reg = <0xe89>;
  401. ac100_codec: codec {
  402. compatible = "x-powers,ac100-codec";
  403. interrupt-parent = <&r_pio>;
  404. interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
  405. #clock-cells = <0>;
  406. clock-output-names = "4M_adda";
  407. };
  408. ac100_rtc: rtc {
  409. compatible = "x-powers,ac100-rtc";
  410. interrupt-parent = <&nmi_intc>;
  411. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  412. clocks = <&ac100_codec>;
  413. #clock-cells = <1>;
  414. clock-output-names = "cko1_rtc",
  415. "cko2_rtc",
  416. "cko3_rtc";
  417. };
  418. };
  419. };
  420. #include "axp809.dtsi"
  421. &uart0 {
  422. pinctrl-names = "default";
  423. pinctrl-0 = <&uart0_ph_pins>;
  424. status = "okay";
  425. };
  426. &usbphy1 {
  427. phy-supply = <&reg_usb1_vbus>;
  428. status = "okay";
  429. };
  430. &usbphy2 {
  431. phy-supply = <&reg_bldo4>;
  432. /* Enable if HSIC peripheral is connected */
  433. status = "disabled";
  434. };
  435. &usbphy3 {
  436. phy-supply = <&reg_usb3_vbus>;
  437. status = "okay";
  438. };