GNU Linux-libre 4.14.251-gnu1
[releases.git] / arch / arm64 / boot / dts / amlogic / meson-gxl-s905x-khadas-vim.dts
1 /*
2  * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
3  *
4  * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5  */
6
7 /dts-v1/;
8
9 #include <dt-bindings/input/input.h>
10
11 #include "meson-gxl-s905x-p212.dtsi"
12
13 / {
14         compatible = "khadas,vim", "amlogic,s905x", "amlogic,meson-gxl";
15         model = "Khadas VIM";
16
17         adc-keys {
18                 compatible = "adc-keys";
19                 io-channels = <&saradc 0>;
20                 io-channel-names = "buttons";
21                 keyup-threshold-microvolt = <1710000>;
22
23                 button-function {
24                         label = "Function";
25                         linux,code = <KEY_FN>;
26                         press-threshold-microvolt = <10000>;
27                 };
28         };
29
30         aliases {
31                 serial2 = &uart_AO_B;
32         };
33
34         gpio-keys-polled {
35                 compatible = "gpio-keys-polled";
36                 poll-interval = <100>;
37
38                 power-button {
39                         label = "power";
40                         linux,code = <KEY_POWER>;
41                         gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
42                 };
43         };
44
45         pwmleds {
46                 compatible = "pwm-leds";
47
48                 power {
49                         label = "vim:red:power";
50                         pwms = <&pwm_AO_ab 1 7812500 0>;
51                         max-brightness = <255>;
52                         linux,default-trigger = "default-on";
53                 };
54         };
55
56         hdmi-connector {
57                 compatible = "hdmi-connector";
58                 type = "a";
59
60                 port {
61                         hdmi_connector_in: endpoint {
62                                 remote-endpoint = <&hdmi_tx_tmds_out>;
63                         };
64                 };
65         };
66 };
67
68 &cec_AO {
69         status = "okay";
70         pinctrl-0 = <&ao_cec_pins>;
71         pinctrl-names = "default";
72         hdmi-phandle = <&hdmi_tx>;
73 };
74
75 &hdmi_tx {
76         status = "okay";
77         pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
78         pinctrl-names = "default";
79 };
80
81 &hdmi_tx_tmds_port {
82         hdmi_tx_tmds_out: endpoint {
83                 remote-endpoint = <&hdmi_connector_in>;
84         };
85 };
86
87 &i2c_A {
88         status = "okay";
89         pinctrl-0 = <&i2c_a_pins>;
90         pinctrl-names = "default";
91 };
92
93 &i2c_B {
94         status = "okay";
95         pinctrl-0 = <&i2c_b_pins>;
96         pinctrl-names = "default";
97
98         rtc: rtc@51 {
99                 /* has to be enabled manually when a battery is connected: */
100                 status = "disabled";
101                 compatible = "haoyu,hym8563";
102                 reg = <0x51>;
103                 #clock-cells = <0>;
104                 clock-frequency = <32768>;
105                 clock-output-names = "xin32k";
106         };
107 };
108
109 &ir {
110         linux,rc-map-name = "rc-geekbox";
111 };
112
113 &gpio_ao {
114         gpio-line-names = "UART TX",
115                           "UART RX",
116                           "Power Key In",
117                           "J9 Header Pin35",
118                           "J9 Header Pin16",
119                           "J9 Header Pin15",
120                           "J9 Header Pin33",
121                           "IR In",
122                           "HDMI CEC",
123                           "SYS LED";
124 };
125
126 &gpio {
127         gpio-line-names = /* Bank GPIOZ */
128                           "", "", "", "", "", "", "",
129                           "", "", "", "", "", "", "",
130                           "Power OFF",
131                           "VCCK Enable",
132                           /* Bank GPIOH */
133                           "HDMI HPD", "HDMI SDA", "HDMI SCL",
134                           "HDMI_5V_EN", "SPDIF",
135                           "J9 Header Pin37",
136                           "J9 Header Pin30",
137                           "J9 Header Pin29",
138                           "J9 Header Pin32",
139                           "J9 Header Pin31",
140                           /* Bank BOOT */
141                           "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
142                           "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
143                           "eMMC Clk", "eMMC Reset", "eMMC CMD",
144                           "", "BOOT_MODE", "", "", "eMMC Data Strobe",
145                           /* Bank CARD */
146                           "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
147                           "SDCard D3", "SDCard D2", "SDCard Det",
148                           /* Bank GPIODV */
149                           "", "", "", "", "", "", "", "", "", "", "", "",
150                           "", "", "", "", "", "", "", "", "", "", "", "",
151                           "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
152                           "VCCK Regulator", "VDDEE Regulator",
153                           /* Bank GPIOX */
154                           "WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2",
155                           "WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD",
156                           "WIFI Power Enable", "WIFI WAKE HOST",
157                           "Bluetooth PCM DOUT", "Bluetooth PCM DIN",
158                           "Bluetooth PCM SYNC", "Bluetooth PCM CLK",
159                           "Bluetooth UART TX", "Bluetooth UART RX",
160                           "Bluetooth UART CTS", "Bluetooth UART RTS",
161                           "WIFI 32K", "Bluetooth Enable",
162                           "Bluetooth WAKE HOST",
163                           /* Bank GPIOCLK */
164                           "", "J9 Header Pin39",
165                           /* GPIO_TEST_N */
166                           "";
167 };
168
169 &pwm_AO_ab {
170         status = "okay";
171         pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
172         pinctrl-names = "default";
173         clocks = <&xtal> , <&xtal>;
174         clock-names = "clkin0", "clkin1" ;
175 };
176
177 &pwm_ef {
178         pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
179 };
180
181 &sd_emmc_a {
182         brcmf: wifi@1 {
183                 reg = <1>;
184                 compatible = "brcm,bcm4329-fmac";
185         };
186 };
187
188 /* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
189 &uart_AO {
190         status = "okay";
191 };
192
193 /* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
194 &uart_AO_B {
195         status = "okay";
196         pinctrl-0 = <&uart_ao_b_pins>;
197         pinctrl-names = "default";
198 };