sun8i-h3-beelink-x2.dts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * Copyright (C) 2017 Marcus Cooper <[email protected]>
  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 "sun8i-h3.dtsi"
  44. #include "sunxi-common-regulators.dtsi"
  45. #include <dt-bindings/gpio/gpio.h>
  46. #include <dt-bindings/input/input.h>
  47. / {
  48. model = "Beelink X2";
  49. compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
  50. aliases {
  51. serial0 = &uart0;
  52. ethernet0 = &emac;
  53. ethernet1 = &sdiowifi;
  54. };
  55. cec-gpio {
  56. compatible = "cec-gpio";
  57. cec-gpios = <&pio 0 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PA14 */
  58. hdmi-phandle = <&hdmi>;
  59. };
  60. chosen {
  61. stdout-path = "serial0:115200n8";
  62. };
  63. connector {
  64. compatible = "hdmi-connector";
  65. type = "a";
  66. port {
  67. hdmi_con_in: endpoint {
  68. remote-endpoint = <&hdmi_out_con>;
  69. };
  70. };
  71. };
  72. leds {
  73. compatible = "gpio-leds";
  74. led-0 {
  75. label = "beelink-x2:blue:pwr";
  76. gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
  77. default-state = "on";
  78. };
  79. led-1 {
  80. label = "beelink-x2:red:standby";
  81. gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */
  82. };
  83. };
  84. gpio-keys {
  85. compatible = "gpio-keys";
  86. key-power {
  87. label = "power";
  88. linux,code = <KEY_POWER>;
  89. gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
  90. wakeup-source;
  91. };
  92. };
  93. sound_spdif {
  94. compatible = "simple-audio-card";
  95. simple-audio-card,name = "On-board SPDIF";
  96. simple-audio-card,cpu {
  97. sound-dai = <&spdif>;
  98. };
  99. simple-audio-card,codec {
  100. sound-dai = <&spdif_out>;
  101. };
  102. };
  103. spdif_out: spdif-out {
  104. #sound-dai-cells = <0>;
  105. compatible = "linux,spdif-dit";
  106. };
  107. wifi_pwrseq: wifi_pwrseq {
  108. compatible = "mmc-pwrseq-simple";
  109. reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
  110. clocks = <&rtc CLK_OSC32K_FANOUT>;
  111. clock-names = "ext_clock";
  112. };
  113. };
  114. &de {
  115. status = "okay";
  116. };
  117. &ehci0 {
  118. status = "okay";
  119. };
  120. &ehci1 {
  121. status = "okay";
  122. };
  123. &emac {
  124. phy-handle = <&int_mii_phy>;
  125. phy-mode = "mii";
  126. allwinner,leds-active-low;
  127. status = "okay";
  128. };
  129. &hdmi {
  130. status = "okay";
  131. };
  132. &hdmi_out {
  133. hdmi_out_con: endpoint {
  134. remote-endpoint = <&hdmi_con_in>;
  135. };
  136. };
  137. &ir {
  138. linux,rc-map-name = "rc-tanix-tx3mini";
  139. pinctrl-names = "default";
  140. pinctrl-0 = <&r_ir_rx_pin>;
  141. status = "okay";
  142. };
  143. &mmc0 {
  144. vmmc-supply = <&reg_vcc3v3>;
  145. bus-width = <4>;
  146. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  147. status = "okay";
  148. };
  149. &mmc1 {
  150. vmmc-supply = <&reg_vcc3v3>;
  151. vqmmc-supply = <&reg_vcc3v3>;
  152. mmc-pwrseq = <&wifi_pwrseq>;
  153. bus-width = <4>;
  154. non-removable;
  155. status = "okay";
  156. /*
  157. * Explicitly define the sdio device, so that we can add an ethernet
  158. * alias for it (which e.g. makes u-boot set a mac-address).
  159. */
  160. sdiowifi: sdio_wifi@1 {
  161. reg = <1>;
  162. };
  163. };
  164. &mmc2 {
  165. pinctrl-names = "default";
  166. pinctrl-0 = <&mmc2_8bit_pins>;
  167. vmmc-supply = <&reg_vcc3v3>;
  168. bus-width = <8>;
  169. non-removable;
  170. cap-mmc-hw-reset;
  171. status = "okay";
  172. };
  173. &ohci0 {
  174. status = "okay";
  175. };
  176. &ohci1 {
  177. status = "okay";
  178. };
  179. &reg_usb0_vbus {
  180. gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
  181. status = "okay";
  182. };
  183. &spdif {
  184. pinctrl-names = "default";
  185. pinctrl-0 = <&spdif_tx_pin>;
  186. status = "okay";
  187. };
  188. &uart0 {
  189. pinctrl-names = "default";
  190. pinctrl-0 = <&uart0_pa_pins>;
  191. status = "okay";
  192. };
  193. &usb_otg {
  194. dr_mode = "otg";
  195. status = "okay";
  196. };
  197. &usbphy {
  198. /* USB VBUS is always on except for the OTG port */
  199. status = "okay";
  200. usb0_id_det-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA07 */
  201. usb0_vbus-supply = <&reg_usb0_vbus>;
  202. };