sun5i-gr8-evb.dts 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /*
  2. * Copyright 2016 Free Electrons
  3. * Copyright 2016 NextThing Co
  4. *
  5. * Mylène Josserand <[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 "sun5i-gr8.dtsi"
  47. #include "sunxi-common-regulators.dtsi"
  48. #include <dt-bindings/gpio/gpio.h>
  49. #include <dt-bindings/input/input.h>
  50. #include <dt-bindings/interrupt-controller/irq.h>
  51. / {
  52. model = "NextThing GR8-EVB";
  53. compatible = "nextthing,gr8-evb", "nextthing,gr8";
  54. aliases {
  55. i2c0 = &i2c0;
  56. i2c1 = &i2c1;
  57. i2c2 = &i2c2;
  58. serial0 = &uart1;
  59. serial1 = &uart2;
  60. };
  61. chosen {
  62. stdout-path = "serial0:115200n8";
  63. };
  64. backlight: backlight {
  65. compatible = "pwm-backlight";
  66. pwms = <&pwm 0 10000 0>;
  67. enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
  68. power-supply = <&reg_vcc3v3>;
  69. brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
  70. default-brightness-level = <8>;
  71. };
  72. sound-analog {
  73. compatible = "simple-audio-card";
  74. simple-audio-card,name = "gr8-evb-wm8978";
  75. simple-audio-card,format = "i2s";
  76. simple-audio-card,mclk-fs = <512>;
  77. simple-audio-card,cpu {
  78. sound-dai = <&i2s0>;
  79. };
  80. simple-audio-card,codec {
  81. sound-dai = <&wm8978>;
  82. };
  83. };
  84. sound-spdif {
  85. compatible = "simple-audio-card";
  86. simple-audio-card,name = "On-board SPDIF";
  87. simple-audio-card,cpu {
  88. sound-dai = <&spdif>;
  89. };
  90. simple-audio-card,codec {
  91. sound-dai = <&spdif_out>;
  92. };
  93. };
  94. spdif_out: spdif-out {
  95. #sound-dai-cells = <0>;
  96. compatible = "linux,spdif-dit";
  97. };
  98. };
  99. &be0 {
  100. status = "okay";
  101. };
  102. &codec {
  103. status = "okay";
  104. };
  105. &ehci0 {
  106. status = "okay";
  107. };
  108. &i2c0 {
  109. status = "okay";
  110. axp209: pmic@34 {
  111. reg = <0x34>;
  112. /*
  113. * The interrupt is routed through the "External Fast
  114. * Interrupt Request" pin (ball G13 of the module)
  115. * directly to the main interrupt controller, without
  116. * any other controller interfering.
  117. */
  118. interrupts = <0>;
  119. };
  120. };
  121. #include "axp209.dtsi"
  122. &i2c1 {
  123. status = "okay";
  124. wm8978: codec@1a {
  125. #sound-dai-cells = <0>;
  126. compatible = "wlf,wm8978";
  127. reg = <0x1a>;
  128. };
  129. pcf8563: rtc@51 {
  130. compatible = "nxp,pcf8563";
  131. reg = <0x51>;
  132. };
  133. };
  134. &i2c2 {
  135. status = "okay";
  136. };
  137. &i2s0 {
  138. pinctrl-names = "default";
  139. pinctrl-0 = <&i2s0_mclk_pin>, <&i2s0_data_pins>;
  140. status = "okay";
  141. };
  142. &ir0 {
  143. pinctrl-names = "default";
  144. pinctrl-0 = <&ir0_rx_pin>;
  145. status = "okay";
  146. };
  147. &lradc {
  148. vref-supply = <&reg_ldo2>;
  149. status = "okay";
  150. button-190 {
  151. label = "Volume Up";
  152. linux,code = <KEY_VOLUMEUP>;
  153. channel = <0>;
  154. voltage = <190000>;
  155. };
  156. button-390 {
  157. label = "Volume Down";
  158. linux,code = <KEY_VOLUMEDOWN>;
  159. channel = <0>;
  160. voltage = <390000>;
  161. };
  162. button-600 {
  163. label = "Menu";
  164. linux,code = <KEY_MENU>;
  165. channel = <0>;
  166. voltage = <600000>;
  167. };
  168. button-800 {
  169. label = "Search";
  170. linux,code = <KEY_SEARCH>;
  171. channel = <0>;
  172. voltage = <800000>;
  173. };
  174. button-980 {
  175. label = "Home";
  176. linux,code = <KEY_HOMEPAGE>;
  177. channel = <0>;
  178. voltage = <980000>;
  179. };
  180. button-1180 {
  181. label = "Esc";
  182. linux,code = <KEY_ESC>;
  183. channel = <0>;
  184. voltage = <1180000>;
  185. };
  186. button-1400 {
  187. label = "Enter";
  188. linux,code = <KEY_ENTER>;
  189. channel = <0>;
  190. voltage = <1400000>;
  191. };
  192. };
  193. &mmc0 {
  194. vmmc-supply = <&reg_vcc3v3>;
  195. bus-width = <4>;
  196. cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
  197. status = "okay";
  198. };
  199. &nfc {
  200. pinctrl-names = "default";
  201. pinctrl-0 = <&nand_pins &nand_cs0_pin &nand_rb0_pin>;
  202. /* MLC Support sucks for now */
  203. status = "disabled";
  204. };
  205. &ohci0 {
  206. status = "okay";
  207. };
  208. &otg_sram {
  209. status = "okay";
  210. };
  211. &pwm {
  212. pinctrl-names = "default";
  213. pinctrl-0 = <&pwm0_pin>;
  214. status = "okay";
  215. };
  216. &reg_dcdc2 {
  217. regulator-min-microvolt = <1000000>;
  218. regulator-max-microvolt = <1400000>;
  219. regulator-name = "vdd-cpu";
  220. regulator-always-on;
  221. };
  222. &reg_dcdc3 {
  223. regulator-min-microvolt = <1000000>;
  224. regulator-max-microvolt = <1300000>;
  225. regulator-name = "vdd-sys";
  226. regulator-always-on;
  227. };
  228. &reg_ldo1 {
  229. regulator-name = "vdd-rtc";
  230. };
  231. &reg_ldo2 {
  232. regulator-min-microvolt = <2700000>;
  233. regulator-max-microvolt = <3300000>;
  234. regulator-name = "avcc";
  235. regulator-always-on;
  236. };
  237. &reg_usb1_vbus {
  238. gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
  239. status = "okay";
  240. };
  241. &rtp {
  242. allwinner,ts-attached;
  243. };
  244. &spdif {
  245. pinctrl-names = "default";
  246. pinctrl-0 = <&spdif_tx_pin>;
  247. status = "okay";
  248. };
  249. &tve0 {
  250. status = "okay";
  251. };
  252. &uart1 {
  253. pinctrl-names = "default";
  254. pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pins>;
  255. status = "okay";
  256. };
  257. &usb_otg {
  258. /*
  259. * The GR8-EVB has a somewhat interesting design. There's a
  260. * pin supposed to control VBUS, an ID pin, a VBUS detect pin,
  261. * so everything should work just fine.
  262. *
  263. * Except that the pin supposed to control VBUS is not
  264. * connected to any controllable output, neither to the SoC
  265. * through a GPIO or to the PMIC, and it is pulled down,
  266. * meaning that we will never be able to enable VBUS on this
  267. * board.
  268. */
  269. dr_mode = "otg";
  270. status = "okay";
  271. };
  272. &usb_power_supply {
  273. status = "okay";
  274. };
  275. &usbphy {
  276. usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
  277. usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
  278. usb0_vbus_power-supply = <&usb_power_supply>;
  279. usb1_vbus-supply = <&reg_usb1_vbus>;
  280. status = "okay";
  281. };