| 1 |
// SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 |
/* |
| 3 |
* Copyright (c) 2017 Martin Blumenstingl <[email protected]>. |
| 4 |
*/ |
| 5 |
|
| 6 |
/dts-v1/; |
| 7 |
|
| 8 |
#include "meson-gxl-s905x-p212.dtsi" |
| 9 |
#include <dt-bindings/input/input.h> |
| 10 |
#include <dt-bindings/sound/meson-aiu.h> |
| 11 |
|
| 12 |
/ { |
| 13 |
compatible = "khadas,vim", "amlogic,s905x", "amlogic,meson-gxl"; |
| 14 |
model = "Khadas VIM"; |
| 15 |
|
| 16 |
adc-keys { |
| 17 |
compatible = "adc-keys"; |
| 18 |
io-channels = <&saradc 0>; |
| 19 |
io-channel-names = "buttons"; |
| 20 |
keyup-threshold-microvolt = <1710000>; |
| 21 |
|
| 22 |
button-function { |
| 23 |
label = "Function"; |
| 24 |
linux,code = <KEY_FN>; |
| 25 |
press-threshold-microvolt = <10000>; |
| 26 |
}; |
| 27 |
}; |
| 28 |
|
| 29 |
aliases { |
| 30 |
serial2 = &uart_AO_B; |
| 31 |
ethernet0 = ðmac; |
| 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 |
led-controller { |
| 46 |
compatible = "pwm-leds"; |
| 47 |
|
| 48 |
led-1 { |
| 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 |
sound { |
| 68 |
compatible = "amlogic,gx-sound-card"; |
| 69 |
model = "KHADAS-VIM"; |
| 70 |
clocks = <&clkc CLKID_MPLL0>, |
| 71 |
<&clkc CLKID_MPLL1>, |
| 72 |
<&clkc CLKID_MPLL2>; |
| 73 |
|
| 74 |
assigned-clocks = <&clkc CLKID_MPLL0>, |
| 75 |
<&clkc CLKID_MPLL1>, |
| 76 |
<&clkc CLKID_MPLL2>; |
| 77 |
assigned-clock-rates = <294912000>, |
| 78 |
<270950400>, |
| 79 |
<393216000>; |
| 80 |
|
| 81 |
dai-link-0 { |
| 82 |
sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; |
| 83 |
}; |
| 84 |
|
| 85 |
dai-link-1 { |
| 86 |
sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; |
| 87 |
dai-format = "i2s"; |
| 88 |
mclk-fs = <256>; |
| 89 |
|
| 90 |
codec-0 { |
| 91 |
sound-dai = <&aiu AIU_HDMI CTRL_I2S>; |
| 92 |
}; |
| 93 |
}; |
| 94 |
|
| 95 |
dai-link-2 { |
| 96 |
sound-dai = <&aiu AIU_HDMI CTRL_OUT>; |
| 97 |
|
| 98 |
codec-0 { |
| 99 |
sound-dai = <&hdmi_tx>; |
| 100 |
}; |
| 101 |
}; |
| 102 |
}; |
| 103 |
}; |
| 104 |
|
| 105 |
&aiu { |
| 106 |
status = "okay"; |
| 107 |
}; |
| 108 |
|
| 109 |
&cec_AO { |
| 110 |
status = "okay"; |
| 111 |
pinctrl-0 = <&ao_cec_pins>; |
| 112 |
pinctrl-names = "default"; |
| 113 |
hdmi-phandle = <&hdmi_tx>; |
| 114 |
}; |
| 115 |
|
| 116 |
&hdmi_tx { |
| 117 |
status = "okay"; |
| 118 |
pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; |
| 119 |
pinctrl-names = "default"; |
| 120 |
hdmi-supply = <&hdmi_5v>; |
| 121 |
}; |
| 122 |
|
| 123 |
&hdmi_tx_tmds_port { |
| 124 |
hdmi_tx_tmds_out: endpoint { |
| 125 |
remote-endpoint = <&hdmi_connector_in>; |
| 126 |
}; |
| 127 |
}; |
| 128 |
|
| 129 |
&i2c_A { |
| 130 |
status = "okay"; |
| 131 |
pinctrl-0 = <&i2c_a_pins>; |
| 132 |
pinctrl-names = "default"; |
| 133 |
}; |
| 134 |
|
| 135 |
&i2c_B { |
| 136 |
status = "okay"; |
| 137 |
pinctrl-0 = <&i2c_b_pins>; |
| 138 |
pinctrl-names = "default"; |
| 139 |
|
| 140 |
rtc: rtc@51 { |
| 141 |
status = "okay"; |
| 142 |
compatible = "haoyu,hym8563"; |
| 143 |
reg = <0x51>; |
| 144 |
#clock-cells = <0>; |
| 145 |
clock-output-names = "xin32k"; |
| 146 |
}; |
| 147 |
}; |
| 148 |
|
| 149 |
&ir { |
| 150 |
linux,rc-map-name = "rc-khadas"; |
| 151 |
}; |
| 152 |
|
| 153 |
&gpio_ao { |
| 154 |
gpio-line-names = "UART TX", |
| 155 |
"UART RX", |
| 156 |
"Power Key In", |
| 157 |
"J9 Header Pin35", |
| 158 |
"J9 Header Pin16", |
| 159 |
"J9 Header Pin15", |
| 160 |
"J9 Header Pin33", |
| 161 |
"IR In", |
| 162 |
"HDMI CEC", |
| 163 |
"SYS LED", |
| 164 |
/* GPIO_TEST_N */ |
| 165 |
""; |
| 166 |
}; |
| 167 |
|
| 168 |
&gpio { |
| 169 |
gpio-line-names = /* Bank GPIOZ */ |
| 170 |
"", "", "", "", "", "", "", |
| 171 |
"", "", "", "", "", "", "", |
| 172 |
"Power OFF", |
| 173 |
"VCCK Enable", |
| 174 |
/* Bank GPIOH */ |
| 175 |
"HDMI HPD", "HDMI SDA", "HDMI SCL", |
| 176 |
"HDMI_5V_EN", "SPDIF", |
| 177 |
"J9 Header Pin37", |
| 178 |
"J9 Header Pin30", |
| 179 |
"J9 Header Pin29", |
| 180 |
"J9 Header Pin32", |
| 181 |
"J9 Header Pin31", |
| 182 |
/* Bank BOOT */ |
| 183 |
"eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", |
| 184 |
"eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7", |
| 185 |
"eMMC Clk", "eMMC Reset", "eMMC CMD", |
| 186 |
"", "BOOT_MODE", "", "", "eMMC Data Strobe", |
| 187 |
/* Bank CARD */ |
| 188 |
"SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD", |
| 189 |
"SDCard D3", "SDCard D2", "SDCard Det", |
| 190 |
/* Bank GPIODV */ |
| 191 |
"", "", "", "", "", "", "", "", "", "", "", "", |
| 192 |
"", "", "", "", "", "", "", "", "", "", "", "", |
| 193 |
"I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK", |
| 194 |
"VCCK Regulator", "VDDEE Regulator", |
| 195 |
/* Bank GPIOX */ |
| 196 |
"WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2", |
| 197 |
"WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD", |
| 198 |
"WIFI Power Enable", "WIFI WAKE HOST", |
| 199 |
"Bluetooth PCM DOUT", "Bluetooth PCM DIN", |
| 200 |
"Bluetooth PCM SYNC", "Bluetooth PCM CLK", |
| 201 |
"Bluetooth UART TX", "Bluetooth UART RX", |
| 202 |
"Bluetooth UART CTS", "Bluetooth UART RTS", |
| 203 |
"WIFI 32K", "Bluetooth Enable", |
| 204 |
"Bluetooth WAKE HOST", |
| 205 |
/* Bank GPIOCLK */ |
| 206 |
"", "J9 Header Pin39"; |
| 207 |
}; |
| 208 |
|
| 209 |
&pwm_AO_ab { |
| 210 |
status = "okay"; |
| 211 |
pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>; |
| 212 |
pinctrl-names = "default"; |
| 213 |
}; |
| 214 |
|
| 215 |
&pwm_ef { |
| 216 |
pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>; |
| 217 |
}; |
| 218 |
|
| 219 |
&sd_emmc_a { |
| 220 |
max-frequency = <100000000>; |
| 221 |
}; |
| 222 |
|
| 223 |
/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */ |
| 224 |
&uart_AO { |
| 225 |
status = "okay"; |
| 226 |
}; |
| 227 |
|
| 228 |
/* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */ |
| 229 |
&uart_AO_B { |
| 230 |
status = "okay"; |
| 231 |
pinctrl-0 = <&uart_ao_b_pins>; |
| 232 |
pinctrl-names = "default"; |
| 233 |
}; |
| 234 |
|
| 235 |
&usb { |
| 236 |
dr_mode = "peripheral"; |
| 237 |
}; |