turris1x.dts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Turris 1.x Device Tree Source
  4. *
  5. * Copyright 2013 - 2022 CZ.NIC z.s.p.o. (http://www.nic.cz/)
  6. *
  7. * Pinout, Schematics and Altium hardware design files are open source
  8. * and available at: https://docs.turris.cz/hw/turris-1x/turris-1x/
  9. */
  10. #include <dt-bindings/gpio/gpio.h>
  11. #include <dt-bindings/interrupt-controller/irq.h>
  12. #include <dt-bindings/leds/common.h>
  13. /include/ "fsl/p2020si-pre.dtsi"
  14. / {
  15. model = "Turris 1.x";
  16. compatible = "cznic,turris1x", "fsl,P2020RDB-PC"; /* fsl,P2020RDB-PC is required for booting Linux */
  17. aliases {
  18. ethernet0 = &enet0;
  19. ethernet1 = &enet1;
  20. ethernet2 = &enet2;
  21. serial0 = &serial0;
  22. serial1 = &serial1;
  23. pci0 = &pci0;
  24. pci1 = &pci1;
  25. pci2 = &pci2;
  26. spi0 = &spi0;
  27. };
  28. memory {
  29. device_type = "memory";
  30. };
  31. soc: soc@ffe00000 {
  32. ranges = <0x0 0x0 0xffe00000 0x00100000>;
  33. i2c@3000 {
  34. /* PCA9557PW GPIO controller for boot config */
  35. gpio-controller@18 {
  36. compatible = "nxp,pca9557";
  37. label = "bootcfg";
  38. reg = <0x18>;
  39. #gpio-cells = <2>;
  40. gpio-controller;
  41. polarity = <0x00>;
  42. };
  43. /* STM32F030R8T6 MCU for power control */
  44. power-control@2a {
  45. /*
  46. * Turris Power Control firmware runs on STM32F0 MCU.
  47. * This firmware is open source and available at:
  48. * https://gitlab.nic.cz/turris/hw/turris_power_control
  49. */
  50. reg = <0x2a>;
  51. };
  52. /* DDR3 SPD/EEPROM PSWP instruction */
  53. eeprom@32 {
  54. reg = <0x32>;
  55. };
  56. /* SA56004ED temperature control */
  57. temperature-sensor@4c {
  58. compatible = "nxp,sa56004";
  59. reg = <0x4c>;
  60. interrupt-parent = <&gpio>;
  61. interrupts = <12 IRQ_TYPE_LEVEL_LOW>, /* GPIO12 - ALERT pin */
  62. <13 IRQ_TYPE_LEVEL_LOW>; /* GPIO13 - CRIT pin */
  63. #address-cells = <1>;
  64. #size-cells = <0>;
  65. /* Local temperature sensor (SA56004ED internal) */
  66. channel@0 {
  67. reg = <0>;
  68. label = "board";
  69. };
  70. /* Remote temperature sensor (D+/D- connected to P2020 CPU Temperature Diode) */
  71. channel@1 {
  72. reg = <1>;
  73. label = "cpu";
  74. };
  75. };
  76. /* DDR3 SPD/EEPROM */
  77. eeprom@52 {
  78. compatible = "atmel,spd";
  79. reg = <0x52>;
  80. };
  81. /* MCP79402-I/ST Protected EEPROM */
  82. eeprom@57 {
  83. reg = <0x57>;
  84. };
  85. /* ATSHA204-TH-DA-T crypto module */
  86. crypto@64 {
  87. compatible = "atmel,atsha204";
  88. reg = <0x64>;
  89. };
  90. /* IDT6V49205BNLGI clock generator */
  91. clock-generator@69 {
  92. compatible = "idt,6v49205b";
  93. reg = <0x69>;
  94. };
  95. /* MCP79402-I/ST RTC */
  96. rtc@6f {
  97. compatible = "microchip,mcp7940x";
  98. reg = <0x6f>;
  99. interrupt-parent = <&gpio>;
  100. interrupts = <14 0>; /* GPIO14 - MFP pin */
  101. };
  102. };
  103. /* SPI on connector P1 */
  104. spi0: spi@7000 {
  105. };
  106. gpio: gpio-controller@fc00 {
  107. #interrupt-cells = <2>;
  108. interrupt-controller;
  109. };
  110. /* Connected to SMSC USB2412-DZK 2-Port USB 2.0 Hub Controller */
  111. usb@22000 {
  112. phy_type = "ulpi";
  113. dr_mode = "host";
  114. };
  115. enet0: ethernet@24000 {
  116. /* Connected to port 6 of QCA8337N-AL3C switch */
  117. phy-connection-type = "rgmii-id";
  118. fixed-link {
  119. speed = <1000>;
  120. full-duplex;
  121. };
  122. };
  123. mdio@24520 {
  124. /* KSZ9031RNXCA ethernet phy for WAN port */
  125. phy: ethernet-phy@7 {
  126. interrupts = <3 1 0 0>;
  127. reg = <0x7>;
  128. };
  129. /* QCA8337N-AL3C switch with integrated ethernet PHYs for LAN ports */
  130. switch@10 {
  131. compatible = "qca,qca8337";
  132. interrupts = <2 1 0 0>;
  133. reg = <0x10>;
  134. ports {
  135. #address-cells = <1>;
  136. #size-cells = <0>;
  137. port@0 {
  138. reg = <0>;
  139. label = "cpu";
  140. ethernet = <&enet1>;
  141. phy-mode = "rgmii-id";
  142. fixed-link {
  143. speed = <1000>;
  144. full-duplex;
  145. };
  146. };
  147. port@1 {
  148. reg = <1>;
  149. label = "lan5";
  150. };
  151. port@2 {
  152. reg = <2>;
  153. label = "lan4";
  154. };
  155. port@3 {
  156. reg = <3>;
  157. label = "lan3";
  158. };
  159. port@4 {
  160. reg = <4>;
  161. label = "lan2";
  162. };
  163. port@5 {
  164. reg = <5>;
  165. label = "lan1";
  166. };
  167. port@6 {
  168. reg = <6>;
  169. label = "cpu";
  170. ethernet = <&enet0>;
  171. phy-mode = "rgmii-id";
  172. fixed-link {
  173. speed = <1000>;
  174. full-duplex;
  175. };
  176. };
  177. };
  178. };
  179. };
  180. ptp_clock@24e00 {
  181. fsl,tclk-period = <5>;
  182. fsl,tmr-prsc = <200>;
  183. fsl,tmr-add = <0xcccccccd>;
  184. fsl,tmr-fiper1 = <0x3b9ac9fb>;
  185. fsl,tmr-fiper2 = <0x0001869b>;
  186. fsl,max-adj = <249999999>;
  187. };
  188. enet1: ethernet@25000 {
  189. /* Connected to port 0 of QCA8337N-AL3C switch */
  190. phy-connection-type = "rgmii-id";
  191. fixed-link {
  192. speed = <1000>;
  193. full-duplex;
  194. };
  195. };
  196. mdio@25520 {
  197. status = "disabled";
  198. };
  199. enet2: ethernet@26000 {
  200. /* Connected to KSZ9031RNXCA ethernet phy (WAN port) */
  201. label = "wan";
  202. phy-handle = <&phy>;
  203. phy-connection-type = "rgmii-id";
  204. };
  205. mdio@26520 {
  206. status = "disabled";
  207. };
  208. sdhc@2e000 {
  209. bus-width = <4>;
  210. cd-gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
  211. };
  212. };
  213. lbc: localbus@ffe05000 {
  214. reg = <0 0xffe05000 0 0x1000>;
  215. ranges = <0x0 0x0 0x0 0xef000000 0x01000000>, /* NOR */
  216. <0x1 0x0 0x0 0xff800000 0x00040000>, /* NAND */
  217. <0x3 0x0 0x0 0xffa00000 0x00020000>; /* CPLD */
  218. /* S29GL128P90TFIR10 NOR */
  219. nor@0,0 {
  220. compatible = "cfi-flash";
  221. reg = <0x0 0x0 0x01000000>;
  222. bank-width = <2>;
  223. device-width = <1>;
  224. partitions {
  225. compatible = "fixed-partitions";
  226. #address-cells = <1>;
  227. #size-cells = <1>;
  228. partition@0 {
  229. /* 128 kB for Device Tree Blob */
  230. reg = <0x00000000 0x00020000>;
  231. label = "dtb";
  232. };
  233. partition@20000 {
  234. /* 1.7 MB for Linux Kernel Image */
  235. reg = <0x00020000 0x001a0000>;
  236. label = "kernel";
  237. };
  238. partition@1c0000 {
  239. /* 1.5 MB for Rescue JFFS2 Root File System */
  240. reg = <0x001c0000 0x00180000>;
  241. label = "rescue";
  242. };
  243. partition@340000 {
  244. /* 11 MB for TAR.XZ Archive with Factory content of NAND Root File System */
  245. reg = <0x00340000 0x00b00000>;
  246. label = "factory";
  247. };
  248. partition@e40000 {
  249. /* 768 kB for Certificates JFFS2 File System */
  250. reg = <0x00e40000 0x000c0000>;
  251. label = "certificates";
  252. };
  253. /* free unused space 0x00f00000-0x00f20000 */
  254. partition@f20000 {
  255. /* 128 kB for U-Boot Environment Variables */
  256. reg = <0x00f20000 0x00020000>;
  257. label = "u-boot-env";
  258. };
  259. partition@f40000 {
  260. /* 768 kB for U-Boot Bootloader Image */
  261. reg = <0x00f40000 0x000c0000>;
  262. label = "u-boot";
  263. };
  264. };
  265. };
  266. /* MT29F2G08ABAEAWP:E NAND */
  267. nand@1,0 {
  268. compatible = "fsl,p2020-fcm-nand", "fsl,elbc-fcm-nand";
  269. reg = <0x1 0x0 0x00040000>;
  270. nand-ecc-mode = "soft";
  271. nand-ecc-algo = "bch";
  272. partitions {
  273. compatible = "fixed-partitions";
  274. #address-cells = <1>;
  275. #size-cells = <1>;
  276. partition@0 {
  277. /* 256 MB for UBI with one volume: UBIFS Root File System */
  278. reg = <0x00000000 0x10000000>;
  279. label = "rootfs";
  280. };
  281. };
  282. };
  283. /* LCMXO1200C-3FTN256C FPGA */
  284. cpld@3,0 {
  285. /*
  286. * Turris CPLD firmware which runs on this Lattice FPGA,
  287. * is extended version of P1021RDB-PC CPLD v4.1 firmware.
  288. * It is backward compatible with its original version
  289. * and the only extension is support for Turris LEDs.
  290. * Turris CPLD firmware is open source and available at:
  291. * https://gitlab.nic.cz/turris/hw/turris_cpld/-/blob/master/CZ_NIC_Router_CPLD.v
  292. */
  293. compatible = "cznic,turris1x-cpld", "fsl,p1021rdb-pc-cpld", "simple-bus", "syscon";
  294. reg = <0x3 0x0 0x30>;
  295. #address-cells = <1>;
  296. #size-cells = <1>;
  297. ranges = <0x0 0x3 0x0 0x00020000>;
  298. /* MAX6370KA+T watchdog */
  299. watchdog@2 {
  300. /*
  301. * CPLD firmware maps SET0, SET1 and SET2
  302. * input logic of MAX6370KA+T chip to CPLD
  303. * memory space at byte offset 0x2. WDI
  304. * input logic is outside of the CPLD and
  305. * connected via external GPIO.
  306. */
  307. compatible = "maxim,max6370";
  308. reg = <0x02 0x01>;
  309. gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
  310. };
  311. reboot@d {
  312. compatible = "syscon-reboot";
  313. reg = <0x0d 0x01>;
  314. offset = <0x0d>;
  315. mask = <0x01>;
  316. value = <0x01>;
  317. };
  318. led-controller@13 {
  319. /*
  320. * LEDs are controlled by CPLD firmware.
  321. * All five LAN LEDs share common RGB settings
  322. * and so it is not possible to set different
  323. * colors on different LAN ports.
  324. */
  325. compatible = "cznic,turris1x-leds";
  326. reg = <0x13 0x1d>;
  327. #address-cells = <1>;
  328. #size-cells = <0>;
  329. multi-led@0 {
  330. reg = <0x0>;
  331. color = <LED_COLOR_ID_RGB>;
  332. function = LED_FUNCTION_WAN;
  333. };
  334. multi-led@1 {
  335. reg = <0x1>;
  336. color = <LED_COLOR_ID_RGB>;
  337. function = LED_FUNCTION_LAN;
  338. function-enumerator = <5>;
  339. };
  340. multi-led@2 {
  341. reg = <0x2>;
  342. color = <LED_COLOR_ID_RGB>;
  343. function = LED_FUNCTION_LAN;
  344. function-enumerator = <4>;
  345. };
  346. multi-led@3 {
  347. reg = <0x3>;
  348. color = <LED_COLOR_ID_RGB>;
  349. function = LED_FUNCTION_LAN;
  350. function-enumerator = <3>;
  351. };
  352. multi-led@4 {
  353. reg = <0x4>;
  354. color = <LED_COLOR_ID_RGB>;
  355. function = LED_FUNCTION_LAN;
  356. function-enumerator = <2>;
  357. };
  358. multi-led@5 {
  359. reg = <0x5>;
  360. color = <LED_COLOR_ID_RGB>;
  361. function = LED_FUNCTION_LAN;
  362. function-enumerator = <1>;
  363. };
  364. multi-led@6 {
  365. reg = <0x6>;
  366. color = <LED_COLOR_ID_RGB>;
  367. function = LED_FUNCTION_WLAN;
  368. };
  369. multi-led@7 {
  370. reg = <0x7>;
  371. color = <LED_COLOR_ID_RGB>;
  372. function = LED_FUNCTION_POWER;
  373. };
  374. };
  375. };
  376. };
  377. pci2: pcie@ffe08000 {
  378. /*
  379. * PCIe bus for on-board TUSB7340RKM USB 3.0 xHCI controller.
  380. * This xHCI controller is available only on Turris 1.1 boards.
  381. * Turris 1.0 boards have nothing connected to this PCIe bus,
  382. * so system would see only PCIe Root Port of this PCIe Root
  383. * Complex. TUSB7340RKM xHCI controller has four SuperSpeed
  384. * channels. Channel 0 is connected to the front USB 3.0 port,
  385. * channel 1 (but only USB 2.0 subset) to USB 2.0 pins on mPCIe
  386. * slot 1 (CN5), channels 2 and 3 to connector P600.
  387. *
  388. * P2020 PCIe Root Port does not use PCIe MEM and xHCI controller
  389. * uses 64kB + 8kB of PCIe MEM. No PCIe IO is used or required.
  390. * So allocate 128kB of PCIe MEM for this PCIe bus.
  391. */
  392. reg = <0 0xffe08000 0 0x1000>;
  393. ranges = <0x02000000 0x0 0xc0000000 0 0xc0000000 0x0 0x00020000>, /* MEM */
  394. <0x01000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; /* IO */
  395. pcie@0 {
  396. ranges;
  397. };
  398. };
  399. pci1: pcie@ffe09000 {
  400. /* PCIe bus on mPCIe slot 2 (CN6) for expansion mPCIe card */
  401. reg = <0 0xffe09000 0 0x1000>;
  402. ranges = <0x02000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000>, /* MEM */
  403. <0x01000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; /* IO */
  404. pcie@0 {
  405. ranges;
  406. };
  407. };
  408. pci0: pcie@ffe0a000 {
  409. /*
  410. * PCIe bus on mPCIe slot 1 (CN5) for expansion mPCIe card.
  411. * Turris 1.1 boards have in this mPCIe slot additional USB 2.0
  412. * pins via channel 1 of TUSB7340RKM xHCI controller and also
  413. * additional SIM card slot, both for USB-based WWAN cards.
  414. */
  415. reg = <0 0xffe0a000 0 0x1000>;
  416. ranges = <0x02000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000>, /* MEM */
  417. <0x01000000 0x0 0x00000000 0 0xffc00000 0x0 0x00010000>; /* IO */
  418. pcie@0 {
  419. ranges;
  420. };
  421. };
  422. };
  423. /include/ "fsl/p2020si-post.dtsi"