sun7i-a20-i12-tvbox.dts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /*
  2. * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
  3. *
  4. * This file is dual-licensed: you can use it either under the terms
  5. * of the GPL or the X11 license, at your option. Note that this dual
  6. * licensing only applies to this file, and not this project as a
  7. * whole.
  8. *
  9. * a) This file is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This file is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * Or, alternatively,
  20. *
  21. * b) Permission is hereby granted, free of charge, to any person
  22. * obtaining a copy of this software and associated documentation
  23. * files (the "Software"), to deal in the Software without
  24. * restriction, including without limitation the rights to use,
  25. * copy, modify, merge, publish, distribute, sublicense, and/or
  26. * sell copies of the Software, and to permit persons to whom the
  27. * Software is furnished to do so, subject to the following
  28. * conditions:
  29. *
  30. * The above copyright notice and this permission notice shall be
  31. * included in all copies or substantial portions of the Software.
  32. *
  33. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  34. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  35. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  36. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  37. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  38. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  39. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  40. * OTHER DEALINGS IN THE SOFTWARE.
  41. */
  42. /dts-v1/;
  43. #include "sun7i-a20.dtsi"
  44. #include "sunxi-common-regulators.dtsi"
  45. #include <dt-bindings/gpio/gpio.h>
  46. #include <dt-bindings/interrupt-controller/irq.h>
  47. #include <dt-bindings/pinctrl/sun4i-a10.h>
  48. / {
  49. model = "I12 / Q5 / QT840A A20 tvbox";
  50. compatible = "allwinner,i12-tvbox", "allwinner,sun7i-a20";
  51. aliases {
  52. serial0 = &uart0;
  53. };
  54. chosen {
  55. stdout-path = "serial0:115200n8";
  56. };
  57. leds {
  58. compatible = "gpio-leds";
  59. pinctrl-names = "default";
  60. pinctrl-0 = <&led_pins_i12_tvbox>;
  61. red {
  62. label = "i12_tvbox:red:usr";
  63. gpios = <&pio 7 9 GPIO_ACTIVE_LOW>;
  64. };
  65. blue {
  66. label = "i12_tvbox:blue:usr";
  67. gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
  68. };
  69. };
  70. reg_vmmc3: vmmc3 {
  71. compatible = "regulator-fixed";
  72. pinctrl-names = "default";
  73. pinctrl-0 = <&vmmc3_pin_i12_tvbox>;
  74. regulator-name = "vmmc3";
  75. regulator-min-microvolt = <3300000>;
  76. regulator-max-microvolt = <3300000>;
  77. enable-active-high;
  78. gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
  79. };
  80. reg_vmmc3_io: vmmc3-io {
  81. compatible = "regulator-fixed";
  82. pinctrl-names = "default";
  83. pinctrl-0 = <&vmmc3_io_pin_i12_tvbox>;
  84. regulator-name = "vmmc3-io";
  85. regulator-min-microvolt = <3300000>;
  86. regulator-max-microvolt = <3300000>;
  87. /* This controls VCC-PI, must be always on! */
  88. regulator-always-on;
  89. enable-active-high;
  90. gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
  91. };
  92. reg_gmac_3v3: gmac-3v3 {
  93. compatible = "regulator-fixed";
  94. pinctrl-names = "default";
  95. pinctrl-0 = <&gmac_power_pin_i12_tvbox>;
  96. regulator-name = "gmac-3v3";
  97. regulator-min-microvolt = <3300000>;
  98. regulator-max-microvolt = <3300000>;
  99. startup-delay-us = <50000>;
  100. enable-active-high;
  101. gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>;
  102. };
  103. };
  104. &ehci0 {
  105. status = "okay";
  106. };
  107. &ehci1 {
  108. status = "okay";
  109. };
  110. &gmac {
  111. pinctrl-names = "default";
  112. pinctrl-0 = <&gmac_pins_mii_a>;
  113. phy = <&phy1>;
  114. phy-mode = "mii";
  115. phy-supply = <&reg_gmac_3v3>;
  116. status = "okay";
  117. phy1: ethernet-phy@1 {
  118. reg = <1>;
  119. };
  120. };
  121. &i2c0 {
  122. pinctrl-names = "default";
  123. pinctrl-0 = <&i2c0_pins_a>;
  124. status = "okay";
  125. axp209: pmic@34 {
  126. compatible = "x-powers,axp209";
  127. reg = <0x34>;
  128. interrupt-parent = <&nmi_intc>;
  129. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  130. interrupt-controller;
  131. #interrupt-cells = <1>;
  132. };
  133. };
  134. &ir0 {
  135. pinctrl-names = "default";
  136. pinctrl-0 = <&ir0_rx_pins_a>;
  137. status = "okay";
  138. };
  139. &mmc0 {
  140. pinctrl-names = "default";
  141. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  142. vmmc-supply = <&reg_vcc3v3>;
  143. bus-width = <4>;
  144. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  145. cd-inverted;
  146. status = "okay";
  147. };
  148. &mmc3 {
  149. pinctrl-names = "default";
  150. pinctrl-0 = <&mmc3_pins_a>;
  151. vmmc-supply = <&reg_vmmc3>;
  152. bus-width = <4>;
  153. non-removable;
  154. status = "okay";
  155. brcmf: bcrmf@1 {
  156. reg = <1>;
  157. compatible = "brcm,bcm4329-fmac";
  158. interrupt-parent = <&pio>;
  159. interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
  160. interrupt-names = "host-wake";
  161. };
  162. };
  163. &mmc3_pins_a {
  164. /* AP6210 / AP6330 requires pull-up */
  165. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  166. };
  167. &ohci0 {
  168. status = "okay";
  169. };
  170. &ohci1 {
  171. status = "okay";
  172. };
  173. &pio {
  174. vmmc3_pin_i12_tvbox: vmmc3_pin@0 {
  175. allwinner,pins = "PH2";
  176. allwinner,function = "gpio_out";
  177. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  178. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  179. };
  180. vmmc3_io_pin_i12_tvbox: vmmc3_io_pin@0 {
  181. allwinner,pins = "PH12";
  182. allwinner,function = "gpio_out";
  183. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  184. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  185. };
  186. gmac_power_pin_i12_tvbox: gmac_power_pin@0 {
  187. allwinner,pins = "PH21";
  188. allwinner,function = "gpio_out";
  189. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  190. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  191. };
  192. led_pins_i12_tvbox: led_pins@0 {
  193. allwinner,pins = "PH9", "PH20";
  194. allwinner,function = "gpio_out";
  195. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  196. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  197. };
  198. };
  199. &reg_usb1_vbus {
  200. status = "okay";
  201. };
  202. &reg_usb2_vbus {
  203. status = "okay";
  204. };
  205. &uart0 {
  206. pinctrl-names = "default";
  207. pinctrl-0 = <&uart0_pins_a>;
  208. status = "okay";
  209. };
  210. &usbphy {
  211. usb1_vbus-supply = <&reg_usb1_vbus>;
  212. usb2_vbus-supply = <&reg_usb2_vbus>;
  213. status = "okay";
  214. };