Tony Dinh | 63eba13 | 2023-02-01 15:13:05 -0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0 OR MIT) |
| 2 | /* |
| 3 | * Device Tree file for Thecus N2350 board |
| 4 | * |
| 5 | * Copyright (C) 2018-2023 Tony Dinh <mibodhi@gmail.com> |
| 6 | * Copyright (C) 2018 Manuel Jung <manuel.jung@hotmail.com> |
| 7 | */ |
| 8 | |
| 9 | /dts-v1/; |
| 10 | #include <dt-bindings/input/input.h> |
| 11 | #include <dt-bindings/gpio/gpio.h> |
| 12 | #include "armada-385.dtsi" |
| 13 | |
| 14 | / { |
| 15 | model = "Thecus N2350"; |
| 16 | compatible = "thecus,n2350", "marvell,armada385"; |
| 17 | |
| 18 | aliases { |
| 19 | ethernet0 = ð0; |
| 20 | }; |
| 21 | |
| 22 | chosen { |
| 23 | stdout-path = "serial0:115200n8"; |
| 24 | }; |
| 25 | |
| 26 | memory { |
| 27 | device_type = "memory"; |
| 28 | reg = <0x00000000 0x40000000>; /* 1GB */ |
| 29 | }; |
| 30 | |
| 31 | soc { |
| 32 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 |
| 33 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 |
| 34 | MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 |
| 35 | MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 |
| 36 | MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; |
| 37 | |
| 38 | }; |
| 39 | |
| 40 | usb3_0_phy: usb3_0_phy { |
| 41 | compatible = "usb-nop-xceiv"; |
| 42 | vcc-supply = <&usb3_0_power>; |
| 43 | }; |
| 44 | |
| 45 | usb3_1_phy: usb3_1_phy { |
| 46 | compatible = "usb-nop-xceiv"; |
| 47 | vcc-supply = <&usb3_1_power>; |
| 48 | }; |
| 49 | |
| 50 | gpio-keys { |
| 51 | compatible = "gpio-keys"; |
| 52 | #address-cells = <1>; |
| 53 | #size-cells = <0>; |
| 54 | pinctrl-0 = <&pmx_power_button &pmx_copy_button &pmx_reset_button>; |
| 55 | pinctrl-names = "default"; |
| 56 | |
| 57 | button@1 { |
| 58 | label = "Power Button"; |
| 59 | linux,code = <KEY_POWER>; |
| 60 | gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>; |
| 61 | }; |
| 62 | |
| 63 | button@2 { |
| 64 | label = "Copy Button"; |
| 65 | linux,code = <KEY_COPY>; |
| 66 | gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>; |
| 67 | }; |
| 68 | |
| 69 | button@3 { |
| 70 | label = "Reset Button"; |
| 71 | linux,code = <KEY_RESTART>; |
| 72 | gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; |
| 73 | }; |
| 74 | }; |
| 75 | |
| 76 | gpio-leds { |
| 77 | compatible = "gpio-leds"; |
| 78 | pinctrl-0 = <&pmx_sata1_white_led |
| 79 | &pmx_sata1_red_led |
| 80 | &pmx_sata2_white_led |
| 81 | &pmx_sata2_red_led |
| 82 | &pmx_sys_white_led |
| 83 | &pmx_sys_red_led |
| 84 | &pmx_pwr_blue_led |
| 85 | &pmx_pwr_red_led |
| 86 | &pmx_usb_white_led |
| 87 | &pmx_usb_red_led>; |
| 88 | |
| 89 | pinctrl-names = "default"; |
| 90 | |
| 91 | white_sata1 { |
| 92 | label = "n2350:white:sata1"; |
| 93 | gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; |
| 94 | linux,default-trigger = "ide-disk1"; |
| 95 | }; |
| 96 | |
| 97 | red_sata1 { |
| 98 | label = "n2350:red:sata1"; |
| 99 | gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; |
| 100 | }; |
| 101 | |
| 102 | white-sata2 { |
| 103 | label = "n2350:white:sata2"; |
| 104 | gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; |
| 105 | }; |
| 106 | |
| 107 | red-sata2 { |
| 108 | label = "n2350:red:sata2"; |
| 109 | gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; |
| 110 | }; |
| 111 | |
| 112 | white-sys { |
| 113 | label = "n2350:white:sys"; |
| 114 | gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; |
| 115 | linux,default-trigger = "default-on"; |
| 116 | }; |
| 117 | |
| 118 | red-sys { |
| 119 | label = "n2350:red:sys"; |
| 120 | gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; |
| 121 | }; |
| 122 | |
| 123 | blue-pwr { |
| 124 | label = "n2350:blue:pwr"; |
| 125 | gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; |
| 126 | }; |
| 127 | |
| 128 | red-pwr { |
| 129 | label = "n2350:red:pwr"; |
| 130 | gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; |
| 131 | }; |
| 132 | |
| 133 | white-usb { |
| 134 | label = "n2350:white:usb"; |
| 135 | gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; |
| 136 | }; |
| 137 | |
| 138 | red-usb { |
| 139 | label = "n2350:red:usb"; |
| 140 | gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; |
| 141 | }; |
| 142 | }; |
| 143 | |
| 144 | regulators { |
| 145 | compatible = "simple-bus"; |
| 146 | #address-cells = <1>; |
| 147 | #size-cells = <0>; |
| 148 | |
| 149 | usb3_0_power: regulator@1 { |
| 150 | compatible = "regulator-fixed"; |
| 151 | reg = <1>; |
| 152 | regulator-name = "USB3_0_Power"; |
| 153 | regulator-min-microvolt = <5000000>; |
| 154 | regulator-max-microvolt = <5000000>; |
| 155 | enable-active-high; |
| 156 | regulator-always-on; |
| 157 | regulator-boot-on; |
| 158 | gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>; |
| 159 | }; |
| 160 | |
| 161 | usb3_1_power: regulator@2 { |
| 162 | compatible = "regulator-fixed"; |
| 163 | reg = <1>; |
| 164 | regulator-name = "USB3_1_Power"; |
| 165 | regulator-min-microvolt = <5000000>; |
| 166 | regulator-max-microvolt = <5000000>; |
| 167 | enable-active-high; |
| 168 | regulator-always-on; |
| 169 | regulator-boot-on; |
| 170 | gpio = <&gpio0 24 GPIO_ACTIVE_HIGH>; |
| 171 | }; |
| 172 | |
| 173 | reg_sata0: regulator@3 { |
| 174 | compatible = "regulator-fixed"; |
| 175 | regulator-name = "pwr_en_sata0"; |
| 176 | regulator-min-microvolt = <12000000>; |
| 177 | regulator-max-microvolt = <12000000>; |
| 178 | enable-active-high; |
| 179 | regulator-always-on; |
| 180 | regulator-boot-on; |
| 181 | gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; |
| 182 | }; |
| 183 | |
| 184 | reg_5v_sata0: v5-sata0 { |
| 185 | compatible = "regulator-fixed"; |
| 186 | regulator-name = "v5.0-sata0"; |
| 187 | regulator-min-microvolt = <5000000>; |
| 188 | regulator-max-microvolt = <5000000>; |
| 189 | vin-supply = <®_sata0>; |
| 190 | }; |
| 191 | |
| 192 | reg_12v_sata0: v12-sata0 { |
| 193 | compatible = "regulator-fixed"; |
| 194 | regulator-name = "v12.0-sata0"; |
| 195 | regulator-min-microvolt = <12000000>; |
| 196 | regulator-max-microvolt = <12000000>; |
| 197 | vin-supply = <®_sata0>; |
| 198 | }; |
| 199 | |
| 200 | reg_sata1: regulator@4 { |
| 201 | regulator-name = "pwr_en_sata1"; |
| 202 | compatible = "regulator-fixed"; |
| 203 | regulator-min-microvolt = <12000000>; |
| 204 | regulator-max-microvolt = <12000000>; |
| 205 | enable-active-high; |
| 206 | regulator-always-on; |
| 207 | regulator-boot-on; |
| 208 | gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; |
| 209 | }; |
| 210 | |
| 211 | reg_5v_sata1: v5-sata1 { |
| 212 | compatible = "regulator-fixed"; |
| 213 | regulator-name = "v5.0-sata1"; |
| 214 | regulator-min-microvolt = <5000000>; |
| 215 | regulator-max-microvolt = <5000000>; |
| 216 | vin-supply = <®_sata1>; |
| 217 | }; |
| 218 | |
| 219 | reg_12v_sata1: v12-sata1 { |
| 220 | compatible = "regulator-fixed"; |
| 221 | regulator-name = "v12.0-sata1"; |
| 222 | regulator-min-microvolt = <12000000>; |
| 223 | regulator-max-microvolt = <12000000>; |
| 224 | vin-supply = <®_sata1>; |
| 225 | }; |
| 226 | |
| 227 | }; |
| 228 | |
| 229 | gpio-poweroff { |
| 230 | compatible = "gpio-poweroff"; |
| 231 | pinctrl-0 = <&pmx_pwr_off>; |
| 232 | pinctrl-names = "default"; |
| 233 | gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; |
| 234 | }; |
| 235 | |
| 236 | }; |
| 237 | |
| 238 | &ahci0 { |
| 239 | status = "okay"; |
| 240 | }; |
| 241 | |
| 242 | &bm { |
| 243 | status = "okay"; |
| 244 | }; |
| 245 | |
| 246 | &bm_bppi { |
| 247 | status = "okay"; |
| 248 | }; |
| 249 | |
| 250 | ð0 { |
| 251 | status = "okay"; |
| 252 | phy = <&phy0>; |
| 253 | phy-mode = "sgmii"; |
| 254 | buffer-manager = <&bm>; |
| 255 | bm,pool-long = <0>; |
| 256 | bm,pool-short = <1>; |
| 257 | }; |
| 258 | |
| 259 | &i2c0 { |
| 260 | status = "okay"; |
| 261 | clock-frequency = <100000>; |
| 262 | }; |
| 263 | |
| 264 | &i2c1 { |
| 265 | status = "okay"; |
| 266 | clock-frequency = <100000>; |
| 267 | }; |
| 268 | |
| 269 | &mdio { |
| 270 | phy0: ethernet-phy@0 { |
| 271 | reg = <1>; |
| 272 | }; |
| 273 | }; |
| 274 | |
| 275 | &nand_controller { |
| 276 | status = "okay"; |
| 277 | |
| 278 | nand@0 { |
| 279 | status = "okay"; |
| 280 | reg = <0>; |
| 281 | label = "pxa3xx_nand-0"; |
| 282 | nand-rb = <0>; |
| 283 | marvell,nand-keep-config; |
| 284 | nand-on-flash-bbt; |
| 285 | nand-ecc-strength = <4>; |
| 286 | nand-ecc-step-size = <512>; |
| 287 | |
| 288 | partitions { |
| 289 | compatible = "fixed-partitions"; |
| 290 | #address-cells = <1>; |
| 291 | #size-cells = <1>; |
| 292 | |
| 293 | partition@0 { |
| 294 | label = "rootfs"; |
| 295 | reg = <0x00000000 0x20000000>; |
| 296 | }; |
| 297 | |
| 298 | }; |
| 299 | }; |
| 300 | }; |
| 301 | |
| 302 | &pciec { |
| 303 | status = "okay"; |
| 304 | /* |
| 305 | * The two PCIe units are accessible through |
| 306 | * standard PCIe slots on the board. |
| 307 | */ |
| 308 | pcie@1,0 { |
| 309 | /* Port 0, Lane 0 */ |
| 310 | status = "okay"; |
| 311 | }; |
| 312 | pcie@2,0 { |
| 313 | /* Port 1, Lane 0 */ |
| 314 | status = "okay"; |
| 315 | }; |
| 316 | }; |
| 317 | |
| 318 | &pinctrl { |
| 319 | pinctrl-names = "default"; |
| 320 | |
| 321 | pmx_power_button: pmx-power-button { |
| 322 | marvell,pins = "mpp49"; |
| 323 | marvell,function = "gpio"; |
| 324 | }; |
| 325 | |
| 326 | pmx_copy_button: pmx-copy-button { |
| 327 | marvell,pins = "mpp52"; |
| 328 | marvell,function = "gpio"; |
| 329 | }; |
| 330 | |
| 331 | pmx_reset_button: pmx-reset-button { |
| 332 | marvell,pins = "mpp50"; |
| 333 | marvell,function = "gpio"; |
| 334 | }; |
| 335 | |
| 336 | pmx_sata1_white_led: pmx-sata1-white-led { |
| 337 | marvell,pins = "mpp20"; |
| 338 | marvell,function = "gpio"; |
| 339 | }; |
| 340 | |
| 341 | pmx_sata1_red_led: pmx-sata1-red-led { |
| 342 | marvell,pins = "mpp46"; |
| 343 | marvell,function = "gpio"; |
| 344 | }; |
| 345 | |
| 346 | pmx_sata2_white_led: pmx-sata2-white-led { |
| 347 | marvell,pins = "mpp19"; |
| 348 | marvell,function = "gpio"; |
| 349 | }; |
| 350 | |
| 351 | pmx_sata2_red_led: pmx-sata2-red-led { |
| 352 | marvell,pins = "mpp47"; |
| 353 | marvell,function = "gpio"; |
| 354 | }; |
| 355 | |
| 356 | pmx_sys_white_led: pmx-sys-white-led { |
| 357 | marvell,pins = "mpp14"; |
| 358 | marvell,function = "gpio"; |
| 359 | }; |
| 360 | |
| 361 | pmx_sys_red_led: pmx-sys-red-led { |
| 362 | marvell,pins = "mpp15"; |
| 363 | marvell,function = "gpio"; |
| 364 | }; |
| 365 | |
| 366 | pmx_buzzer: pmx-buzzer { |
| 367 | marvell,pins = "mpp51"; |
| 368 | marvell,function = "gpio"; |
| 369 | }; |
| 370 | |
| 371 | pmx_pwr_off: pmx-pwr-off { |
| 372 | marvell,pins = "mpp54"; |
| 373 | marvell,function = "gpio"; |
| 374 | }; |
| 375 | |
| 376 | pmx_pwr_blue_led: pmx-pwr-blue-led { |
| 377 | marvell,pins = "mpp43"; |
| 378 | marvell,function = "gpio"; |
| 379 | }; |
| 380 | |
| 381 | pmx_pwr_red_led: pmx-pwr-red-led { |
| 382 | marvell,pins = "mpp18"; |
| 383 | marvell,function = "gpio"; |
| 384 | }; |
| 385 | |
| 386 | pmx_usb_white_led: pmx-usb-white-led { |
| 387 | marvell,pins = "mpp16"; |
| 388 | marvell,function = "gpio"; |
| 389 | }; |
| 390 | |
| 391 | pmx_usb_red_led: pmx-usb-red-led { |
| 392 | marvell,pins = "mpp17"; |
| 393 | marvell,function = "gpio"; |
| 394 | }; |
| 395 | }; |
| 396 | |
| 397 | &sdhci { |
| 398 | broken-cd; |
| 399 | wp-inverted; |
| 400 | bus-width = <8>; |
| 401 | status = "okay"; |
| 402 | no-1-8-v; |
| 403 | }; |
| 404 | |
| 405 | &spi1 { |
| 406 | pinctrl-names = "default"; |
| 407 | pinctrl-0 = <&spi1_pins>; |
| 408 | status = "okay"; |
| 409 | |
| 410 | /* spi: 4M Flash Macronix MX25L3205D */ |
| 411 | spi-flash@0 { |
| 412 | #address-cells = <1>; |
| 413 | #size-cells = <0>; |
| 414 | compatible = "macronix,mx25l3205d", "jedec,spi-nor"; |
| 415 | reg = <0>; |
| 416 | |
| 417 | spi-max-frequency = <108000000>; |
| 418 | spi-cpha; |
| 419 | |
| 420 | partition@0 { |
| 421 | label = "u-boot"; |
| 422 | reg = <0x00000000 0x00100000>; |
| 423 | }; |
| 424 | |
| 425 | partition@100000 { |
| 426 | label = "u-boot-env"; |
| 427 | reg = <0x00100000 0x00010000>; |
| 428 | }; |
| 429 | }; |
| 430 | }; |
| 431 | |
| 432 | &uart0 { |
| 433 | status = "okay"; |
| 434 | }; |
| 435 | |
| 436 | &usb0 { |
| 437 | status = "okay"; |
| 438 | }; |
| 439 | |
| 440 | &usb3_0 { |
| 441 | status = "okay"; |
| 442 | }; |
| 443 | |
| 444 | &usb3_1 { |
| 445 | status = "okay"; |
| 446 | }; |