sun9i-a80-optimus.dts 11 KB

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