Marek Behún | 5837168 | 2017-06-09 19:28:42 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Device Tree file for the Turris Omnia |
| 3 | * |
| 4 | * Copyright (C) 2016 Uwe Kleine-König <uwe@kleine-koenig.org> |
| 5 | * Copyright (C) 2016 Tomas Hlavacek <tmshlvkc@gmail.com> |
| 6 | * |
| 7 | * This file is dual-licensed: you can use it either under the terms |
| 8 | * of the GPL or the X11 license, at your option. Note that this dual |
| 9 | * licensing only applies to this file, and not this project as a |
| 10 | * whole. |
| 11 | * |
| 12 | * a) This file is licensed under the terms of the GNU General Public |
| 13 | * License version 2. This program is licensed "as is" without |
| 14 | * any warranty of any kind, whether express or implied. |
| 15 | * |
| 16 | * Or, alternatively, |
| 17 | * |
| 18 | * b) Permission is hereby granted, free of charge, to any person |
| 19 | * obtaining a copy of this software and associated documentation |
| 20 | * files (the "Software"), to deal in the Software without |
| 21 | * restriction, including without limitation the rights to use, |
| 22 | * copy, modify, merge, publish, distribute, sublicense, and/or |
| 23 | * sell copies of the Software, and to permit persons to whom the |
| 24 | * Software is furnished to do so, subject to the following |
| 25 | * conditions: |
| 26 | * |
| 27 | * The above copyright notice and this permission notice shall be |
| 28 | * included in all copies or substantial portions of the Software. |
| 29 | * |
| 30 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 31 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 32 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 33 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 34 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 35 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 36 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 37 | * OTHER DEALINGS IN THE SOFTWARE. |
| 38 | */ |
| 39 | |
| 40 | /* |
| 41 | * Schematic available at https://www.turris.cz/doc/_media/rtrom01-schema.pdf |
| 42 | */ |
| 43 | |
| 44 | /dts-v1/; |
| 45 | |
| 46 | #include <dt-bindings/gpio/gpio.h> |
| 47 | #include <dt-bindings/input/input.h> |
| 48 | #include "armada-385.dtsi" |
| 49 | |
| 50 | / { |
| 51 | model = "Turris Omnia"; |
| 52 | compatible = "cznic,turris-omnia", "marvell,armada385", "marvell,armada380"; |
| 53 | |
| 54 | chosen { |
| 55 | stdout-path = &uart0; |
| 56 | }; |
| 57 | |
Pali Rohár | 2be9eee | 2022-07-15 10:16:00 +0200 | [diff] [blame] | 58 | aliases { |
| 59 | ethernet0 = ð0; |
| 60 | ethernet1 = ð1; |
| 61 | ethernet2 = ð2; |
| 62 | }; |
| 63 | |
Marek Behún | 5837168 | 2017-06-09 19:28:42 +0200 | [diff] [blame] | 64 | memory { |
| 65 | device_type = "memory"; |
| 66 | reg = <0x00000000 0x40000000>; /* 1024 MB */ |
| 67 | }; |
| 68 | |
| 69 | soc { |
| 70 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 |
| 71 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 |
| 72 | MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 |
| 73 | MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>; |
| 74 | |
| 75 | internal-regs { |
| 76 | |
| 77 | /* USB part of the PCIe2/USB 2.0 port */ |
| 78 | usb@58000 { |
| 79 | status = "okay"; |
| 80 | }; |
| 81 | |
| 82 | sata@a8000 { |
| 83 | status = "okay"; |
| 84 | }; |
| 85 | |
| 86 | sdhci@d8000 { |
| 87 | pinctrl-names = "default"; |
| 88 | pinctrl-0 = <&sdhci_pins>; |
| 89 | status = "okay"; |
| 90 | |
| 91 | bus-width = <8>; |
| 92 | no-1-8-v; |
| 93 | non-removable; |
| 94 | }; |
| 95 | |
| 96 | usb3@f0000 { |
| 97 | status = "okay"; |
| 98 | }; |
| 99 | |
| 100 | usb3@f8000 { |
| 101 | status = "okay"; |
| 102 | }; |
| 103 | }; |
| 104 | |
Chris Packham | 852a0e17c | 2019-03-16 20:46:20 +1300 | [diff] [blame] | 105 | pcie { |
Marek Behún | 5837168 | 2017-06-09 19:28:42 +0200 | [diff] [blame] | 106 | status = "okay"; |
| 107 | |
| 108 | pcie@1,0 { |
| 109 | /* Port 0, Lane 0 */ |
| 110 | status = "okay"; |
| 111 | }; |
| 112 | |
| 113 | pcie@2,0 { |
| 114 | /* Port 1, Lane 0 */ |
| 115 | status = "okay"; |
| 116 | }; |
| 117 | |
| 118 | pcie@3,0 { |
| 119 | /* Port 2, Lane 0 */ |
| 120 | status = "okay"; |
| 121 | }; |
| 122 | }; |
| 123 | }; |
| 124 | }; |
| 125 | |
| 126 | /* Connected to 88E6176 switch, port 6 */ |
| 127 | ð0 { |
| 128 | pinctrl-names = "default"; |
| 129 | pinctrl-0 = <&ge0_rgmii_pins>; |
| 130 | status = "okay"; |
| 131 | phy-mode = "rgmii"; |
| 132 | |
| 133 | fixed-link { |
| 134 | speed = <1000>; |
| 135 | full-duplex; |
| 136 | }; |
| 137 | }; |
| 138 | |
| 139 | /* Connected to 88E6176 switch, port 5 */ |
| 140 | ð1 { |
| 141 | pinctrl-names = "default"; |
| 142 | pinctrl-0 = <&ge1_rgmii_pins>; |
| 143 | status = "okay"; |
| 144 | phy-mode = "rgmii"; |
| 145 | |
| 146 | fixed-link { |
| 147 | speed = <1000>; |
| 148 | full-duplex; |
| 149 | }; |
| 150 | }; |
| 151 | |
| 152 | /* WAN port */ |
| 153 | ð2 { |
| 154 | status = "okay"; |
| 155 | phy-mode = "sgmii"; |
| 156 | phy = <&phy1>; |
| 157 | }; |
| 158 | |
| 159 | &i2c0 { |
| 160 | pinctrl-names = "default"; |
| 161 | pinctrl-0 = <&i2c0_pins>; |
| 162 | status = "okay"; |
| 163 | |
| 164 | i2cmux@70 { |
| 165 | compatible = "nxp,pca9547"; |
| 166 | #address-cells = <1>; |
| 167 | #size-cells = <0>; |
| 168 | reg = <0x70>; |
| 169 | status = "okay"; |
| 170 | |
| 171 | i2c@0 { |
| 172 | #address-cells = <1>; |
| 173 | #size-cells = <0>; |
| 174 | reg = <0>; |
| 175 | |
Pali Rohár | dd1f485 | 2022-07-28 13:06:25 +0200 | [diff] [blame^] | 176 | /* MCU command i2c API */ |
| 177 | mcu: mcu@2a { |
| 178 | compatible = "cznic,turris-omnia-mcu"; |
| 179 | reg = <0x2a>; |
| 180 | gpio-controller; |
| 181 | #gpio-cells = <3>; |
| 182 | }; |
| 183 | |
Marek Behún | 5837168 | 2017-06-09 19:28:42 +0200 | [diff] [blame] | 184 | /* leds device (in STM32F0) at address 0x2b */ |
| 185 | |
| 186 | eeprom@54 { |
| 187 | compatible = "at,24c64"; |
| 188 | reg = <0x54>; |
| 189 | |
| 190 | /* The EEPROM contains data for bootloader. |
| 191 | * Contents: |
| 192 | * struct omnia_eeprom { |
| 193 | * u32 magic; (=0x0341a034 in LE) |
| 194 | * u32 ramsize; (in GiB) |
| 195 | * char regdomain[4]; |
| 196 | * u32 crc32; |
| 197 | * }; |
| 198 | */ |
| 199 | }; |
| 200 | }; |
| 201 | |
| 202 | i2c@1 { |
| 203 | #address-cells = <1>; |
| 204 | #size-cells = <0>; |
| 205 | reg = <1>; |
| 206 | |
| 207 | /* routed to PCIe0/mSATA connector (CN7A) */ |
| 208 | }; |
| 209 | |
| 210 | i2c@2 { |
| 211 | #address-cells = <1>; |
| 212 | #size-cells = <0>; |
| 213 | reg = <2>; |
| 214 | |
| 215 | /* routed to PCIe1/USB2 connector (CN61A) */ |
| 216 | }; |
| 217 | |
| 218 | i2c@3 { |
| 219 | #address-cells = <1>; |
| 220 | #size-cells = <0>; |
| 221 | reg = <3>; |
| 222 | |
| 223 | /* routed to PCIe2 connector (CN62A) */ |
| 224 | }; |
| 225 | |
| 226 | i2c@4 { |
| 227 | #address-cells = <1>; |
| 228 | #size-cells = <0>; |
| 229 | reg = <4>; |
| 230 | |
| 231 | /* routed to SFP+ */ |
| 232 | }; |
| 233 | |
| 234 | i2c@5 { |
| 235 | #address-cells = <1>; |
| 236 | #size-cells = <0>; |
| 237 | reg = <5>; |
| 238 | |
| 239 | /* ATSHA204A at address 0x64 */ |
| 240 | }; |
| 241 | |
| 242 | i2c@6 { |
| 243 | #address-cells = <1>; |
| 244 | #size-cells = <0>; |
| 245 | reg = <6>; |
| 246 | |
| 247 | /* exposed on pin header */ |
| 248 | }; |
| 249 | |
| 250 | i2c@7 { |
| 251 | #address-cells = <1>; |
| 252 | #size-cells = <0>; |
| 253 | reg = <7>; |
| 254 | |
| 255 | pcawan: gpio@71 { |
| 256 | /* |
| 257 | * GPIO expander for SFP+ signals and |
| 258 | * and phy irq |
| 259 | */ |
| 260 | compatible = "nxp,pca9538"; |
| 261 | reg = <0x71>; |
| 262 | |
| 263 | pinctrl-names = "default"; |
| 264 | pinctrl-0 = <&pcawan_pins>; |
| 265 | |
| 266 | interrupt-parent = <&gpio1>; |
| 267 | interrupts = <14 IRQ_TYPE_LEVEL_LOW>; |
| 268 | |
| 269 | gpio-controller; |
| 270 | #gpio-cells = <2>; |
| 271 | }; |
| 272 | }; |
| 273 | }; |
| 274 | }; |
| 275 | |
| 276 | &mdio { |
| 277 | pinctrl-names = "default"; |
| 278 | pinctrl-0 = <&mdio_pins>; |
| 279 | status = "okay"; |
| 280 | |
| 281 | phy1: phy@1 { |
| 282 | status = "okay"; |
| 283 | compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; |
| 284 | reg = <1>; |
| 285 | |
| 286 | /* irq is connected to &pcawan pin 7 */ |
| 287 | }; |
| 288 | |
| 289 | /* Switch MV88E6176 at address 0x10 */ |
| 290 | switch@10 { |
| 291 | compatible = "marvell,mv88e6085"; |
| 292 | #address-cells = <1>; |
| 293 | #size-cells = <0>; |
| 294 | dsa,member = <0 0>; |
| 295 | |
| 296 | reg = <0x10>; |
| 297 | |
| 298 | ports { |
| 299 | #address-cells = <1>; |
| 300 | #size-cells = <0>; |
| 301 | |
| 302 | ports@0 { |
| 303 | reg = <0>; |
| 304 | label = "lan0"; |
| 305 | }; |
| 306 | |
| 307 | ports@1 { |
| 308 | reg = <1>; |
| 309 | label = "lan1"; |
| 310 | }; |
| 311 | |
| 312 | ports@2 { |
| 313 | reg = <2>; |
| 314 | label = "lan2"; |
| 315 | }; |
| 316 | |
| 317 | ports@3 { |
| 318 | reg = <3>; |
| 319 | label = "lan3"; |
| 320 | }; |
| 321 | |
| 322 | ports@4 { |
| 323 | reg = <4>; |
| 324 | label = "lan4"; |
| 325 | }; |
| 326 | |
| 327 | ports@5 { |
| 328 | reg = <5>; |
| 329 | label = "cpu"; |
| 330 | ethernet = <ð1>; |
| 331 | phy-mode = "rgmii-id"; |
| 332 | |
| 333 | fixed-link { |
| 334 | speed = <1000>; |
| 335 | full-duplex; |
| 336 | }; |
| 337 | }; |
| 338 | |
| 339 | /* port 6 is connected to eth0 */ |
| 340 | }; |
| 341 | }; |
| 342 | }; |
| 343 | |
| 344 | &pinctrl { |
| 345 | pcawan_pins: pcawan-pins { |
| 346 | marvell,pins = "mpp46"; |
| 347 | marvell,function = "gpio"; |
| 348 | }; |
| 349 | |
| 350 | spi0cs0_pins: spi0cs0-pins { |
| 351 | marvell,pins = "mpp25"; |
| 352 | marvell,function = "spi0"; |
| 353 | }; |
| 354 | |
| 355 | spi0cs1_pins: spi0cs1-pins { |
| 356 | marvell,pins = "mpp26"; |
| 357 | marvell,function = "spi0"; |
| 358 | }; |
| 359 | }; |
| 360 | |
| 361 | &spi0 { |
| 362 | pinctrl-names = "default"; |
| 363 | pinctrl-0 = <&spi0_pins &spi0cs0_pins>; |
| 364 | status = "okay"; |
| 365 | |
| 366 | spi-nor@0 { |
| 367 | compatible = "spansion,s25fl164k", "jedec,spi-nor"; |
| 368 | #address-cells = <1>; |
| 369 | #size-cells = <1>; |
| 370 | reg = <0>; |
| 371 | spi-max-frequency = <40000000>; |
| 372 | |
| 373 | partitions { |
| 374 | compatible = "fixed-partitions"; |
| 375 | #address-cells = <1>; |
| 376 | #size-cells = <1>; |
| 377 | |
| 378 | partition@0 { |
| 379 | reg = <0x0 0x00100000>; |
| 380 | label = "U-Boot"; |
| 381 | }; |
| 382 | |
| 383 | partition@100000 { |
| 384 | reg = <0x00100000 0x00700000>; |
| 385 | label = "Rescue system"; |
| 386 | }; |
| 387 | }; |
| 388 | }; |
| 389 | |
| 390 | /* MISO, MOSI, SCLK and CS1 are routed to pin header CN11 */ |
| 391 | }; |
| 392 | |
| 393 | &uart0 { |
| 394 | /* Pin header CN10 */ |
| 395 | pinctrl-names = "default"; |
| 396 | pinctrl-0 = <&uart0_pins>; |
| 397 | status = "okay"; |
| 398 | }; |
| 399 | |
| 400 | &uart1 { |
| 401 | /* Pin header CN11 */ |
| 402 | pinctrl-names = "default"; |
| 403 | pinctrl-0 = <&uart1_pins>; |
| 404 | status = "okay"; |
| 405 | }; |