| 1 |
// SPDX-License-Identifier: GPL-2.0 |
| 2 |
/* |
| 3 |
* Copyright (c) 2019 BayLibre SAS. |
| 4 |
* Author: Jerome Brunet <[email protected]> |
| 5 |
*/ |
| 6 |
|
| 7 |
/* Libretech Amlogic GX PC form factor - AKA: Tartiflette */ |
| 8 |
|
| 9 |
#include <dt-bindings/input/input.h> |
| 10 |
#include <dt-bindings/leds/common.h> |
| 11 |
#include <dt-bindings/sound/meson-aiu.h> |
| 12 |
|
| 13 |
/ { |
| 14 |
adc-keys { |
| 15 |
compatible = "adc-keys"; |
| 16 |
io-channels = <&saradc 0>; |
| 17 |
io-channel-names = "buttons"; |
| 18 |
keyup-threshold-microvolt = <1800000>; |
| 19 |
|
| 20 |
button-update { |
| 21 |
label = "update"; |
| 22 |
linux,code = <KEY_VENDOR>; |
| 23 |
press-threshold-microvolt = <1300000>; |
| 24 |
}; |
| 25 |
}; |
| 26 |
|
| 27 |
aliases { |
| 28 |
serial0 = &uart_AO; |
| 29 |
ethernet0 = ðmac; |
| 30 |
spi0 = &spifc; |
| 31 |
}; |
| 32 |
|
| 33 |
dio2133: analog-amplifier { |
| 34 |
compatible = "simple-audio-amplifier"; |
| 35 |
sound-name-prefix = "AU2"; |
| 36 |
VCC-supply = <&vcc5v>; |
| 37 |
enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; |
| 38 |
}; |
| 39 |
|
| 40 |
chosen { |
| 41 |
stdout-path = "serial0:115200n8"; |
| 42 |
}; |
| 43 |
|
| 44 |
cvbs-connector { |
| 45 |
compatible = "composite-video-connector"; |
| 46 |
status = "disabled"; |
| 47 |
|
| 48 |
port { |
| 49 |
cvbs_connector_in: endpoint { |
| 50 |
remote-endpoint = <&cvbs_vdac_out>; |
| 51 |
}; |
| 52 |
}; |
| 53 |
}; |
| 54 |
|
| 55 |
emmc_pwrseq: emmc-pwrseq { |
| 56 |
compatible = "mmc-pwrseq-emmc"; |
| 57 |
reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; |
| 58 |
}; |
| 59 |
|
| 60 |
hdmi-connector { |
| 61 |
compatible = "hdmi-connector"; |
| 62 |
type = "a"; |
| 63 |
|
| 64 |
port { |
| 65 |
hdmi_connector_in: endpoint { |
| 66 |
remote-endpoint = <&hdmi_tx_tmds_out>; |
| 67 |
}; |
| 68 |
}; |
| 69 |
}; |
| 70 |
|
| 71 |
gpio-keys-polled { |
| 72 |
compatible = "gpio-keys-polled"; |
| 73 |
poll-interval = <100>; |
| 74 |
|
| 75 |
power-button { |
| 76 |
label = "power"; |
| 77 |
linux,code = <KEY_POWER>; |
| 78 |
gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; |
| 79 |
}; |
| 80 |
}; |
| 81 |
|
| 82 |
memory@0 { |
| 83 |
device_type = "memory"; |
| 84 |
reg = <0x0 0x0 0x0 0x80000000>; |
| 85 |
}; |
| 86 |
|
| 87 |
ao_5v: regulator-ao-5v { |
| 88 |
compatible = "regulator-fixed"; |
| 89 |
regulator-name = "AO_5V"; |
| 90 |
regulator-min-microvolt = <5000000>; |
| 91 |
regulator-max-microvolt = <5000000>; |
| 92 |
vin-supply = <&dc_in>; |
| 93 |
regulator-always-on; |
| 94 |
}; |
| 95 |
|
| 96 |
dc_in: regulator-dc-in { |
| 97 |
compatible = "regulator-fixed"; |
| 98 |
regulator-name = "DC_IN"; |
| 99 |
regulator-min-microvolt = <5000000>; |
| 100 |
regulator-max-microvolt = <5000000>; |
| 101 |
regulator-always-on; |
| 102 |
}; |
| 103 |
|
| 104 |
leds { |
| 105 |
compatible = "gpio-leds"; |
| 106 |
|
| 107 |
led-green { |
| 108 |
color = <LED_COLOR_ID_GREEN>; |
| 109 |
function = LED_FUNCTION_DISK_ACTIVITY; |
| 110 |
gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>; |
| 111 |
linux,default-trigger = "disk-activity"; |
| 112 |
}; |
| 113 |
|
| 114 |
led-blue { |
| 115 |
color = <LED_COLOR_ID_BLUE>; |
| 116 |
function = LED_FUNCTION_STATUS; |
| 117 |
gpios = <&gpio GPIODV_28 GPIO_ACTIVE_HIGH>; |
| 118 |
linux,default-trigger = "heartbeat"; |
| 119 |
panic-indicator; |
| 120 |
}; |
| 121 |
}; |
| 122 |
|
| 123 |
vcc_card: regulator-vcc-card { |
| 124 |
compatible = "regulator-fixed"; |
| 125 |
regulator-name = "VCC_CARD"; |
| 126 |
regulator-min-microvolt = <3300000>; |
| 127 |
regulator-max-microvolt = <3300000>; |
| 128 |
vin-supply = <&vddio_ao3v3>; |
| 129 |
|
| 130 |
gpio = <&gpio GPIODV_4 GPIO_ACTIVE_HIGH>; |
| 131 |
enable-active-high; |
| 132 |
}; |
| 133 |
|
| 134 |
vcc5v: regulator-vcc5v { |
| 135 |
compatible = "regulator-fixed"; |
| 136 |
regulator-name = "VCC5V"; |
| 137 |
regulator-min-microvolt = <5000000>; |
| 138 |
regulator-max-microvolt = <5000000>; |
| 139 |
vin-supply = <&ao_5v>; |
| 140 |
|
| 141 |
gpio = <&gpio GPIOH_3 GPIO_OPEN_DRAIN>; |
| 142 |
}; |
| 143 |
|
| 144 |
vddio_ao18: regulator-vddio-ao18 { |
| 145 |
compatible = "regulator-fixed"; |
| 146 |
regulator-name = "VDDIO_AO18"; |
| 147 |
regulator-min-microvolt = <1800000>; |
| 148 |
regulator-max-microvolt = <1800000>; |
| 149 |
vin-supply = <&ao_5v>; |
| 150 |
regulator-always-on; |
| 151 |
}; |
| 152 |
|
| 153 |
vddio_ao3v3: regulator-vddio-ao3v3 { |
| 154 |
compatible = "regulator-fixed"; |
| 155 |
regulator-name = "VDDIO_AO3V3"; |
| 156 |
regulator-min-microvolt = <3300000>; |
| 157 |
regulator-max-microvolt = <3300000>; |
| 158 |
vin-supply = <&ao_5v>; |
| 159 |
regulator-always-on; |
| 160 |
}; |
| 161 |
|
| 162 |
vddio_boot: regulator-vddio-boot { |
| 163 |
compatible = "regulator-fixed"; |
| 164 |
regulator-name = "VDDIO_BOOT"; |
| 165 |
regulator-min-microvolt = <1800000>; |
| 166 |
regulator-max-microvolt = <1800000>; |
| 167 |
vin-supply = <&vddio_ao3v3>; |
| 168 |
regulator-always-on; |
| 169 |
}; |
| 170 |
|
| 171 |
vddio_card: regulator-vddio-card { |
| 172 |
compatible = "regulator-gpio"; |
| 173 |
regulator-name = "VDDIO_CARD"; |
| 174 |
regulator-min-microvolt = <1800000>; |
| 175 |
regulator-max-microvolt = <3300000>; |
| 176 |
|
| 177 |
gpios = <&gpio GPIODV_5 GPIO_ACTIVE_HIGH>; |
| 178 |
gpios-states = <0>; |
| 179 |
|
| 180 |
states = <3300000 0>, |
| 181 |
<1800000 1>; |
| 182 |
|
| 183 |
regulator-settling-time-up-us = <200>; |
| 184 |
regulator-settling-time-down-us = <50000>; |
| 185 |
}; |
| 186 |
|
| 187 |
sound { |
| 188 |
compatible = "amlogic,gx-sound-card"; |
| 189 |
model = "LIBRETECH-PC"; |
| 190 |
audio-aux-devs = <&dio2133>; |
| 191 |
audio-widgets = "Speaker", "7J4-14 LEFT", |
| 192 |
"Speaker", "7J4-11 RIGHT"; |
| 193 |
audio-routing = "AU2 INL", "ACODEC LOLN", |
| 194 |
"AU2 INR", "ACODEC LORN", |
| 195 |
"7J4-14 LEFT", "AU2 OUTL", |
| 196 |
"7J4-11 RIGHT", "AU2 OUTR"; |
| 197 |
clocks = <&clkc CLKID_MPLL0>, |
| 198 |
<&clkc CLKID_MPLL1>, |
| 199 |
<&clkc CLKID_MPLL2>; |
| 200 |
|
| 201 |
assigned-clocks = <&clkc CLKID_MPLL0>, |
| 202 |
<&clkc CLKID_MPLL1>, |
| 203 |
<&clkc CLKID_MPLL2>; |
| 204 |
assigned-clock-rates = <294912000>, |
| 205 |
<270950400>, |
| 206 |
<393216000>; |
| 207 |
|
| 208 |
dai-link-0 { |
| 209 |
sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; |
| 210 |
}; |
| 211 |
|
| 212 |
dai-link-1 { |
| 213 |
sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; |
| 214 |
dai-format = "i2s"; |
| 215 |
mclk-fs = <256>; |
| 216 |
|
| 217 |
codec-0 { |
| 218 |
sound-dai = <&aiu AIU_HDMI CTRL_I2S>; |
| 219 |
}; |
| 220 |
|
| 221 |
codec-1 { |
| 222 |
sound-dai = <&aiu AIU_ACODEC CTRL_I2S>; |
| 223 |
}; |
| 224 |
}; |
| 225 |
|
| 226 |
dai-link-2 { |
| 227 |
sound-dai = <&aiu AIU_HDMI CTRL_OUT>; |
| 228 |
|
| 229 |
codec-0 { |
| 230 |
sound-dai = <&hdmi_tx>; |
| 231 |
}; |
| 232 |
}; |
| 233 |
|
| 234 |
dai-link-3 { |
| 235 |
sound-dai = <&aiu AIU_ACODEC CTRL_OUT>; |
| 236 |
|
| 237 |
codec-0 { |
| 238 |
sound-dai = <&acodec>; |
| 239 |
}; |
| 240 |
}; |
| 241 |
}; |
| 242 |
}; |
| 243 |
|
| 244 |
&acodec { |
| 245 |
AVDD-supply = <&vddio_ao18>; |
| 246 |
status = "okay"; |
| 247 |
}; |
| 248 |
|
| 249 |
&aiu { |
| 250 |
status = "okay"; |
| 251 |
}; |
| 252 |
|
| 253 |
&cec_AO { |
| 254 |
pinctrl-0 = <&ao_cec_pins>; |
| 255 |
pinctrl-names = "default"; |
| 256 |
hdmi-phandle = <&hdmi_tx>; |
| 257 |
status = "okay"; |
| 258 |
}; |
| 259 |
|
| 260 |
&cvbs_vdac_port { |
| 261 |
cvbs_vdac_out: endpoint { |
| 262 |
remote-endpoint = <&cvbs_connector_in>; |
| 263 |
}; |
| 264 |
}; |
| 265 |
|
| 266 |
ðmac { |
| 267 |
pinctrl-0 = <ð_pins>, <ð_phy_irq_pins>; |
| 268 |
pinctrl-names = "default"; |
| 269 |
phy-handle = <&external_phy>; |
| 270 |
amlogic,tx-delay-ns = <2>; |
| 271 |
phy-mode = "rgmii"; |
| 272 |
status = "okay"; |
| 273 |
}; |
| 274 |
|
| 275 |
&external_mdio { |
| 276 |
external_phy: ethernet-phy@0 { |
| 277 |
reg = <0>; |
| 278 |
max-speed = <1000>; |
| 279 |
reset-assert-us = <10000>; |
| 280 |
reset-deassert-us = <30000>; |
| 281 |
reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; |
| 282 |
interrupt-parent = <&gpio_intc>; |
| 283 |
interrupts = <25 IRQ_TYPE_LEVEL_LOW>; |
| 284 |
}; |
| 285 |
}; |
| 286 |
|
| 287 |
&pinctrl_periphs { |
| 288 |
/* |
| 289 |
* Make sure the reset pin of the usb HUB is driven high to take |
| 290 |
* it out of reset. |
| 291 |
*/ |
| 292 |
usb1_rst_pins: usb1_rst_irq { |
| 293 |
mux { |
| 294 |
groups = "GPIODV_3"; |
| 295 |
function = "gpio_periphs"; |
| 296 |
bias-disable; |
| 297 |
output-high; |
| 298 |
}; |
| 299 |
}; |
| 300 |
|
| 301 |
/* Make sure the phy irq pin is properly configured as input */ |
| 302 |
eth_phy_irq_pins: eth_phy_irq { |
| 303 |
mux { |
| 304 |
groups = "GPIOZ_15"; |
| 305 |
function = "gpio_periphs"; |
| 306 |
bias-disable; |
| 307 |
output-disable; |
| 308 |
}; |
| 309 |
}; |
| 310 |
}; |
| 311 |
|
| 312 |
&hdmi_tx { |
| 313 |
pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; |
| 314 |
pinctrl-names = "default"; |
| 315 |
hdmi-supply = <&vcc5v>; |
| 316 |
status = "okay"; |
| 317 |
}; |
| 318 |
|
| 319 |
&hdmi_tx_tmds_port { |
| 320 |
hdmi_tx_tmds_out: endpoint { |
| 321 |
remote-endpoint = <&hdmi_connector_in>; |
| 322 |
}; |
| 323 |
}; |
| 324 |
|
| 325 |
&ir { |
| 326 |
pinctrl-0 = <&remote_input_ao_pins>; |
| 327 |
pinctrl-names = "default"; |
| 328 |
status = "okay"; |
| 329 |
}; |
| 330 |
|
| 331 |
&i2c_C { |
| 332 |
pinctrl-0 = <&i2c_c_dv18_pins>; |
| 333 |
pinctrl-names = "default"; |
| 334 |
status = "okay"; |
| 335 |
|
| 336 |
rtc: rtc@51 { |
| 337 |
reg = <0x51>; |
| 338 |
compatible = "nxp,pcf8563"; |
| 339 |
#clock-cells = <0>; |
| 340 |
clock-output-names = "rtc_clkout"; |
| 341 |
}; |
| 342 |
}; |
| 343 |
|
| 344 |
&pwm_AO_ab { |
| 345 |
pinctrl-0 = <&pwm_ao_a_3_pins>; |
| 346 |
pinctrl-names = "default"; |
| 347 |
status = "okay"; |
| 348 |
}; |
| 349 |
|
| 350 |
&pwm_ab { |
| 351 |
pinctrl-0 = <&pwm_b_pins>; |
| 352 |
pinctrl-names = "default"; |
| 353 |
status = "okay"; |
| 354 |
}; |
| 355 |
|
| 356 |
&pwm_ef { |
| 357 |
pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>; |
| 358 |
pinctrl-names = "default"; |
| 359 |
status = "okay"; |
| 360 |
}; |
| 361 |
|
| 362 |
&saradc { |
| 363 |
vref-supply = <&vddio_ao18>; |
| 364 |
status = "okay"; |
| 365 |
}; |
| 366 |
|
| 367 |
/* SD card */ |
| 368 |
&sd_emmc_b { |
| 369 |
pinctrl-0 = <&sdcard_pins>; |
| 370 |
pinctrl-1 = <&sdcard_clk_gate_pins>; |
| 371 |
pinctrl-names = "default", "clk-gate"; |
| 372 |
|
| 373 |
bus-width = <4>; |
| 374 |
cap-sd-highspeed; |
| 375 |
sd-uhs-sdr12; |
| 376 |
sd-uhs-sdr25; |
| 377 |
sd-uhs-sdr50; |
| 378 |
sd-uhs-ddr50; |
| 379 |
max-frequency = <200000000>; |
| 380 |
disable-wp; |
| 381 |
|
| 382 |
cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; |
| 383 |
|
| 384 |
vmmc-supply = <&vcc_card>; |
| 385 |
vqmmc-supply = <&vddio_card>; |
| 386 |
|
| 387 |
status = "okay"; |
| 388 |
}; |
| 389 |
|
| 390 |
/* eMMC */ |
| 391 |
&sd_emmc_c { |
| 392 |
pinctrl-0 = <&emmc_pins>; |
| 393 |
pinctrl-1 = <&emmc_clk_gate_pins>; |
| 394 |
pinctrl-names = "default", "clk-gate"; |
| 395 |
|
| 396 |
bus-width = <8>; |
| 397 |
cap-mmc-highspeed; |
| 398 |
mmc-ddr-1_8v; |
| 399 |
mmc-hs200-1_8v; |
| 400 |
max-frequency = <200000000>; |
| 401 |
disable-wp; |
| 402 |
|
| 403 |
mmc-pwrseq = <&emmc_pwrseq>; |
| 404 |
vmmc-supply = <&vddio_ao3v3>; |
| 405 |
vqmmc-supply = <&vddio_boot>; |
| 406 |
|
| 407 |
status = "okay"; |
| 408 |
}; |
| 409 |
|
| 410 |
&spifc { |
| 411 |
pinctrl-0 = <&nor_pins>; |
| 412 |
pinctrl-names = "default"; |
| 413 |
status = "okay"; |
| 414 |
|
| 415 |
gd25lq128: flash@0 { |
| 416 |
compatible = "jedec,spi-nor"; |
| 417 |
#address-cells = <1>; |
| 418 |
#size-cells = <1>; |
| 419 |
reg = <0>; |
| 420 |
spi-max-frequency = <12000000>; |
| 421 |
}; |
| 422 |
}; |
| 423 |
|
| 424 |
&uart_AO { |
| 425 |
pinctrl-0 = <&uart_ao_a_pins>; |
| 426 |
pinctrl-names = "default"; |
| 427 |
status = "okay"; |
| 428 |
}; |
| 429 |
|
| 430 |
&usb { |
| 431 |
status = "okay"; |
| 432 |
dr_mode = "host"; |
| 433 |
}; |
| 434 |
|
| 435 |
&usb2_phy0 { |
| 436 |
pinctrl-0 = <&usb1_rst_pins>; |
| 437 |
pinctrl-names = "default"; |
| 438 |
phy-supply = <&vcc5v>; |
| 439 |
}; |
| 440 |
|
| 441 |
&usb2_phy1 { |
| 442 |
phy-supply = <&vcc5v>; |
| 443 |
}; |