armada-385-turris-omnia.dts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. // SPDX-License-Identifier: (GPL-2.0 OR MIT)
  2. /*
  3. * Device Tree file for the Turris Omnia
  4. *
  5. * Copyright (C) 2016 Uwe Kleine-König <[email protected]>
  6. * Copyright (C) 2016 Tomas Hlavacek <[email protected]>
  7. *
  8. * Schematic available at https://www.turris.cz/doc/_media/rtrom01-schema.pdf
  9. */
  10. /dts-v1/;
  11. #include <dt-bindings/gpio/gpio.h>
  12. #include <dt-bindings/input/input.h>
  13. #include <dt-bindings/leds/common.h>
  14. #include "armada-385.dtsi"
  15. / {
  16. model = "Turris Omnia";
  17. compatible = "cznic,turris-omnia", "marvell,armada385", "marvell,armada380";
  18. chosen {
  19. stdout-path = &uart0;
  20. };
  21. aliases {
  22. ethernet0 = &eth0;
  23. ethernet1 = &eth1;
  24. ethernet2 = &eth2;
  25. };
  26. memory {
  27. device_type = "memory";
  28. reg = <0x00000000 0x40000000>; /* 1024 MB */
  29. };
  30. soc {
  31. ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
  32. MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
  33. MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
  34. MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
  35. MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
  36. internal-regs {
  37. /* USB part of the PCIe2/USB 2.0 port */
  38. usb@58000 {
  39. status = "okay";
  40. };
  41. sata@a8000 {
  42. status = "okay";
  43. };
  44. sdhci@d8000 {
  45. pinctrl-names = "default";
  46. pinctrl-0 = <&sdhci_pins>;
  47. status = "okay";
  48. bus-width = <8>;
  49. no-1-8-v;
  50. non-removable;
  51. };
  52. usb3@f0000 {
  53. status = "okay";
  54. };
  55. usb3@f8000 {
  56. status = "okay";
  57. };
  58. };
  59. pcie {
  60. status = "okay";
  61. pcie@1,0 {
  62. /* Port 0, Lane 0 */
  63. status = "okay";
  64. slot-power-limit-milliwatt = <10000>;
  65. };
  66. pcie@2,0 {
  67. /* Port 1, Lane 0 */
  68. status = "okay";
  69. slot-power-limit-milliwatt = <10000>;
  70. };
  71. pcie@3,0 {
  72. /* Port 2, Lane 0 */
  73. status = "okay";
  74. slot-power-limit-milliwatt = <10000>;
  75. };
  76. };
  77. };
  78. sfp: sfp {
  79. compatible = "sff,sfp";
  80. i2c-bus = <&sfp_i2c>;
  81. tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
  82. tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
  83. rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
  84. los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
  85. mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
  86. maximum-power-milliwatt = <3000>;
  87. /*
  88. * For now this has to be enabled at boot time by U-Boot when
  89. * a SFP module is present. Read more in the comment in the
  90. * eth2 node below.
  91. */
  92. status = "disabled";
  93. };
  94. sound {
  95. compatible = "simple-audio-card";
  96. simple-audio-card,name = "SPDIF";
  97. simple-audio-card,format = "i2s";
  98. simple-audio-card,cpu {
  99. sound-dai = <&audio_controller 1>;
  100. };
  101. simple-audio-card,codec {
  102. sound-dai = <&spdif_out>;
  103. };
  104. };
  105. spdif_out: spdif-out {
  106. #sound-dai-cells = <0>;
  107. compatible = "linux,spdif-dit";
  108. };
  109. };
  110. &audio_controller {
  111. /* Pin header U16, GPIO51 in SPDIFO mode */
  112. pinctrl-0 = <&spdif_pins>;
  113. pinctrl-names = "default";
  114. spdif-mode;
  115. status = "okay";
  116. };
  117. &bm {
  118. status = "okay";
  119. };
  120. &bm_bppi {
  121. status = "okay";
  122. };
  123. /* Connected to 88E6176 switch, port 6 */
  124. &eth0 {
  125. pinctrl-names = "default";
  126. pinctrl-0 = <&ge0_rgmii_pins>;
  127. status = "okay";
  128. phy-mode = "rgmii";
  129. buffer-manager = <&bm>;
  130. bm,pool-long = <0>;
  131. bm,pool-short = <3>;
  132. fixed-link {
  133. speed = <1000>;
  134. full-duplex;
  135. };
  136. };
  137. /* Connected to 88E6176 switch, port 5 */
  138. &eth1 {
  139. pinctrl-names = "default";
  140. pinctrl-0 = <&ge1_rgmii_pins>;
  141. status = "okay";
  142. phy-mode = "rgmii";
  143. buffer-manager = <&bm>;
  144. bm,pool-long = <1>;
  145. bm,pool-short = <3>;
  146. fixed-link {
  147. speed = <1000>;
  148. full-duplex;
  149. };
  150. };
  151. /* WAN port */
  152. &eth2 {
  153. /*
  154. * eth2 is connected via a multiplexor to both the SFP cage and to
  155. * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
  156. * a SFP module is present, as determined by the mode-def0 GPIO.
  157. *
  158. * Until kernel supports this configuration properly, in case SFP module
  159. * is present, U-Boot has to enable the sfp node above, remove phy
  160. * handle and add managed = "in-band-status" property.
  161. */
  162. status = "okay";
  163. phy-mode = "sgmii";
  164. phy-handle = <&phy1>;
  165. phys = <&comphy5 2>;
  166. sfp = <&sfp>;
  167. buffer-manager = <&bm>;
  168. bm,pool-long = <2>;
  169. bm,pool-short = <3>;
  170. label = "wan";
  171. };
  172. &i2c0 {
  173. pinctrl-names = "default";
  174. pinctrl-0 = <&i2c0_pins>;
  175. status = "okay";
  176. i2cmux@70 {
  177. compatible = "nxp,pca9547";
  178. #address-cells = <1>;
  179. #size-cells = <0>;
  180. reg = <0x70>;
  181. i2c@0 {
  182. #address-cells = <1>;
  183. #size-cells = <0>;
  184. reg = <0>;
  185. /* STM32F0 command interface at address 0x2a */
  186. led-controller@2b {
  187. compatible = "cznic,turris-omnia-leds";
  188. reg = <0x2b>;
  189. #address-cells = <1>;
  190. #size-cells = <0>;
  191. status = "okay";
  192. /*
  193. * LEDs are controlled by MCU (STM32F0) at
  194. * address 0x2b.
  195. *
  196. * LED functions are not stable yet:
  197. * - there are 3 LEDs connected via MCU to PCIe
  198. * ports. One of these ports supports mSATA.
  199. * There is no mSATA nor PCIe function.
  200. * For now we use LED_FUNCTION_WLAN, since
  201. * in most cases users have wifi cards in
  202. * these slots
  203. * - there are 2 LEDs dedicated for user: A and
  204. * B. Again there is no such function defined.
  205. * For now we use LED_FUNCTION_INDICATOR
  206. */
  207. multi-led@0 {
  208. reg = <0x0>;
  209. color = <LED_COLOR_ID_RGB>;
  210. function = LED_FUNCTION_INDICATOR;
  211. function-enumerator = <2>;
  212. };
  213. multi-led@1 {
  214. reg = <0x1>;
  215. color = <LED_COLOR_ID_RGB>;
  216. function = LED_FUNCTION_INDICATOR;
  217. function-enumerator = <1>;
  218. };
  219. multi-led@2 {
  220. reg = <0x2>;
  221. color = <LED_COLOR_ID_RGB>;
  222. function = LED_FUNCTION_WLAN;
  223. function-enumerator = <3>;
  224. };
  225. multi-led@3 {
  226. reg = <0x3>;
  227. color = <LED_COLOR_ID_RGB>;
  228. function = LED_FUNCTION_WLAN;
  229. function-enumerator = <2>;
  230. };
  231. multi-led@4 {
  232. reg = <0x4>;
  233. color = <LED_COLOR_ID_RGB>;
  234. function = LED_FUNCTION_WLAN;
  235. function-enumerator = <1>;
  236. };
  237. multi-led@5 {
  238. reg = <0x5>;
  239. color = <LED_COLOR_ID_RGB>;
  240. function = LED_FUNCTION_WAN;
  241. };
  242. multi-led@6 {
  243. reg = <0x6>;
  244. color = <LED_COLOR_ID_RGB>;
  245. function = LED_FUNCTION_LAN;
  246. function-enumerator = <4>;
  247. };
  248. multi-led@7 {
  249. reg = <0x7>;
  250. color = <LED_COLOR_ID_RGB>;
  251. function = LED_FUNCTION_LAN;
  252. function-enumerator = <3>;
  253. };
  254. multi-led@8 {
  255. reg = <0x8>;
  256. color = <LED_COLOR_ID_RGB>;
  257. function = LED_FUNCTION_LAN;
  258. function-enumerator = <2>;
  259. };
  260. multi-led@9 {
  261. reg = <0x9>;
  262. color = <LED_COLOR_ID_RGB>;
  263. function = LED_FUNCTION_LAN;
  264. function-enumerator = <1>;
  265. };
  266. multi-led@a {
  267. reg = <0xa>;
  268. color = <LED_COLOR_ID_RGB>;
  269. function = LED_FUNCTION_LAN;
  270. function-enumerator = <0>;
  271. };
  272. multi-led@b {
  273. reg = <0xb>;
  274. color = <LED_COLOR_ID_RGB>;
  275. function = LED_FUNCTION_POWER;
  276. };
  277. };
  278. eeprom@54 {
  279. compatible = "atmel,24c64";
  280. reg = <0x54>;
  281. /* The EEPROM contains data for bootloader.
  282. * Contents:
  283. * struct omnia_eeprom {
  284. * u32 magic; (=0x0341a034 in LE)
  285. * u32 ramsize; (in GiB)
  286. * char regdomain[4];
  287. * u32 crc32;
  288. * };
  289. */
  290. };
  291. };
  292. i2c@1 {
  293. #address-cells = <1>;
  294. #size-cells = <0>;
  295. reg = <1>;
  296. /* routed to PCIe0/mSATA connector (CN7A) */
  297. };
  298. i2c@2 {
  299. #address-cells = <1>;
  300. #size-cells = <0>;
  301. reg = <2>;
  302. /* routed to PCIe1/USB2 connector (CN61A) */
  303. };
  304. i2c@3 {
  305. #address-cells = <1>;
  306. #size-cells = <0>;
  307. reg = <3>;
  308. /* routed to PCIe2 connector (CN62A) */
  309. };
  310. sfp_i2c: i2c@4 {
  311. #address-cells = <1>;
  312. #size-cells = <0>;
  313. reg = <4>;
  314. /* routed to SFP+ */
  315. };
  316. i2c@5 {
  317. #address-cells = <1>;
  318. #size-cells = <0>;
  319. reg = <5>;
  320. /* ATSHA204A-MAHDA-T crypto module */
  321. crypto@64 {
  322. compatible = "atmel,atsha204a";
  323. reg = <0x64>;
  324. };
  325. };
  326. i2c@6 {
  327. #address-cells = <1>;
  328. #size-cells = <0>;
  329. reg = <6>;
  330. /* exposed on pin header */
  331. };
  332. i2c@7 {
  333. #address-cells = <1>;
  334. #size-cells = <0>;
  335. reg = <7>;
  336. pcawan: gpio@71 {
  337. /*
  338. * GPIO expander for SFP+ signals and
  339. * and phy irq
  340. */
  341. compatible = "nxp,pca9538";
  342. reg = <0x71>;
  343. pinctrl-names = "default";
  344. pinctrl-0 = <&pcawan_pins>;
  345. interrupt-parent = <&gpio1>;
  346. interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
  347. gpio-controller;
  348. #gpio-cells = <2>;
  349. };
  350. };
  351. };
  352. };
  353. &mdio {
  354. pinctrl-names = "default";
  355. pinctrl-0 = <&mdio_pins>;
  356. status = "okay";
  357. phy1: ethernet-phy@1 {
  358. compatible = "ethernet-phy-ieee802.3-c22";
  359. reg = <1>;
  360. marvell,reg-init = <3 18 0 0x4985>,
  361. <3 16 0xfff0 0x0001>;
  362. /* irq is connected to &pcawan pin 7 */
  363. };
  364. /* Switch MV88E6176 at address 0x10 */
  365. switch@10 {
  366. pinctrl-names = "default";
  367. pinctrl-0 = <&swint_pins>;
  368. compatible = "marvell,mv88e6085";
  369. #address-cells = <1>;
  370. #size-cells = <0>;
  371. dsa,member = <0 0>;
  372. reg = <0x10>;
  373. interrupt-parent = <&gpio1>;
  374. interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
  375. ports {
  376. #address-cells = <1>;
  377. #size-cells = <0>;
  378. ports@0 {
  379. reg = <0>;
  380. label = "lan0";
  381. };
  382. ports@1 {
  383. reg = <1>;
  384. label = "lan1";
  385. };
  386. ports@2 {
  387. reg = <2>;
  388. label = "lan2";
  389. };
  390. ports@3 {
  391. reg = <3>;
  392. label = "lan3";
  393. };
  394. ports@4 {
  395. reg = <4>;
  396. label = "lan4";
  397. };
  398. ports@5 {
  399. reg = <5>;
  400. label = "cpu";
  401. ethernet = <&eth1>;
  402. phy-mode = "rgmii-id";
  403. fixed-link {
  404. speed = <1000>;
  405. full-duplex;
  406. };
  407. };
  408. ports@6 {
  409. reg = <6>;
  410. label = "cpu";
  411. ethernet = <&eth0>;
  412. phy-mode = "rgmii-id";
  413. fixed-link {
  414. speed = <1000>;
  415. full-duplex;
  416. };
  417. };
  418. };
  419. };
  420. };
  421. &pinctrl {
  422. pcawan_pins: pcawan-pins {
  423. marvell,pins = "mpp46";
  424. marvell,function = "gpio";
  425. };
  426. swint_pins: swint-pins {
  427. marvell,pins = "mpp45";
  428. marvell,function = "gpio";
  429. };
  430. spi0cs0_pins: spi0cs0-pins {
  431. marvell,pins = "mpp25";
  432. marvell,function = "spi0";
  433. };
  434. spi0cs2_pins: spi0cs2-pins {
  435. marvell,pins = "mpp26";
  436. marvell,function = "spi0";
  437. };
  438. };
  439. &spi0 {
  440. pinctrl-names = "default";
  441. pinctrl-0 = <&spi0_pins &spi0cs0_pins>;
  442. status = "okay";
  443. flash@0 {
  444. compatible = "spansion,s25fl164k", "jedec,spi-nor";
  445. #address-cells = <1>;
  446. #size-cells = <1>;
  447. reg = <0>;
  448. spi-max-frequency = <40000000>;
  449. partitions {
  450. compatible = "fixed-partitions";
  451. #address-cells = <1>;
  452. #size-cells = <1>;
  453. partition@0 {
  454. reg = <0x0 0x00100000>;
  455. label = "U-Boot";
  456. };
  457. partition@100000 {
  458. reg = <0x00100000 0x00700000>;
  459. label = "Rescue system";
  460. };
  461. };
  462. };
  463. /* MISO, MOSI, SCLK and CS2 are routed to pin header CN11 */
  464. };
  465. &uart0 {
  466. /* Pin header CN10 */
  467. pinctrl-names = "default";
  468. pinctrl-0 = <&uart0_pins>;
  469. status = "okay";
  470. };
  471. &uart1 {
  472. /* Pin header CN11 */
  473. pinctrl-names = "default";
  474. pinctrl-0 = <&uart1_pins>;
  475. status = "okay";
  476. };