sun7i-a20-hummingbird.dts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /*
  2. * Copyright 2013 Wills Wang
  3. *
  4. * Wills Wang <wills.wang.open@gmail.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 "sun7i-a20.dtsi"
  46. #include "sunxi-common-regulators.dtsi"
  47. #include <dt-bindings/gpio/gpio.h>
  48. #include <dt-bindings/interrupt-controller/irq.h>
  49. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50. / {
  51. model = "Merrii A20 Hummingbird";
  52. compatible = "merrii,a20-hummingbird", "allwinner,sun7i-a20";
  53. aliases {
  54. serial0 = &uart0;
  55. serial1 = &uart2;
  56. serial2 = &uart3;
  57. serial3 = &uart4;
  58. serial4 = &uart5;
  59. };
  60. chosen {
  61. stdout-path = "serial0:115200n8";
  62. };
  63. reg_mmc3_vdd: mmc3_vdd {
  64. compatible = "regulator-fixed";
  65. pinctrl-names = "default";
  66. pinctrl-0 = <&mmc3_vdd_pin_a20_hummingbird>;
  67. regulator-name = "mmc3_vdd";
  68. regulator-min-microvolt = <3000000>;
  69. regulator-max-microvolt = <3000000>;
  70. enable-active-high;
  71. gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
  72. };
  73. reg_gmac_vdd: gmac_vdd {
  74. compatible = "regulator-fixed";
  75. pinctrl-names = "default";
  76. pinctrl-0 = <&gmac_vdd_pin_a20_hummingbird>;
  77. regulator-name = "gmac_vdd";
  78. regulator-min-microvolt = <3000000>;
  79. regulator-max-microvolt = <3000000>;
  80. enable-active-high;
  81. gpio = <&pio 7 16 GPIO_ACTIVE_HIGH>; /* PH16 */
  82. };
  83. };
  84. &ahci {
  85. target-supply = <&reg_ahci_5v>;
  86. status = "okay";
  87. };
  88. &ehci0 {
  89. status = "okay";
  90. };
  91. &ehci1 {
  92. status = "okay";
  93. };
  94. &gmac {
  95. pinctrl-names = "default";
  96. pinctrl-0 = <&gmac_pins_rgmii_a>;
  97. phy = <&phy1>;
  98. phy-mode = "rgmii";
  99. phy-supply = <&reg_gmac_vdd>;
  100. /* phy reset config */
  101. snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
  102. snps,reset-active-low;
  103. /* wait 1s after reset, otherwise fail to read phy id */
  104. snps,reset-delays-us = <0 10000 1000000>;
  105. status = "okay";
  106. phy1: ethernet-phy@1 {
  107. reg = <1>;
  108. };
  109. };
  110. &i2c0 {
  111. pinctrl-names = "default";
  112. pinctrl-0 = <&i2c0_pins_a>;
  113. status = "okay";
  114. axp209: pmic@34 {
  115. compatible = "x-powers,axp209";
  116. reg = <0x34>;
  117. interrupt-parent = <&nmi_intc>;
  118. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  119. interrupt-controller;
  120. #interrupt-cells = <1>;
  121. };
  122. };
  123. &i2c1 {
  124. pinctrl-names = "default";
  125. pinctrl-0 = <&i2c1_pins_a>;
  126. status = "okay";
  127. };
  128. &i2c2 {
  129. pinctrl-names = "default";
  130. pinctrl-0 = <&i2c2_pins_a>;
  131. status = "okay";
  132. };
  133. &i2c3 {
  134. pinctrl-names = "default";
  135. pinctrl-0 = <&i2c3_pins_a>;
  136. status = "okay";
  137. };
  138. &ir0 {
  139. pinctrl-names = "default";
  140. pinctrl-0 = <&ir0_rx_pins_a>;
  141. status = "okay";
  142. };
  143. &mmc0 {
  144. pinctrl-names = "default";
  145. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  146. vmmc-supply = <&reg_vcc3v0>;
  147. bus-width = <4>;
  148. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  149. cd-inverted;
  150. status = "okay";
  151. };
  152. &mmc3 {
  153. pinctrl-names = "default";
  154. pinctrl-0 = <&mmc3_pins_a>;
  155. vmmc-supply = <&reg_mmc3_vdd>;
  156. bus-width = <4>;
  157. non-removable;
  158. status = "okay";
  159. };
  160. &ohci0 {
  161. status = "okay";
  162. };
  163. &ohci1 {
  164. status = "okay";
  165. };
  166. &pio {
  167. ahci_pwr_pin_a20_hummingbird: ahci_pwr_pin@0 {
  168. allwinner,pins = "PH15";
  169. allwinner,function = "gpio_out";
  170. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  171. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  172. };
  173. usb1_vbus_pin_a20_hummingbird: usb1_vbus_pin@0 {
  174. allwinner,pins = "PH2";
  175. allwinner,function = "gpio_out";
  176. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  177. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  178. };
  179. mmc3_vdd_pin_a20_hummingbird: mmc3_vdd_pin@0 {
  180. allwinner,pins = "PH9";
  181. allwinner,function = "gpio_out";
  182. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  183. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  184. };
  185. gmac_vdd_pin_a20_hummingbird: gmac_vdd_pin@0 {
  186. allwinner,pins = "PH16";
  187. allwinner,function = "gpio_out";
  188. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  189. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  190. };
  191. };
  192. &pwm {
  193. pinctrl-names = "default";
  194. pinctrl-0 = <&pwm0_pins_a>;
  195. status = "okay";
  196. };
  197. &reg_ahci_5v {
  198. pinctrl-0 = <&ahci_pwr_pin_a20_hummingbird>;
  199. gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
  200. status = "okay";
  201. };
  202. &reg_usb1_vbus {
  203. pinctrl-0 = <&usb1_vbus_pin_a20_hummingbird>;
  204. gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
  205. status = "okay";
  206. };
  207. &reg_usb2_vbus {
  208. status = "okay";
  209. };
  210. &spi2 {
  211. pinctrl-names = "default";
  212. pinctrl-0 = <&spi2_pins_b>,
  213. <&spi2_cs0_pins_b>;
  214. status = "okay";
  215. };
  216. &uart0 {
  217. pinctrl-names = "default";
  218. pinctrl-0 = <&uart0_pins_a>;
  219. status = "okay";
  220. };
  221. &uart2 {
  222. pinctrl-names = "default";
  223. pinctrl-0 = <&uart2_pins_a>;
  224. status = "okay";
  225. };
  226. &uart3 {
  227. pinctrl-names = "default";
  228. pinctrl-0 = <&uart3_pins_a>;
  229. status = "okay";
  230. };
  231. &uart4 {
  232. pinctrl-names = "default";
  233. pinctrl-0 = <&uart4_pins_a>;
  234. status = "okay";
  235. };
  236. &uart5 {
  237. pinctrl-names = "default";
  238. pinctrl-0 = <&uart5_pins_a>;
  239. status = "okay";
  240. };
  241. &usbphy {
  242. usb1_vbus-supply = <&reg_usb1_vbus>;
  243. usb2_vbus-supply = <&reg_usb2_vbus>;
  244. status = "okay";
  245. };