Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only OR MIT |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 2 | /* |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame] | 3 | * Copyright (C) 2021-2024 PHYTEC America, LLC - https://www.phytec.com |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 4 | * Author: Matt McKee <mmckee@phytec.com> |
| 5 | * |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame] | 6 | * Copyright (C) 2022-2024 PHYTEC Messtechnik GmbH |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 7 | * Author: Wadim Egorov <w.egorov@phytec.de> |
| 8 | * |
| 9 | * Product homepage: |
| 10 | * https://www.phytec.com/product/phyboard-am64x |
| 11 | */ |
| 12 | |
| 13 | /dts-v1/; |
| 14 | |
| 15 | #include <dt-bindings/gpio/gpio.h> |
| 16 | #include <dt-bindings/input/input.h> |
| 17 | #include <dt-bindings/leds/common.h> |
| 18 | #include <dt-bindings/leds/leds-pca9532.h> |
| 19 | #include <dt-bindings/phy/phy.h> |
| 20 | #include "k3-am642.dtsi" |
| 21 | #include "k3-am64-phycore-som.dtsi" |
| 22 | |
| 23 | #include "k3-serdes.h" |
| 24 | |
| 25 | / { |
| 26 | compatible = "phytec,am642-phyboard-electra-rdk", |
| 27 | "phytec,am64-phycore-som", "ti,am642"; |
| 28 | model = "PHYTEC phyBOARD-Electra-AM64x RDK"; |
| 29 | |
| 30 | aliases { |
| 31 | mmc1 = &sdhci1; |
| 32 | serial2 = &main_uart0; |
| 33 | serial3 = &main_uart1; |
| 34 | }; |
| 35 | |
| 36 | chosen { |
| 37 | stdout-path = &main_uart0; |
| 38 | }; |
| 39 | |
| 40 | can_tc1: can-phy0 { |
| 41 | compatible = "ti,tcan1042"; |
| 42 | pinctrl-names = "default"; |
| 43 | pinctrl-0 = <&can_tc1_pins_default>; |
| 44 | #phy-cells = <0>; |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 45 | max-bitrate = <8000000>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 46 | standby-gpios = <&main_gpio0 32 GPIO_ACTIVE_HIGH>; |
| 47 | }; |
| 48 | |
| 49 | can_tc2: can-phy1 { |
| 50 | compatible = "ti,tcan1042"; |
| 51 | pinctrl-names = "default"; |
| 52 | pinctrl-0 = <&can_tc2_pins_default>; |
| 53 | #phy-cells = <0>; |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 54 | max-bitrate = <8000000>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 55 | standby-gpios = <&main_gpio0 35 GPIO_ACTIVE_HIGH>; |
| 56 | }; |
| 57 | |
| 58 | keys { |
| 59 | compatible = "gpio-keys"; |
| 60 | autorepeat; |
| 61 | pinctrl-names = "default"; |
| 62 | pinctrl-0 = <&gpio_keys_pins_default>; |
| 63 | |
| 64 | key-home { |
| 65 | label = "home"; |
| 66 | linux,code = <KEY_HOME>; |
| 67 | gpios = <&main_gpio0 17 GPIO_ACTIVE_HIGH>; |
| 68 | }; |
| 69 | |
| 70 | key-menu { |
| 71 | label = "menu"; |
| 72 | linux,code = <KEY_MENU>; |
| 73 | gpios = <&main_gpio0 21 GPIO_ACTIVE_HIGH>; |
| 74 | }; |
| 75 | }; |
| 76 | |
| 77 | leds { |
| 78 | compatible = "gpio-leds"; |
| 79 | pinctrl-names = "default"; |
| 80 | pinctrl-0 = <&leds_pins_default>, <&user_leds_pins_default>; |
| 81 | |
| 82 | led-1 { |
| 83 | color = <LED_COLOR_ID_RED>; |
| 84 | gpios = <&main_gpio0 15 GPIO_ACTIVE_HIGH>; |
| 85 | linux,default-trigger = "mmc0"; |
| 86 | function = LED_FUNCTION_DISK; |
| 87 | }; |
| 88 | |
| 89 | led-2 { |
| 90 | color = <LED_COLOR_ID_GREEN>; |
| 91 | gpios = <&main_gpio0 16 GPIO_ACTIVE_HIGH>; |
| 92 | linux,default-trigger = "mmc1"; |
| 93 | function = LED_FUNCTION_DISK; |
| 94 | }; |
| 95 | }; |
| 96 | |
| 97 | vcc_3v3_mmc: regulator-sd { |
| 98 | /* TPS22963C */ |
| 99 | compatible = "regulator-fixed"; |
| 100 | regulator-name = "VCC_3V3_MMC"; |
| 101 | regulator-min-microvolt = <3300000>; |
| 102 | regulator-max-microvolt = <3300000>; |
| 103 | regulator-boot-on; |
| 104 | regulator-always-on; |
| 105 | }; |
| 106 | }; |
| 107 | |
| 108 | &main_pmx0 { |
| 109 | can_tc1_pins_default: can-tc1-default-pins { |
| 110 | pinctrl-single,pins = < |
| 111 | AM64X_IOPAD(0x0084, PIN_OUTPUT, 7) /* (P16) GPMC0_ADVn_ALE.GPIO0_32 */ |
| 112 | >; |
| 113 | }; |
| 114 | |
| 115 | can_tc2_pins_default: can-tc2-default-pins { |
| 116 | pinctrl-single,pins = < |
| 117 | AM64X_IOPAD(0x0090, PIN_OUTPUT, 7) /* (P17) GPMC0_BE0n_CLE.GPIO0_35 */ |
| 118 | >; |
| 119 | }; |
| 120 | |
| 121 | gpio_keys_pins_default: gpio-keys-default-pins { |
| 122 | pinctrl-single,pins = < |
| 123 | AM64X_IOPAD(0x0044, PIN_INPUT, 7) /* (T18) GPMC0_AD2.GPIO0_17 */ |
| 124 | AM64X_IOPAD(0x0054, PIN_INPUT, 7) /* (V20) GPMC0_AD6.GPIO0_21 */ |
| 125 | >; |
| 126 | }; |
| 127 | |
| 128 | main_i2c1_pins_default: main-i2c1-default-pins { |
| 129 | pinctrl-single,pins = < |
| 130 | AM64X_IOPAD(0x0268, PIN_INPUT, 0) /* (C18) I2C1_SCL */ |
| 131 | AM64X_IOPAD(0x026c, PIN_INPUT, 0) /* (B19) I2C1_SDA */ |
| 132 | >; |
| 133 | }; |
| 134 | |
| 135 | main_mcan0_pins_default: main-mcan0-default-pins { |
| 136 | pinctrl-single,pins = < |
| 137 | AM64X_IOPAD(0x0250, PIN_OUTPUT, 0) /* (A17) MCAN0_TX */ |
| 138 | AM64X_IOPAD(0x0254, PIN_INPUT, 0) /* (B17) MCAN0_RX */ |
| 139 | >; |
| 140 | }; |
| 141 | |
| 142 | main_mcan1_pins_default: main-mcan1-default-pins { |
| 143 | pinctrl-single,pins = < |
| 144 | AM64X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (C17) MCAN1_TX */ |
| 145 | AM64X_IOPAD(0x025c, PIN_INPUT, 0) /* (D17) MCAN1_RX */ |
| 146 | >; |
| 147 | }; |
| 148 | |
| 149 | main_mmc1_pins_default: main-mmc1-default-pins { |
| 150 | pinctrl-single,pins = < |
| 151 | AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */ |
| 152 | AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */ |
| 153 | AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */ |
| 154 | AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */ |
| 155 | AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */ |
| 156 | AM64X_IOPAD(0x0290, PIN_INPUT, 0) /* MMC1_CLKLB */ |
| 157 | AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ |
| 158 | AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */ |
| 159 | >; |
| 160 | }; |
| 161 | |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame] | 162 | main_spi0_pins_default: main-spi0-default-pins { |
| 163 | pinctrl-single,pins = < |
| 164 | AM64X_IOPAD(0x020c, PIN_OUTPUT, 7) /* (C13) SPI0_CS1.GPIO1_43 */ |
| 165 | AM64X_IOPAD(0x0210, PIN_INPUT, 0) /* (D13) SPI0_CLK */ |
| 166 | AM64X_IOPAD(0x0214, PIN_OUTPUT, 0) /* (A13) SPI0_D0 */ |
| 167 | AM64X_IOPAD(0x0218, PIN_INPUT, 0) /* (A14) SPI0_D1 */ |
| 168 | >; |
| 169 | }; |
| 170 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 171 | main_uart0_pins_default: main-uart0-default-pins { |
| 172 | pinctrl-single,pins = < |
| 173 | AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */ |
| 174 | AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */ |
| 175 | >; |
| 176 | }; |
| 177 | |
| 178 | main_uart1_pins_default: main-uart1-default-pins { |
| 179 | pinctrl-single,pins = < |
| 180 | AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ |
| 181 | AM64X_IOPAD(0x024C, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */ |
| 182 | AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */ |
| 183 | AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ |
| 184 | >; |
| 185 | }; |
| 186 | |
| 187 | main_usb0_pins_default: main-usb0-default-pins { |
| 188 | pinctrl-single,pins = < |
| 189 | AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ |
| 190 | >; |
| 191 | }; |
| 192 | |
| 193 | pcie_usb_sel_pins_default: pcie-usb-sel-default-pins { |
| 194 | pinctrl-single,pins = < |
| 195 | AM64X_IOPAD(0x017c, PIN_OUTPUT, 7) /* (T1) PRG0_PRU0_GPO7.GPIO1_7 */ |
| 196 | >; |
| 197 | }; |
| 198 | |
| 199 | pcie0_pins_default: pcie0-default-pins { |
| 200 | pinctrl-single,pins = < |
| 201 | AM64X_IOPAD(0x0098, PIN_OUTPUT, 7) /* (W19) GPMC0_WAIT0.GPIO0_37 */ |
| 202 | >; |
| 203 | }; |
| 204 | |
| 205 | user_leds_pins_default: user-leds-default-pins { |
| 206 | pinctrl-single,pins = < |
| 207 | AM64X_IOPAD(0x003c, PIN_OUTPUT, 7) /* (T20) GPMC0_AD0.GPIO0_15 */ |
| 208 | AM64X_IOPAD(0x0040, PIN_OUTPUT, 7) /* (U21) GPMC0_AD1.GPIO0_16 */ |
| 209 | >; |
| 210 | }; |
| 211 | }; |
| 212 | |
| 213 | &main_i2c1 { |
| 214 | status = "okay"; |
| 215 | pinctrl-names = "default"; |
| 216 | pinctrl-0 = <&main_i2c1_pins_default>; |
| 217 | clock-frequency = <400000>; |
| 218 | |
| 219 | eeprom@51 { |
| 220 | compatible = "atmel,24c02"; |
| 221 | pagesize = <16>; |
| 222 | reg = <0x51>; |
| 223 | }; |
| 224 | |
| 225 | led-controller@62 { |
| 226 | compatible = "nxp,pca9533"; |
| 227 | reg = <0x62>; |
| 228 | |
| 229 | led-3 { |
| 230 | label = "red:user"; |
| 231 | type = <PCA9532_TYPE_LED>; |
| 232 | }; |
| 233 | |
| 234 | led-4 { |
| 235 | label = "green:user"; |
| 236 | type = <PCA9532_TYPE_LED>; |
| 237 | }; |
| 238 | |
| 239 | led-5 { |
| 240 | label = "blue:user"; |
| 241 | type = <PCA9532_TYPE_LED>; |
| 242 | }; |
| 243 | }; |
| 244 | }; |
| 245 | |
| 246 | &main_mcan0 { |
| 247 | status = "okay"; |
| 248 | pinctrl-names = "default"; |
| 249 | pinctrl-0 = <&main_mcan0_pins_default>; |
| 250 | phys = <&can_tc1>; |
| 251 | }; |
| 252 | |
| 253 | &main_mcan1 { |
| 254 | status = "okay"; |
| 255 | pinctrl-names = "default"; |
| 256 | pinctrl-0 = <&main_mcan1_pins_default>; |
| 257 | phys = <&can_tc2>; |
| 258 | }; |
| 259 | |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame] | 260 | &main_spi0 { |
| 261 | status = "okay"; |
| 262 | pinctrl-names = "default"; |
| 263 | pinctrl-0 = <&main_spi0_pins_default>; |
| 264 | cs-gpios = <0>, <&main_gpio1 43 GPIO_ACTIVE_LOW>; |
| 265 | ti,pindir-d0-out-d1-in; |
| 266 | |
| 267 | tpm@1 { |
| 268 | compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; |
| 269 | reg = <1>; |
| 270 | spi-max-frequency = <10000000>; |
| 271 | }; |
| 272 | }; |
| 273 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 274 | &main_uart0 { |
| 275 | status = "okay"; |
| 276 | pinctrl-names = "default"; |
| 277 | pinctrl-0 = <&main_uart0_pins_default>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 278 | }; |
| 279 | |
| 280 | &main_uart1 { |
| 281 | status = "okay"; |
| 282 | pinctrl-names = "default"; |
| 283 | pinctrl-0 = <&main_uart1_pins_default>; |
| 284 | uart-has-rtscts; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 285 | }; |
| 286 | |
| 287 | &sdhci1 { |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 288 | status = "okay"; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 289 | vmmc-supply = <&vcc_3v3_mmc>; |
| 290 | pinctrl-names = "default"; |
| 291 | pinctrl-0 = <&main_mmc1_pins_default>; |
| 292 | bus-width = <4>; |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 293 | disable-wp; |
| 294 | no-1-8-v; |
| 295 | }; |
| 296 | |
| 297 | &serdes0 { |
| 298 | serdes0_pcie_usb_link: phy@0 { |
| 299 | reg = <0>; |
| 300 | cdns,num-lanes = <1>; |
| 301 | #phy-cells = <0>; |
| 302 | cdns,phy-type = <PHY_TYPE_USB3>; |
| 303 | resets = <&serdes_wiz0 1>; |
| 304 | }; |
| 305 | }; |
| 306 | |
| 307 | &serdes_ln_ctrl { |
| 308 | idle-states = <AM64_SERDES0_LANE0_USB>; |
| 309 | }; |
| 310 | |
| 311 | &usbss0 { |
| 312 | ti,vbus-divider; |
| 313 | }; |
| 314 | |
| 315 | &usb0 { |
| 316 | pinctrl-names = "default"; |
| 317 | pinctrl-0 = <&main_usb0_pins_default>; |
| 318 | dr_mode = "host"; |
| 319 | maximum-speed = "super-speed"; |
| 320 | phys = <&serdes0_pcie_usb_link>; |
| 321 | phy-names = "cdns3,usb3-phy"; |
| 322 | }; |