0001 /*
0002 * Copyright (C) 2017 Marcus Cooper <codekipper@gmail.com>
0003 *
0004 * This file is dual-licensed: you can use it either under the terms
0005 * of the GPL or the X11 license, at your option. Note that this dual
0006 * licensing only applies to this file, and not this project as a
0007 * whole.
0008 *
0009 * a) This file is free software; you can redistribute it and/or
0010 * modify it under the terms of the GNU General Public License as
0011 * published by the Free Software Foundation; either version 2 of the
0012 * License, or (at your option) any later version.
0013 *
0014 * This file is distributed in the hope that it will be useful,
0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 * GNU General Public License for more details.
0018 *
0019 * Or, alternatively,
0020 *
0021 * b) Permission is hereby granted, free of charge, to any person
0022 * obtaining a copy of this software and associated documentation
0023 * files (the "Software"), to deal in the Software without
0024 * restriction, including without limitation the rights to use,
0025 * copy, modify, merge, publish, distribute, sublicense, and/or
0026 * sell copies of the Software, and to permit persons to whom the
0027 * Software is furnished to do so, subject to the following
0028 * conditions:
0029 *
0030 * The above copyright notice and this permission notice shall be
0031 * included in all copies or substantial portions of the Software.
0032 *
0033 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0034 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0035 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0036 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0037 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0038 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0039 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0040 * OTHER DEALINGS IN THE SOFTWARE.
0041 */
0042
0043 /dts-v1/;
0044 #include "sun8i-h3.dtsi"
0045 #include "sunxi-common-regulators.dtsi"
0046
0047 #include <dt-bindings/gpio/gpio.h>
0048 #include <dt-bindings/input/input.h>
0049
0050 / {
0051 model = "Beelink X2";
0052 compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
0053
0054 aliases {
0055 serial0 = &uart0;
0056 ethernet0 = &emac;
0057 ethernet1 = &sdiowifi;
0058 };
0059
0060 cec-gpio {
0061 compatible = "cec-gpio";
0062 cec-gpios = <&pio 0 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PA14 */
0063 hdmi-phandle = <&hdmi>;
0064 };
0065
0066 chosen {
0067 stdout-path = "serial0:115200n8";
0068 };
0069
0070 connector {
0071 compatible = "hdmi-connector";
0072 type = "a";
0073
0074 port {
0075 hdmi_con_in: endpoint {
0076 remote-endpoint = <&hdmi_out_con>;
0077 };
0078 };
0079 };
0080
0081 leds {
0082 compatible = "gpio-leds";
0083
0084 led-0 {
0085 label = "beelink-x2:blue:pwr";
0086 gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
0087 default-state = "on";
0088 };
0089
0090 led-1 {
0091 label = "beelink-x2:red:standby";
0092 gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */
0093 };
0094 };
0095
0096 gpio-keys {
0097 compatible = "gpio-keys";
0098
0099 key-power {
0100 label = "power";
0101 linux,code = <KEY_POWER>;
0102 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0103 wakeup-source;
0104 };
0105 };
0106
0107 sound_spdif {
0108 compatible = "simple-audio-card";
0109 simple-audio-card,name = "On-board SPDIF";
0110
0111 simple-audio-card,cpu {
0112 sound-dai = <&spdif>;
0113 };
0114
0115 simple-audio-card,codec {
0116 sound-dai = <&spdif_out>;
0117 };
0118 };
0119
0120 spdif_out: spdif-out {
0121 #sound-dai-cells = <0>;
0122 compatible = "linux,spdif-dit";
0123 };
0124
0125 wifi_pwrseq: wifi_pwrseq {
0126 compatible = "mmc-pwrseq-simple";
0127 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0128 clocks = <&rtc CLK_OSC32K_FANOUT>;
0129 clock-names = "ext_clock";
0130 };
0131 };
0132
0133 &de {
0134 status = "okay";
0135 };
0136
0137 &ehci0 {
0138 status = "okay";
0139 };
0140
0141 &ehci1 {
0142 status = "okay";
0143 };
0144
0145 &emac {
0146 phy-handle = <&int_mii_phy>;
0147 phy-mode = "mii";
0148 allwinner,leds-active-low;
0149 status = "okay";
0150 };
0151
0152 &hdmi {
0153 status = "okay";
0154 };
0155
0156 &hdmi_out {
0157 hdmi_out_con: endpoint {
0158 remote-endpoint = <&hdmi_con_in>;
0159 };
0160 };
0161
0162 &ir {
0163 linux,rc-map-name = "rc-tanix-tx3mini";
0164 pinctrl-names = "default";
0165 pinctrl-0 = <&r_ir_rx_pin>;
0166 status = "okay";
0167 };
0168
0169 &mmc0 {
0170 vmmc-supply = <®_vcc3v3>;
0171 bus-width = <4>;
0172 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0173 status = "okay";
0174 };
0175
0176 &mmc1 {
0177 vmmc-supply = <®_vcc3v3>;
0178 vqmmc-supply = <®_vcc3v3>;
0179 mmc-pwrseq = <&wifi_pwrseq>;
0180 bus-width = <4>;
0181 non-removable;
0182 status = "okay";
0183
0184 /*
0185 * Explicitly define the sdio device, so that we can add an ethernet
0186 * alias for it (which e.g. makes u-boot set a mac-address).
0187 */
0188 sdiowifi: sdio_wifi@1 {
0189 reg = <1>;
0190 };
0191 };
0192
0193 &mmc2 {
0194 pinctrl-names = "default";
0195 pinctrl-0 = <&mmc2_8bit_pins>;
0196 vmmc-supply = <®_vcc3v3>;
0197 bus-width = <8>;
0198 non-removable;
0199 cap-mmc-hw-reset;
0200 status = "okay";
0201 };
0202
0203 &ohci0 {
0204 status = "okay";
0205 };
0206
0207 &ohci1 {
0208 status = "okay";
0209 };
0210
0211 ®_usb0_vbus {
0212 gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
0213 status = "okay";
0214 };
0215
0216 &spdif {
0217 pinctrl-names = "default";
0218 pinctrl-0 = <&spdif_tx_pin>;
0219 status = "okay";
0220 };
0221
0222 &uart0 {
0223 pinctrl-names = "default";
0224 pinctrl-0 = <&uart0_pa_pins>;
0225 status = "okay";
0226 };
0227
0228 &usb_otg {
0229 dr_mode = "otg";
0230 status = "okay";
0231 };
0232
0233 &usbphy {
0234 /* USB VBUS is always on except for the OTG port */
0235 status = "okay";
0236 usb0_id_det-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA07 */
0237 usb0_vbus-supply = <®_usb0_vbus>;
0238 };