1// SPDX-License-Identifier: GPL-2.0-only OR MIT 2/* 3 * Copyright (C) 2022-2024 PHYTEC Messtechnik GmbH 4 * Author: Wadim Egorov <w.egorov@phytec.de> 5 * 6 */ 7 8#include <dt-bindings/gpio/gpio.h> 9#include <dt-bindings/input/input.h> 10#include <dt-bindings/leds/common.h> 11#include <dt-bindings/net/ti-dp83867.h> 12 13/ { 14 aliases { 15 serial2 = &main_uart0; 16 serial3 = &main_uart1; 17 mmc1 = &sdhci1; 18 usb0 = &usb0; 19 usb1 = &usb1; 20 ethernet1 = &cpsw_port2; 21 }; 22 23 can_tc1: can-phy0 { 24 compatible = "ti,tcan1042"; 25 #phy-cells = <0>; 26 max-bitrate = <8000000>; 27 standby-gpios = <&gpio_exp 1 GPIO_ACTIVE_HIGH>; 28 }; 29 30 hdmi0: connector-hdmi { 31 compatible = "hdmi-connector"; 32 label = "hdmi"; 33 type = "a"; 34 35 port { 36 hdmi_connector_in: endpoint { 37 remote-endpoint = <&sii9022_out>; 38 }; 39 }; 40 }; 41 42 keys { 43 compatible = "gpio-keys"; 44 autorepeat; 45 pinctrl-names = "default"; 46 pinctrl-0 = <&gpio_keys_pins_default>; 47 48 key-home { 49 label = "home"; 50 linux,code = <KEY_HOME>; 51 gpios = <&main_gpio1 23 GPIO_ACTIVE_HIGH>; 52 }; 53 54 key-menu { 55 label = "menu"; 56 linux,code = <KEY_MENU>; 57 gpios = <&gpio_exp 4 GPIO_ACTIVE_HIGH>; 58 }; 59 }; 60 61 sound { 62 compatible = "simple-audio-card"; 63 simple-audio-card,name = "phyBOARD-Lyra"; 64 simple-audio-card,widgets = 65 "Microphone", "Mic Jack", 66 "Headphone", "Headphone Jack", 67 "Speaker", "External Speaker"; 68 simple-audio-card,routing = 69 "MIC3R", "Mic Jack", 70 "Mic Jack", "Mic Bias", 71 "Headphone Jack", "HPLOUT", 72 "Headphone Jack", "HPROUT", 73 "External Speaker", "SPOP", 74 "External Speaker", "SPOM"; 75 simple-audio-card,format = "dsp_b"; 76 simple-audio-card,bitclock-master = <&sound_master>; 77 simple-audio-card,frame-master = <&sound_master>; 78 simple-audio-card,bitclock-inversion; 79 80 simple-audio-card,cpu { 81 sound-dai = <&mcasp2>; 82 }; 83 84 sound_master: simple-audio-card,codec { 85 sound-dai = <&audio_codec>; 86 clocks = <&audio_refclk1>; 87 }; 88 }; 89 90 leds { 91 compatible = "gpio-leds"; 92 pinctrl-names = "default"; 93 pinctrl-0 = <&leds_pins_default>, <&user_leds_pins_default>; 94 95 led-1 { 96 gpios = <&main_gpio0 32 GPIO_ACTIVE_HIGH>; 97 linux,default-trigger = "mmc0"; 98 }; 99 100 led-2 { 101 gpios = <&gpio_exp 2 GPIO_ACTIVE_HIGH>; 102 linux,default-trigger = "mmc1"; 103 }; 104 }; 105 106 vcc_1v8: regulator-vcc-1v8 { 107 compatible = "regulator-fixed"; 108 regulator-name = "VCC_1V8"; 109 regulator-min-microvolt = <1800000>; 110 regulator-max-microvolt = <1800000>; 111 regulator-always-on; 112 regulator-boot-on; 113 }; 114 115 vcc_3v3_hdmi: regulator-vcc-3v3-hdmi { 116 compatible = "regulator-fixed"; 117 regulator-name = "VCC_3V3_HDMI"; 118 regulator-min-microvolt = <3300000>; 119 regulator-max-microvolt = <3300000>; 120 vin-supply = <&vcc_3v3_sw>; 121 regulator-always-on; 122 regulator-boot-on; 123 }; 124 125 vcc_1v2_hdmi: regulator-vcc-1v2-hdmi { 126 compatible = "regulator-fixed"; 127 regulator-name = "HDMI_CVCC"; 128 regulator-min-microvolt = <1200000>; 129 regulator-max-microvolt = <1200000>; 130 regulator-always-on; 131 regulator-boot-on; 132 }; 133 134 vcc_3v3_mmc: regulator-vcc-3v3-mmc { 135 compatible = "regulator-fixed"; 136 regulator-name = "VCC_3V3_MMC"; 137 regulator-min-microvolt = <3300000>; 138 regulator-max-microvolt = <3300000>; 139 regulator-always-on; 140 regulator-boot-on; 141 bootph-all; 142 }; 143 144 vcc_3v3_sw: regulator-vcc-3v3-sw { 145 compatible = "regulator-fixed"; 146 regulator-name = "VCC_3V3_SW"; 147 regulator-min-microvolt = <3300000>; 148 regulator-max-microvolt = <3300000>; 149 regulator-always-on; 150 regulator-boot-on; 151 }; 152}; 153 154&main_pmx0 { 155 audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins { 156 pinctrl-single,pins = < 157 AM62X_IOPAD(0x0a0, PIN_OUTPUT, 1) /* (K25) GPMC0_WPn.AUDIO_EXT_REFCLK1 */ 158 >; 159 }; 160 161 gpio_keys_pins_default: gpio-keys-default-pins { 162 pinctrl-single,pins = < 163 AM62X_IOPAD(0x1d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */ 164 >; 165 }; 166 167 gpio_exp_int_pins_default: gpio-exp-int-default-pins { 168 pinctrl-single,pins = < 169 AM62X_IOPAD(0x244, PIN_INPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */ 170 >; 171 }; 172 173 hdmi_int_pins_default: hdmi-int-default-pins { 174 pinctrl-single,pins = < 175 AM62X_IOPAD(0x040, PIN_INPUT, 7) /* (N23) GPMC0_AD1.GPIO0_16 */ 176 >; 177 }; 178 179 main_dss0_pins_default: main-dss0-default-pins { 180 pinctrl-single,pins = < 181 AM62X_IOPAD(0x0b8, PIN_OUTPUT, 0) /* (U22) VOUT0_DATA0 */ 182 AM62X_IOPAD(0x0bc, PIN_OUTPUT, 0) /* (V24) VOUT0_DATA1 */ 183 AM62X_IOPAD(0x0e0, PIN_OUTPUT, 0) /* (V20) VOUT0_DATA10 */ 184 AM62X_IOPAD(0x0e4, PIN_OUTPUT, 0) /* (AA23) VOUT0_DATA11 */ 185 AM62X_IOPAD(0x0e8, PIN_OUTPUT, 0) /* (AB25) VOUT0_DATA12 */ 186 AM62X_IOPAD(0x0ec, PIN_OUTPUT, 0) /* (AA24) VOUT0_DATA13 */ 187 AM62X_IOPAD(0x0f0, PIN_OUTPUT, 0) /* (Y22) VOUT0_DATA14 */ 188 AM62X_IOPAD(0x0f4, PIN_OUTPUT, 0) /* (AA21) VOUT0_DATA15 */ 189 AM62X_IOPAD(0x0c0, PIN_OUTPUT, 0) /* (W25) VOUT0_DATA2 */ 190 AM62X_IOPAD(0x0c4, PIN_OUTPUT, 0) /* (W24) VOUT0_DATA3 */ 191 AM62X_IOPAD(0x0c8, PIN_OUTPUT, 0) /* (Y25) VOUT0_DATA4 */ 192 AM62X_IOPAD(0x0cc, PIN_OUTPUT, 0) /* (Y24) VOUT0_DATA5 */ 193 AM62X_IOPAD(0x0d0, PIN_OUTPUT, 0) /* (Y23) VOUT0_DATA6 */ 194 AM62X_IOPAD(0x0d4, PIN_OUTPUT, 0) /* (AA25) VOUT0_DATA7 */ 195 AM62X_IOPAD(0x0d8, PIN_OUTPUT, 0) /* (V21) VOUT0_DATA8 */ 196 AM62X_IOPAD(0x0dc, PIN_OUTPUT, 0) /* (W21) VOUT0_DATA9 */ 197 AM62X_IOPAD(0x0fc, PIN_OUTPUT, 0) /* (Y20) VOUT0_DE */ 198 AM62X_IOPAD(0x0f8, PIN_OUTPUT, 0) /* (AB24) VOUT0_HSYNC */ 199 AM62X_IOPAD(0x104, PIN_OUTPUT, 0) /* (AC24) VOUT0_PCLK */ 200 AM62X_IOPAD(0x100, PIN_OUTPUT, 0) /* (AC25) VOUT0_VSYNC */ 201 >; 202 }; 203 204 main_i2c1_pins_default: main-i2c1-default-pins { 205 pinctrl-single,pins = < 206 AM62X_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */ 207 AM62X_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */ 208 >; 209 }; 210 211 main_mcan0_pins_default: main-mcan0-default-pins { 212 pinctrl-single,pins = < 213 AM62X_IOPAD(0x1dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */ 214 AM62X_IOPAD(0x1d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */ 215 >; 216 }; 217 218 main_mcasp2_pins_default: main-mcasp2-default-pins { 219 pinctrl-single,pins = < 220 AM62X_IOPAD(0x070, PIN_INPUT, 3) /* (T24) GPMC0_AD13.MCASP2_ACLKX */ 221 AM62X_IOPAD(0x06c, PIN_INPUT, 3) /* (T22) GPMC0_AD12.MCASP2_AFSX */ 222 AM62X_IOPAD(0x064, PIN_OUTPUT, 3) /* (T25) GPMC0_AD10.MCASP2_AXR2 */ 223 AM62X_IOPAD(0x068, PIN_INPUT, 3) /* (R21) GPMC0_AD11.MCASP2_AXR3 */ 224 >; 225 }; 226 227 main_mmc1_pins_default: main-mmc1-default-pins { 228 pinctrl-single,pins = < 229 AM62X_IOPAD(0x23c, PIN_INPUT_PULLUP, 0) /* (A21) MMC1_CMD */ 230 AM62X_IOPAD(0x234, PIN_INPUT_PULLDOWN, 0) /* (B22) MMC1_CLK */ 231 AM62X_IOPAD(0x230, PIN_INPUT_PULLUP, 0) /* (A22) MMC1_DAT0 */ 232 AM62X_IOPAD(0x22c, PIN_INPUT_PULLUP, 0) /* (B21) MMC1_DAT1 */ 233 AM62X_IOPAD(0x228, PIN_INPUT_PULLUP, 0) /* (C21) MMC1_DAT2 */ 234 AM62X_IOPAD(0x224, PIN_INPUT_PULLUP, 0) /* (D22) MMC1_DAT3 */ 235 AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 0) /* (D17) MMC1_SDCD */ 236 >; 237 bootph-all; 238 }; 239 240 main_rgmii2_pins_default: main-rgmii2-default-pins { 241 pinctrl-single,pins = < 242 AM62X_IOPAD(0x184, PIN_INPUT, 0) /* (AE23) RGMII2_RD0 */ 243 AM62X_IOPAD(0x188, PIN_INPUT, 0) /* (AB20) RGMII2_RD1 */ 244 AM62X_IOPAD(0x18c, PIN_INPUT, 0) /* (AC21) RGMII2_RD2 */ 245 AM62X_IOPAD(0x190, PIN_INPUT, 0) /* (AE22) RGMII2_RD3 */ 246 AM62X_IOPAD(0x180, PIN_INPUT, 0) /* (AD23) RGMII2_RXC */ 247 AM62X_IOPAD(0x17c, PIN_INPUT, 0) /* (AD22) RGMII2_RX_CTL */ 248 AM62X_IOPAD(0x16c, PIN_OUTPUT, 0) /* (Y18) RGMII2_TD0 */ 249 AM62X_IOPAD(0x170, PIN_OUTPUT, 0) /* (AA18) RGMII2_TD1 */ 250 AM62X_IOPAD(0x174, PIN_OUTPUT, 0) /* (AD21) RGMII2_TD2 */ 251 AM62X_IOPAD(0x178, PIN_OUTPUT, 0) /* (AC20) RGMII2_TD3 */ 252 AM62X_IOPAD(0x168, PIN_OUTPUT, 0) /* (AE21) RGMII2_TXC */ 253 AM62X_IOPAD(0x164, PIN_OUTPUT, 0) /* (AA19) RGMII2_TX_CTL */ 254 >; 255 }; 256 257 main_uart0_pins_default: main-uart0-default-pins { 258 pinctrl-single,pins = < 259 AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */ 260 AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */ 261 >; 262 bootph-all; 263 }; 264 265 main_uart1_pins_default: main-uart1-default-pins { 266 pinctrl-single,pins = < 267 AM62X_IOPAD(0x194, PIN_INPUT, 2) /* (B19) MCASP0_AXR3.UART1_CTSn */ 268 AM62X_IOPAD(0x198, PIN_OUTPUT, 2) /* (A19) MCASP0_AXR2.UART1_RTSn */ 269 AM62X_IOPAD(0x1ac, PIN_INPUT, 2) /* (E19) MCASP0_AFSR.UART1_RXD */ 270 AM62X_IOPAD(0x1b0, PIN_OUTPUT, 2) /* (A20) MCASP0_ACLKR.UART1_TXD */ 271 >; 272 bootph-pre-ram; 273 }; 274 275 main_usb1_pins_default: main-usb1-default-pins { 276 pinctrl-single,pins = < 277 AM62X_IOPAD(0x258, PIN_OUTPUT, 0) /* (F18) USB1_DRVVBUS */ 278 >; 279 }; 280 281 user_leds_pins_default: user-leds-default-pins { 282 pinctrl-single,pins = < 283 AM62X_IOPAD(0x084, PIN_OUTPUT, 7) /* (L23) GPMC0_ADVn_ALE.GPIO0_32 */ 284 >; 285 }; 286}; 287 288&cpsw3g { 289 pinctrl-names = "default"; 290 pinctrl-0 = <&main_rgmii1_pins_default>, <&main_rgmii2_pins_default>; 291}; 292 293&cpsw_port2 { 294 phy-mode = "rgmii-rxid"; 295 phy-handle = <&cpsw3g_phy3>; 296}; 297 298&cpsw3g_mdio { 299 cpsw3g_phy3: ethernet-phy@3 { 300 compatible = "ethernet-phy-id2000.a231", "ethernet-phy-ieee802.3-c22"; 301 reg = <3>; 302 ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>; 303 ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; 304 ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; 305 }; 306}; 307 308&dss { 309 pinctrl-names = "default"; 310 pinctrl-0 = <&main_dss0_pins_default>; 311 status = "okay"; 312}; 313 314&dss_ports { 315 #address-cells = <1>; 316 #size-cells = <0>; 317 318 /* VP2: DPI/HDMI Output */ 319 port@1 { 320 reg = <1>; 321 322 dpi1_out: endpoint { 323 remote-endpoint = <&sii9022_in>; 324 }; 325 }; 326}; 327 328&main_i2c1 { 329 pinctrl-names = "default"; 330 pinctrl-0 = <&main_i2c1_pins_default>; 331 clock-frequency = <100000>; 332 status = "okay"; 333 334 audio_codec: audio-codec@18 { 335 pinctrl-names = "default"; 336 pinctrl-0 = <&audio_ext_refclk1_pins_default>; 337 338 #sound-dai-cells = <0>; 339 compatible = "ti,tlv320aic3007"; 340 reg = <0x18>; 341 ai3x-micbias-vg = <2>; 342 343 AVDD-supply = <&vcc_3v3_sw>; 344 IOVDD-supply = <&vcc_3v3_sw>; 345 DRVDD-supply = <&vcc_3v3_sw>; 346 DVDD-supply = <&vcc_1v8>; 347 }; 348 349 gpio_exp: gpio-expander@21 { 350 pinctrl-names = "default"; 351 pinctrl-0 = <&gpio_exp_int_pins_default>; 352 compatible = "nxp,pcf8574"; 353 reg = <0x21>; 354 interrupt-parent = <&main_gpio1>; 355 interrupts = <49 0>; 356 #gpio-cells = <2>; 357 gpio-controller; 358 interrupt-controller; 359 #interrupt-cells = <2>; 360 gpio-line-names = "", "GPIO1_CAN0_nEN", 361 "GPIO2_LED2", "GPIO3_LVDS_GPIO", 362 "GPIO4_BUT2", "GPIO5_LVDS_BKLT_EN", 363 "GPIO6_ETH1_USER_RESET", "GPIO7_AUDIO_USER_RESET"; 364 }; 365 366 usb-pd@22 { 367 compatible = "ti,tps6598x"; 368 reg = <0x22>; 369 370 connector { 371 compatible = "usb-c-connector"; 372 label = "USB-C"; 373 self-powered; 374 data-role = "dual"; 375 power-role = "sink"; 376 port { 377 usb_con_hs: endpoint { 378 remote-endpoint = <&typec_hs>; 379 }; 380 }; 381 }; 382 }; 383 384 sii9022: bridge-hdmi@39 { 385 compatible = "sil,sii9022"; 386 reg = <0x39>; 387 388 interrupt-parent = <&main_gpio0>; 389 interrupts = <16 IRQ_TYPE_EDGE_FALLING>; 390 pinctrl-names = "default"; 391 pinctrl-0 = <&hdmi_int_pins_default>; 392 393 iovcc-supply = <&vcc_3v3_hdmi>; 394 cvcc12-supply = <&vcc_1v2_hdmi>; 395 396 ports { 397 #address-cells = <1>; 398 #size-cells = <0>; 399 400 port@0 { 401 reg = <0>; 402 403 sii9022_in: endpoint { 404 remote-endpoint = <&dpi1_out>; 405 bus-width = <16>; 406 }; 407 }; 408 409 port@1 { 410 reg = <1>; 411 412 sii9022_out: endpoint { 413 remote-endpoint = <&hdmi_connector_in>; 414 }; 415 }; 416 }; 417 }; 418 419 eeprom@51 { 420 compatible = "atmel,24c02"; 421 pagesize = <16>; 422 reg = <0x51>; 423 vcc-supply = <&vcc_3v3_mmc>; 424 }; 425}; 426 427&main_mcan0 { 428 pinctrl-names = "default"; 429 pinctrl-0 = <&main_mcan0_pins_default>; 430 phys = <&can_tc1>; 431 status = "okay"; 432}; 433 434&main_uart0 { 435 pinctrl-names = "default"; 436 pinctrl-0 = <&main_uart0_pins_default>; 437 bootph-all; 438 status = "okay"; 439}; 440 441&main_uart1 { 442 pinctrl-names = "default"; 443 pinctrl-0 = <&main_uart1_pins_default>; 444 bootph-pre-ram; 445 /* Main UART1 may be used by TIFS firmware */ 446 status = "okay"; 447}; 448 449&mcasp2 { 450 #sound-dai-cells = <0>; 451 452 pinctrl-names = "default"; 453 pinctrl-0 = <&main_mcasp2_pins_default>; 454 455 /* MCASP_IIS_MODE */ 456 op-mode = <0>; 457 tdm-slots = <2>; 458 459 /* 0: INACTIVE, 1: TX, 2: RX */ 460 serial-dir = < 461 0 0 1 2 462 0 0 0 0 463 0 0 0 0 464 0 0 0 0 465 >; 466 status = "okay"; 467}; 468 469&sdhci1 { 470 vmmc-supply = <&vcc_3v3_mmc>; 471 vqmmc-supply = <&vddshv5_sdio>; 472 pinctrl-names = "default"; 473 pinctrl-0 = <&main_mmc1_pins_default>; 474 disable-wp; 475 no-1-8-v; 476 bootph-all; 477 status = "okay"; 478}; 479 480&usbss0 { 481 ti,vbus-divider; 482 bootph-all; 483 status = "okay"; 484}; 485 486&usbss1 { 487 ti,vbus-divider; 488 status = "okay"; 489}; 490 491&usb0 { 492 usb-role-switch; 493 bootph-all; 494 495 port { 496 typec_hs: endpoint { 497 remote-endpoint = <&usb_con_hs>; 498 }; 499 }; 500}; 501 502&usb1 { 503 dr_mode = "host"; 504 pinctrl-names = "default"; 505 pinctrl-0 = <&main_usb1_pins_default>; 506}; 507