sun7i-a20-olimex-som-evb.dts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. /*
  2. * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
  3. * Copyright 2015 - Karsten Merker <merker@debian.org>
  4. *
  5. * This file is dual-licensed: you can use it either under the terms
  6. * of the GPL or the X11 license, at your option. Note that this dual
  7. * licensing only applies to this file, and not this project as a
  8. * whole.
  9. *
  10. * a) This file is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This file is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * Or, alternatively,
  21. *
  22. * b) Permission is hereby granted, free of charge, to any person
  23. * obtaining a copy of this software and associated documentation
  24. * files (the "Software"), to deal in the Software without
  25. * restriction, including without limitation the rights to use,
  26. * copy, modify, merge, publish, distribute, sublicense, and/or
  27. * sell copies of the Software, and to permit persons to whom the
  28. * Software is furnished to do so, subject to the following
  29. * conditions:
  30. *
  31. * The above copyright notice and this permission notice shall be
  32. * included in all copies or substantial portions of the Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  35. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  36. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  37. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  38. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  39. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  40. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  41. * OTHER DEALINGS IN THE SOFTWARE.
  42. */
  43. /dts-v1/;
  44. #include "sun7i-a20.dtsi"
  45. #include "sunxi-common-regulators.dtsi"
  46. #include <dt-bindings/gpio/gpio.h>
  47. #include <dt-bindings/input/input.h>
  48. #include <dt-bindings/interrupt-controller/irq.h>
  49. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50. / {
  51. model = "Olimex A20-Olimex-SOM-EVB";
  52. compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
  53. aliases {
  54. serial0 = &uart0;
  55. };
  56. chosen {
  57. stdout-path = "serial0:115200n8";
  58. };
  59. leds {
  60. compatible = "gpio-leds";
  61. pinctrl-names = "default";
  62. pinctrl-0 = <&led_pins_olimex_som_evb>;
  63. green {
  64. label = "a20-olimex-som-evb:green:usr";
  65. gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
  66. default-state = "on";
  67. };
  68. };
  69. };
  70. &ahci {
  71. target-supply = <&reg_ahci_5v>;
  72. status = "okay";
  73. };
  74. &ehci0 {
  75. status = "okay";
  76. };
  77. &ehci1 {
  78. status = "okay";
  79. };
  80. &codec {
  81. status = "okay";
  82. };
  83. &gmac {
  84. pinctrl-names = "default";
  85. pinctrl-0 = <&gmac_pins_rgmii_a>;
  86. phy = <&phy1>;
  87. phy-mode = "rgmii";
  88. status = "okay";
  89. phy1: ethernet-phy@1 {
  90. reg = <1>;
  91. };
  92. };
  93. &i2c0 {
  94. pinctrl-names = "default";
  95. pinctrl-0 = <&i2c0_pins_a>;
  96. status = "okay";
  97. axp209: pmic@34 {
  98. reg = <0x34>;
  99. interrupt-parent = <&nmi_intc>;
  100. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  101. };
  102. };
  103. &lradc {
  104. vref-supply = <&reg_vcc3v0>;
  105. status = "okay";
  106. button@190 {
  107. label = "Volume Up";
  108. linux,code = <KEY_VOLUMEUP>;
  109. channel = <0>;
  110. voltage = <190000>;
  111. };
  112. button@390 {
  113. label = "Volume Down";
  114. linux,code = <KEY_VOLUMEDOWN>;
  115. channel = <0>;
  116. voltage = <390000>;
  117. };
  118. button@600 {
  119. label = "Menu";
  120. linux,code = <KEY_MENU>;
  121. channel = <0>;
  122. voltage = <600000>;
  123. };
  124. button@800 {
  125. label = "Search";
  126. linux,code = <KEY_SEARCH>;
  127. channel = <0>;
  128. voltage = <800000>;
  129. };
  130. button@980 {
  131. label = "Home";
  132. linux,code = <KEY_HOMEPAGE>;
  133. channel = <0>;
  134. voltage = <980000>;
  135. };
  136. button@1180 {
  137. label = "Esc";
  138. linux,code = <KEY_ESC>;
  139. channel = <0>;
  140. voltage = <1180000>;
  141. };
  142. button@1400 {
  143. label = "Enter";
  144. linux,code = <KEY_ENTER>;
  145. channel = <0>;
  146. voltage = <1400000>;
  147. };
  148. };
  149. &mmc0 {
  150. pinctrl-names = "default";
  151. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  152. vmmc-supply = <&reg_vcc3v3>;
  153. bus-width = <4>;
  154. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  155. cd-inverted;
  156. status = "okay";
  157. };
  158. &mmc3 {
  159. pinctrl-names = "default";
  160. pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
  161. vmmc-supply = <&reg_vcc3v3>;
  162. bus-width = <4>;
  163. cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
  164. cd-inverted;
  165. status = "okay";
  166. };
  167. &ohci0 {
  168. status = "okay";
  169. };
  170. &ohci1 {
  171. status = "okay";
  172. };
  173. &otg_sram {
  174. status = "okay";
  175. };
  176. &pio {
  177. ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin@1 {
  178. allwinner,pins = "PC3";
  179. allwinner,function = "gpio_out";
  180. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  181. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  182. };
  183. led_pins_olimex_som_evb: led_pins@0 {
  184. allwinner,pins = "PH2";
  185. allwinner,function = "gpio_out";
  186. allwinner,drive = <SUN4I_PINCTRL_20_MA>;
  187. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  188. };
  189. mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 {
  190. allwinner,pins = "PH0";
  191. allwinner,function = "gpio_in";
  192. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  193. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  194. };
  195. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  196. allwinner,pins = "PH4";
  197. allwinner,function = "gpio_in";
  198. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  199. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  200. };
  201. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  202. allwinner,pins = "PH5";
  203. allwinner,function = "gpio_in";
  204. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  205. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  206. };
  207. };
  208. &reg_ahci_5v {
  209. pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
  210. gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
  211. status = "okay";
  212. };
  213. #include "axp209.dtsi"
  214. &reg_dcdc2 {
  215. regulator-always-on;
  216. regulator-min-microvolt = <1000000>;
  217. regulator-max-microvolt = <1400000>;
  218. regulator-name = "vdd-cpu";
  219. };
  220. &reg_dcdc3 {
  221. regulator-always-on;
  222. regulator-min-microvolt = <1000000>;
  223. regulator-max-microvolt = <1400000>;
  224. regulator-name = "vdd-int-dll";
  225. };
  226. &reg_ldo1 {
  227. regulator-name = "vdd-rtc";
  228. };
  229. &reg_ldo2 {
  230. regulator-always-on;
  231. regulator-min-microvolt = <3000000>;
  232. regulator-max-microvolt = <3000000>;
  233. regulator-name = "avcc";
  234. };
  235. &reg_usb0_vbus {
  236. status = "okay";
  237. };
  238. &reg_usb1_vbus {
  239. status = "okay";
  240. };
  241. &reg_usb2_vbus {
  242. status = "okay";
  243. };
  244. &uart0 {
  245. pinctrl-names = "default";
  246. pinctrl-0 = <&uart0_pins_a>;
  247. status = "okay";
  248. };
  249. &usb_otg {
  250. dr_mode = "otg";
  251. status = "okay";
  252. };
  253. &usbphy {
  254. pinctrl-names = "default";
  255. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  256. usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */
  257. usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */
  258. usb0_vbus-supply = <&reg_usb0_vbus>;
  259. usb1_vbus-supply = <&reg_usb1_vbus>;
  260. usb2_vbus-supply = <&reg_usb2_vbus>;
  261. status = "okay";
  262. };