| 1 |
// SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 |
/* |
| 3 |
* Copyright (c) 2017 Andreas Färber |
| 4 |
*/ |
| 5 |
|
| 6 |
/dts-v1/; |
| 7 |
|
| 8 |
#include "meson-gxbb.dtsi" |
| 9 |
#include <dt-bindings/gpio/gpio.h> |
| 10 |
#include <dt-bindings/sound/meson-aiu.h> |
| 11 |
|
| 12 |
/ { |
| 13 |
compatible = "friendlyarm,nanopi-k2", "amlogic,meson-gxbb"; |
| 14 |
model = "FriendlyARM NanoPi K2"; |
| 15 |
|
| 16 |
aliases { |
| 17 |
serial0 = &uart_AO; |
| 18 |
ethernet0 = ðmac; |
| 19 |
}; |
| 20 |
|
| 21 |
chosen { |
| 22 |
stdout-path = "serial0:115200n8"; |
| 23 |
}; |
| 24 |
|
| 25 |
memory@0 { |
| 26 |
device_type = "memory"; |
| 27 |
reg = <0x0 0x0 0x0 0x80000000>; |
| 28 |
}; |
| 29 |
|
| 30 |
leds { |
| 31 |
compatible = "gpio-leds"; |
| 32 |
|
| 33 |
led-stat { |
| 34 |
label = "nanopi-k2:blue:stat"; |
| 35 |
gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; |
| 36 |
default-state = "on"; |
| 37 |
panic-indicator; |
| 38 |
}; |
| 39 |
}; |
| 40 |
|
| 41 |
vdd_5v: regulator-vdd-5v { |
| 42 |
compatible = "regulator-fixed"; |
| 43 |
regulator-name = "VDD_5V"; |
| 44 |
regulator-min-microvolt = <5000000>; |
| 45 |
regulator-max-microvolt = <5000000>; |
| 46 |
}; |
| 47 |
|
| 48 |
vddio_ao18: regulator-vddio-ao18 { |
| 49 |
compatible = "regulator-fixed"; |
| 50 |
regulator-name = "VDDIO_AO18"; |
| 51 |
regulator-min-microvolt = <1800000>; |
| 52 |
regulator-max-microvolt = <1800000>; |
| 53 |
}; |
| 54 |
|
| 55 |
vddio_ao3v3: regulator-vddio-ao3v3 { |
| 56 |
compatible = "regulator-fixed"; |
| 57 |
regulator-name = "VDDIO_AO3.3V"; |
| 58 |
regulator-min-microvolt = <3300000>; |
| 59 |
regulator-max-microvolt = <3300000>; |
| 60 |
}; |
| 61 |
|
| 62 |
vddio_tf: regulator-vddio-tf { |
| 63 |
compatible = "regulator-gpio"; |
| 64 |
|
| 65 |
regulator-name = "VDDIO_TF"; |
| 66 |
regulator-min-microvolt = <1800000>; |
| 67 |
regulator-max-microvolt = <3300000>; |
| 68 |
|
| 69 |
gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>; |
| 70 |
gpios-states = <0>; |
| 71 |
|
| 72 |
states = <3300000 0>, |
| 73 |
<1800000 1>; |
| 74 |
|
| 75 |
regulator-settling-time-up-us = <100>; |
| 76 |
regulator-settling-time-down-us = <5000>; |
| 77 |
}; |
| 78 |
|
| 79 |
wifi_32k: wifi-32k { |
| 80 |
compatible = "pwm-clock"; |
| 81 |
#clock-cells = <0>; |
| 82 |
clock-frequency = <32768>; |
| 83 |
pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ |
| 84 |
}; |
| 85 |
|
| 86 |
sdio_pwrseq: sdio-pwrseq { |
| 87 |
compatible = "mmc-pwrseq-simple"; |
| 88 |
reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; |
| 89 |
clocks = <&wifi_32k>; |
| 90 |
clock-names = "ext_clock"; |
| 91 |
}; |
| 92 |
|
| 93 |
vcc1v8: regulator-vcc1v8 { |
| 94 |
compatible = "regulator-fixed"; |
| 95 |
regulator-name = "VCC1.8V"; |
| 96 |
regulator-min-microvolt = <1800000>; |
| 97 |
regulator-max-microvolt = <1800000>; |
| 98 |
}; |
| 99 |
|
| 100 |
vcc3v3: regulator-vcc3v3 { |
| 101 |
compatible = "regulator-fixed"; |
| 102 |
regulator-name = "VCC3.3V"; |
| 103 |
regulator-min-microvolt = <3300000>; |
| 104 |
regulator-max-microvolt = <3300000>; |
| 105 |
}; |
| 106 |
|
| 107 |
emmc_pwrseq: emmc-pwrseq { |
| 108 |
compatible = "mmc-pwrseq-emmc"; |
| 109 |
reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; |
| 110 |
}; |
| 111 |
|
| 112 |
/* CVBS is available on CON1 pin 36, disabled by default */ |
| 113 |
cvbs-connector { |
| 114 |
compatible = "composite-video-connector"; |
| 115 |
status = "disabled"; |
| 116 |
|
| 117 |
port { |
| 118 |
cvbs_connector_in: endpoint { |
| 119 |
remote-endpoint = <&cvbs_vdac_out>; |
| 120 |
}; |
| 121 |
}; |
| 122 |
}; |
| 123 |
|
| 124 |
hdmi-connector { |
| 125 |
compatible = "hdmi-connector"; |
| 126 |
type = "a"; |
| 127 |
|
| 128 |
port { |
| 129 |
hdmi_connector_in: endpoint { |
| 130 |
remote-endpoint = <&hdmi_tx_tmds_out>; |
| 131 |
}; |
| 132 |
}; |
| 133 |
}; |
| 134 |
|
| 135 |
sound { |
| 136 |
compatible = "amlogic,gx-sound-card"; |
| 137 |
model = "NANOPI-K2"; |
| 138 |
clocks = <&clkc CLKID_MPLL0>, |
| 139 |
<&clkc CLKID_MPLL1>, |
| 140 |
<&clkc CLKID_MPLL2>; |
| 141 |
|
| 142 |
assigned-clocks = <&clkc CLKID_MPLL0>, |
| 143 |
<&clkc CLKID_MPLL1>, |
| 144 |
<&clkc CLKID_MPLL2>; |
| 145 |
assigned-clock-rates = <294912000>, |
| 146 |
<270950400>, |
| 147 |
<393216000>; |
| 148 |
|
| 149 |
dai-link-0 { |
| 150 |
sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; |
| 151 |
}; |
| 152 |
|
| 153 |
dai-link-1 { |
| 154 |
sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; |
| 155 |
dai-format = "i2s"; |
| 156 |
mclk-fs = <256>; |
| 157 |
|
| 158 |
codec-0 { |
| 159 |
sound-dai = <&aiu AIU_HDMI CTRL_I2S>; |
| 160 |
}; |
| 161 |
}; |
| 162 |
|
| 163 |
dai-link-2 { |
| 164 |
sound-dai = <&aiu AIU_HDMI CTRL_OUT>; |
| 165 |
|
| 166 |
codec-0 { |
| 167 |
sound-dai = <&hdmi_tx>; |
| 168 |
}; |
| 169 |
}; |
| 170 |
}; |
| 171 |
}; |
| 172 |
|
| 173 |
&aiu { |
| 174 |
status = "okay"; |
| 175 |
}; |
| 176 |
|
| 177 |
&cec_AO { |
| 178 |
status = "okay"; |
| 179 |
pinctrl-0 = <&ao_cec_pins>; |
| 180 |
pinctrl-names = "default"; |
| 181 |
hdmi-phandle = <&hdmi_tx>; |
| 182 |
}; |
| 183 |
|
| 184 |
&cvbs_vdac_port { |
| 185 |
cvbs_vdac_out: endpoint { |
| 186 |
remote-endpoint = <&cvbs_connector_in>; |
| 187 |
}; |
| 188 |
}; |
| 189 |
|
| 190 |
ðmac { |
| 191 |
status = "okay"; |
| 192 |
pinctrl-0 = <ð_rgmii_pins>; |
| 193 |
pinctrl-names = "default"; |
| 194 |
|
| 195 |
phy-handle = <ð_phy0>; |
| 196 |
phy-mode = "rgmii"; |
| 197 |
|
| 198 |
amlogic,tx-delay-ns = <2>; |
| 199 |
|
| 200 |
mdio { |
| 201 |
compatible = "snps,dwmac-mdio"; |
| 202 |
#address-cells = <1>; |
| 203 |
#size-cells = <0>; |
| 204 |
|
| 205 |
eth_phy0: ethernet-phy@0 { |
| 206 |
/* Realtek RTL8211F (0x001cc916) */ |
| 207 |
reg = <0>; |
| 208 |
|
| 209 |
reset-assert-us = <10000>; |
| 210 |
reset-deassert-us = <80000>; |
| 211 |
reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; |
| 212 |
|
| 213 |
interrupt-parent = <&gpio_intc>; |
| 214 |
/* MAC_INTR on GPIOZ_15 */ |
| 215 |
interrupts = <29 IRQ_TYPE_LEVEL_LOW>; |
| 216 |
}; |
| 217 |
}; |
| 218 |
}; |
| 219 |
|
| 220 |
&hdmi_tx { |
| 221 |
status = "okay"; |
| 222 |
pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; |
| 223 |
pinctrl-names = "default"; |
| 224 |
}; |
| 225 |
|
| 226 |
&hdmi_tx_tmds_port { |
| 227 |
hdmi_tx_tmds_out: endpoint { |
| 228 |
remote-endpoint = <&hdmi_connector_in>; |
| 229 |
}; |
| 230 |
}; |
| 231 |
|
| 232 |
&ir { |
| 233 |
status = "okay"; |
| 234 |
pinctrl-0 = <&remote_input_ao_pins>; |
| 235 |
pinctrl-names = "default"; |
| 236 |
}; |
| 237 |
|
| 238 |
&gpio_ao { |
| 239 |
gpio-line-names = "UART TX", "UART RX", "Power Control", "Power Key In", |
| 240 |
"VCCK En", "CON1 Header Pin31", |
| 241 |
"I2S Header Pin6", "IR In", "I2S Header Pin7", |
| 242 |
"I2S Header Pin3", "I2S Header Pin4", |
| 243 |
"I2S Header Pin5", "HDMI CEC", "SYS LED", |
| 244 |
/* GPIO_TEST_N */ |
| 245 |
""; |
| 246 |
}; |
| 247 |
|
| 248 |
&gpio { |
| 249 |
gpio-line-names = /* Bank GPIOZ */ |
| 250 |
"Eth MDIO", "Eth MDC", "Eth RGMII RX Clk", |
| 251 |
"Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2", |
| 252 |
"Eth RX D3", "Eth RGMII TX Clk", "Eth TX En", |
| 253 |
"Eth TX D0", "Eth TX D1", "Eth TX D2", "Eth TX D3", |
| 254 |
"Eth PHY nRESET", "Eth PHY Intc", |
| 255 |
/* Bank GPIOH */ |
| 256 |
"HDMI HPD", "HDMI DDC SDA", "HDMI DDC SCL", |
| 257 |
"CON1 Header Pin33", |
| 258 |
/* Bank BOOT */ |
| 259 |
"eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", "eMMC D4", |
| 260 |
"eMMC D5", "eMMC D6", "eMMC D7", "eMMC Clk", |
| 261 |
"eMMC Reset", "eMMC CMD", |
| 262 |
"", "", "", "", "eMMC DS", |
| 263 |
"", "", |
| 264 |
/* Bank CARD */ |
| 265 |
"SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD", |
| 266 |
"SDCard D3", "SDCard D2", "SDCard Det", |
| 267 |
/* Bank GPIODV */ |
| 268 |
"", "", "", "", "", "", "", "", "", "", "", "", "", |
| 269 |
"", "", "", "", "", "", "", "", "", "", "", |
| 270 |
"I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK", |
| 271 |
"VDDEE Regulator", "VCCK Regulator", |
| 272 |
/* Bank GPIOY */ |
| 273 |
"CON1 Header Pin7", "CON1 Header Pin11", |
| 274 |
"CON1 Header Pin13", "CON1 Header Pin15", |
| 275 |
"CON1 Header Pin18", "CON1 Header Pin19", |
| 276 |
"CON1 Header Pin22", "CON1 Header Pin21", |
| 277 |
"CON1 Header Pin24", "CON1 Header Pin23", |
| 278 |
"CON1 Header Pin26", "CON1 Header Pin29", |
| 279 |
"CON1 Header Pin32", "CON1 Header Pin8", |
| 280 |
"CON1 Header Pin10", "CON1 Header Pin16", |
| 281 |
"CON1 Header Pin12", |
| 282 |
/* Bank GPIOX */ |
| 283 |
"WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2", |
| 284 |
"WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD", |
| 285 |
"WIFI Power Enable", "WIFI WAKE HOST", |
| 286 |
"Bluetooth PCM DOUT", "Bluetooth PCM DIN", |
| 287 |
"Bluetooth PCM SYNC", "Bluetooth PCM CLK", |
| 288 |
"Bluetooth UART TX", "Bluetooth UART RX", |
| 289 |
"Bluetooth UART CTS", "Bluetooth UART RTS", |
| 290 |
"", "", "", "WIFI 32K", "Bluetooth Enable", |
| 291 |
"Bluetooth WAKE HOST", "", |
| 292 |
/* Bank GPIOCLK */ |
| 293 |
"", "CON1 Header Pin35", "", ""; |
| 294 |
}; |
| 295 |
|
| 296 |
&pwm_ef { |
| 297 |
status = "okay"; |
| 298 |
pinctrl-0 = <&pwm_e_pins>; |
| 299 |
pinctrl-names = "default"; |
| 300 |
}; |
| 301 |
|
| 302 |
&saradc { |
| 303 |
status = "okay"; |
| 304 |
vref-supply = <&vddio_ao18>; |
| 305 |
}; |
| 306 |
|
| 307 |
/* SDIO */ |
| 308 |
&sd_emmc_a { |
| 309 |
status = "okay"; |
| 310 |
pinctrl-0 = <&sdio_pins>, <&sdio_irq_pins>; |
| 311 |
pinctrl-1 = <&sdio_clk_gate_pins>; |
| 312 |
pinctrl-names = "default", "clk-gate"; |
| 313 |
#address-cells = <1>; |
| 314 |
#size-cells = <0>; |
| 315 |
|
| 316 |
bus-width = <4>; |
| 317 |
cap-sd-highspeed; |
| 318 |
max-frequency = <50000000>; |
| 319 |
|
| 320 |
non-removable; |
| 321 |
disable-wp; |
| 322 |
|
| 323 |
/* WiFi firmware requires power to be kept while in suspend */ |
| 324 |
keep-power-in-suspend; |
| 325 |
|
| 326 |
mmc-pwrseq = <&sdio_pwrseq>; |
| 327 |
|
| 328 |
vmmc-supply = <&vddio_ao3v3>; |
| 329 |
vqmmc-supply = <&vddio_ao18>; |
| 330 |
|
| 331 |
brcmf: wifi@1 { |
| 332 |
compatible = "brcm,bcm4329-fmac"; |
| 333 |
reg = <1>; |
| 334 |
}; |
| 335 |
}; |
| 336 |
|
| 337 |
/* SD */ |
| 338 |
&sd_emmc_b { |
| 339 |
status = "okay"; |
| 340 |
pinctrl-0 = <&sdcard_pins>; |
| 341 |
pinctrl-1 = <&sdcard_clk_gate_pins>; |
| 342 |
pinctrl-names = "default", "clk-gate"; |
| 343 |
|
| 344 |
bus-width = <4>; |
| 345 |
cap-sd-highspeed; |
| 346 |
sd-uhs-sdr12; |
| 347 |
sd-uhs-sdr25; |
| 348 |
sd-uhs-sdr50; |
| 349 |
sd-uhs-ddr50; |
| 350 |
max-frequency = <100000000>; |
| 351 |
disable-wp; |
| 352 |
|
| 353 |
cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; |
| 354 |
|
| 355 |
vmmc-supply = <&vddio_ao3v3>; |
| 356 |
vqmmc-supply = <&vddio_tf>; |
| 357 |
}; |
| 358 |
|
| 359 |
/* eMMC */ |
| 360 |
&sd_emmc_c { |
| 361 |
status = "disabled"; |
| 362 |
pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; |
| 363 |
pinctrl-1 = <&emmc_clk_gate_pins>; |
| 364 |
pinctrl-names = "default", "clk-gate"; |
| 365 |
|
| 366 |
bus-width = <8>; |
| 367 |
max-frequency = <200000000>; |
| 368 |
non-removable; |
| 369 |
disable-wp; |
| 370 |
cap-mmc-highspeed; |
| 371 |
mmc-ddr-1_8v; |
| 372 |
mmc-hs200-1_8v; |
| 373 |
|
| 374 |
mmc-pwrseq = <&emmc_pwrseq>; |
| 375 |
vmmc-supply = <&vcc3v3>; |
| 376 |
vqmmc-supply = <&vcc1v8>; |
| 377 |
}; |
| 378 |
|
| 379 |
/* DBG_UART */ |
| 380 |
&uart_AO { |
| 381 |
status = "okay"; |
| 382 |
pinctrl-0 = <&uart_ao_a_pins>; |
| 383 |
pinctrl-names = "default"; |
| 384 |
}; |
| 385 |
|
| 386 |
/* Bluetooth on AP6212 */ |
| 387 |
&uart_A { |
| 388 |
status = "okay"; |
| 389 |
pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; |
| 390 |
pinctrl-names = "default"; |
| 391 |
uart-has-rtscts; |
| 392 |
|
| 393 |
bluetooth { |
| 394 |
compatible = "brcm,bcm43438-bt"; |
| 395 |
clocks = <&wifi_32k>; |
| 396 |
clock-names = "lpo"; |
| 397 |
vbat-supply = <&vddio_ao3v3>; |
| 398 |
vddio-supply = <&vddio_ao18>; |
| 399 |
host-wakeup-gpios = <&gpio GPIOX_21 GPIO_ACTIVE_HIGH>; |
| 400 |
shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>; |
| 401 |
}; |
| 402 |
}; |
| 403 |
|
| 404 |
/* 40-pin CON1 */ |
| 405 |
&uart_C { |
| 406 |
status = "disabled"; |
| 407 |
pinctrl-0 = <&uart_c_pins>; |
| 408 |
pinctrl-names = "default"; |
| 409 |
}; |
| 410 |
|
| 411 |
&usb0_phy { |
| 412 |
status = "okay"; |
| 413 |
phy-supply = <&vdd_5v>; |
| 414 |
}; |
| 415 |
|
| 416 |
&usb1_phy { |
| 417 |
status = "okay"; |
| 418 |
}; |
| 419 |
|
| 420 |
&usb0 { |
| 421 |
status = "okay"; |
| 422 |
}; |
| 423 |
|
| 424 |
&usb1 { |
| 425 |
status = "okay"; |
| 426 |
}; |