sun8i-r16-parrot.dts 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. /*
  2. * Copyright 2016 Quentin Schulz
  3. *
  4. * Quentin Schulz <quentin.schulz@free-electrons.com>
  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-a33.dtsi"
  46. #include "sunxi-common-regulators.dtsi"
  47. #include <dt-bindings/gpio/gpio.h>
  48. #include <dt-bindings/input/input.h>
  49. / {
  50. model = "Allwinner R16 EVB (Parrot)";
  51. compatible = "allwinner,parrot", "allwinner,sun8i-a33";
  52. aliases {
  53. serial0 = &uart0;
  54. };
  55. chosen {
  56. stdout-path = "serial0:115200n8";
  57. };
  58. leds {
  59. compatible = "gpio-leds";
  60. pinctrl-names = "default";
  61. pinctrl-0 = <&led_pins_parrot>;
  62. led1 {
  63. label = "parrot:led1:usr";
  64. gpio = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
  65. };
  66. led2 {
  67. label = "parrot:led2:usr";
  68. gpio = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */
  69. };
  70. };
  71. wifi_pwrseq: wifi_pwrseq {
  72. compatible = "mmc-pwrseq-simple";
  73. reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
  74. };
  75. };
  76. &ehci0 {
  77. status = "okay";
  78. };
  79. &i2c1 {
  80. pinctrl-names = "default";
  81. pinctrl-0 = <&i2c1_pins_a>;
  82. status = "okay";
  83. /*
  84. * FIXME: An as-yet-unknown accelerometer is connected to this
  85. * i2c bus.
  86. */
  87. };
  88. &lradc {
  89. vref-supply = <&reg_aldo3>;
  90. status = "okay";
  91. button@0 {
  92. label = "V+";
  93. linux,code = <KEY_VOLUMEUP>;
  94. channel = <0>;
  95. voltage = <190000>;
  96. };
  97. button@1 {
  98. label = "V-";
  99. linux,code = <KEY_VOLUMEDOWN>;
  100. channel = <0>;
  101. voltage = <390000>;
  102. };
  103. };
  104. &mmc0 {
  105. pinctrl-names = "default";
  106. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_parrot>;
  107. vmmc-supply = <&reg_dcdc1>;
  108. cd-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
  109. bus-width = <4>;
  110. status = "okay";
  111. };
  112. &mmc1 {
  113. pinctrl-names = "default";
  114. pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_parrot>;
  115. vmmc-supply = <&reg_aldo1>;
  116. mmc-pwrseq = <&wifi_pwrseq>;
  117. bus-width = <4>;
  118. non-removable;
  119. status = "okay";
  120. };
  121. &mmc2 {
  122. pinctrl-names = "default";
  123. pinctrl-0 = <&mmc2_8bit_pins>;
  124. vmmc-supply = <&reg_dcdc1>;
  125. bus-width = <8>;
  126. non-removable;
  127. cap-mmc-hw-reset;
  128. status = "okay";
  129. };
  130. &mmc2_8bit_pins {
  131. allwinner,drive = <SUN4I_PINCTRL_40_MA>;
  132. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  133. };
  134. &ohci0 {
  135. status = "okay";
  136. };
  137. &pio {
  138. mmc0_cd_pin_parrot: mmc0_cd_pin@0 {
  139. allwinner,pins = "PD14";
  140. allwinner,function = "gpio_in";
  141. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  142. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  143. };
  144. led_pins_parrot: led_pins@0 {
  145. allwinner,pins = "PE16", "PE17";
  146. allwinner,function = "gpio_out";
  147. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  148. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  149. };
  150. usb0_id_det: usb0_id_detect_pin@0 {
  151. allwinner,pins = "PD10";
  152. allwinner,function = "gpio_in";
  153. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  154. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  155. };
  156. usb1_vbus_pin_parrot: usb1_vbus_pin@0 {
  157. allwinner,pins = "PD12";
  158. allwinner,function = "gpio_out";
  159. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  160. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  161. };
  162. };
  163. &r_pio {
  164. wifi_reset_pin_parrot: wifi_reset_pin@0 {
  165. allwinner,pins = "PL6";
  166. allwinner,function = "gpio_out";
  167. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  168. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  169. };
  170. };
  171. &r_rsb {
  172. status = "okay";
  173. axp22x: pmic@3a3 {
  174. compatible = "x-powers,axp223";
  175. reg = <0x3a3>;
  176. interrupt-parent = <&nmi_intc>;
  177. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  178. drivevbus-supply = <&reg_vcc5v0>;
  179. x-powers,drive-vbus-en;
  180. };
  181. };
  182. #include "axp22x.dtsi"
  183. &reg_aldo1 {
  184. regulator-always-on;
  185. regulator-min-microvolt = <3000000>;
  186. regulator-max-microvolt = <3000000>;
  187. regulator-name = "vcc-io";
  188. };
  189. &reg_aldo2 {
  190. regulator-always-on;
  191. regulator-min-microvolt = <2350000>;
  192. regulator-max-microvolt = <2650000>;
  193. regulator-name = "vdd-dll";
  194. };
  195. &reg_aldo3 {
  196. regulator-always-on;
  197. regulator-min-microvolt = <2700000>;
  198. regulator-max-microvolt = <3300000>;
  199. regulator-name = "vcc-pll-avcc";
  200. };
  201. &reg_dc5ldo {
  202. regulator-always-on;
  203. regulator-min-microvolt = <900000>;
  204. regulator-max-microvolt = <1400000>;
  205. regulator-name = "vdd-cpus";
  206. };
  207. &reg_dcdc1 {
  208. regulator-always-on;
  209. regulator-min-microvolt = <3000000>;
  210. regulator-max-microvolt = <3000000>;
  211. regulator-name = "vcc-3v0";
  212. };
  213. &reg_dcdc2 {
  214. regulator-always-on;
  215. regulator-min-microvolt = <900000>;
  216. regulator-max-microvolt = <1400000>;
  217. regulator-name = "vdd-sys";
  218. };
  219. &reg_dcdc3 {
  220. regulator-always-on;
  221. regulator-min-microvolt = <900000>;
  222. regulator-max-microvolt = <1400000>;
  223. regulator-name = "vdd-cpu";
  224. };
  225. &reg_dcdc5 {
  226. regulator-always-on;
  227. regulator-min-microvolt = <1500000>;
  228. regulator-max-microvolt = <1500000>;
  229. regulator-name = "vcc-dram";
  230. };
  231. &reg_dldo1 {
  232. /*
  233. * TODO: WiFi chip needs dldo1 AND dldo2 to be on to be powered.
  234. * Remove next line once it is possible to sync two regulators.
  235. */
  236. regulator-always-on;
  237. regulator-min-microvolt = <3300000>;
  238. regulator-max-microvolt = <3300000>;
  239. regulator-name = "vcc-wifi0";
  240. };
  241. &reg_dldo2 {
  242. /*
  243. * TODO: WiFi chip needs dldo1 AND dldo2 to be on to be powered.
  244. * Remove next line once it is possible to sync two regulators.
  245. */
  246. regulator-always-on;
  247. regulator-min-microvolt = <3300000>;
  248. regulator-max-microvolt = <3300000>;
  249. regulator-name = "vcc-wifi1";
  250. };
  251. &reg_dldo3 {
  252. regulator-min-microvolt = <3000000>;
  253. regulator-max-microvolt = <3000000>;
  254. regulator-name = "vcc-3v0-csi";
  255. };
  256. &reg_drivevbus {
  257. regulator-name = "usb0-vbus";
  258. status = "okay";
  259. };
  260. &reg_eldo1 {
  261. regulator-min-microvolt = <1200000>;
  262. regulator-max-microvolt = <1200000>;
  263. regulator-name = "vcc-1v2-hsic";
  264. };
  265. &reg_eldo2 {
  266. regulator-min-microvolt = <3000000>;
  267. regulator-max-microvolt = <3000000>;
  268. regulator-name = "vcc-dsp";
  269. };
  270. &reg_eldo3 {
  271. regulator-min-microvolt = <3000000>;
  272. regulator-max-microvolt = <3000000>;
  273. regulator-name = "eldo3";
  274. };
  275. &reg_usb1_vbus {
  276. pinctrl-names = "default";
  277. pinctrl-0 = <&usb1_vbus_pin_parrot>;
  278. gpio = <&pio 3 12 GPIO_ACTIVE_HIGH>; /* PD12 */
  279. status = "okay";
  280. };
  281. &uart0 {
  282. pinctrl-names = "default";
  283. pinctrl-0 = <&uart0_pins_b>;
  284. status = "okay";
  285. };
  286. &usb_otg {
  287. dr_mode = "otg";
  288. status = "okay";
  289. };
  290. &usb_power_supply {
  291. status = "okay";
  292. };
  293. &usbphy {
  294. status = "okay";
  295. pinctrl-names = "default";
  296. pinctrl-0 = <&usb0_id_det>;
  297. usb0_vbus-supply = <&reg_drivevbus>;
  298. usb0_id_det-gpios = <&pio 3 10 GPIO_ACTIVE_HIGH>; /* PD10 */
  299. usb0_vbus_power-supply = <&usb_power_supply>;
  300. usb1_vbus-supply = <&reg_usb1_vbus>;
  301. };