mt7621.dtsi 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. #include <dt-bindings/interrupt-controller/mips-gic.h>
  3. #include <dt-bindings/gpio/gpio.h>
  4. #include <dt-bindings/clock/mt7621-clk.h>
  5. #include <dt-bindings/reset/mt7621-reset.h>
  6. / {
  7. #address-cells = <1>;
  8. #size-cells = <1>;
  9. compatible = "mediatek,mt7621-soc";
  10. cpus {
  11. #address-cells = <1>;
  12. #size-cells = <0>;
  13. cpu@0 {
  14. device_type = "cpu";
  15. compatible = "mips,mips1004Kc";
  16. reg = <0>;
  17. };
  18. cpu@1 {
  19. device_type = "cpu";
  20. compatible = "mips,mips1004Kc";
  21. reg = <1>;
  22. };
  23. };
  24. cpuintc: cpuintc {
  25. #address-cells = <0>;
  26. #interrupt-cells = <1>;
  27. interrupt-controller;
  28. compatible = "mti,cpu-interrupt-controller";
  29. };
  30. mmc_fixed_3v3: regulator-3v3 {
  31. compatible = "regulator-fixed";
  32. regulator-name = "mmc_power";
  33. regulator-min-microvolt = <3300000>;
  34. regulator-max-microvolt = <3300000>;
  35. enable-active-high;
  36. regulator-always-on;
  37. };
  38. mmc_fixed_1v8_io: regulator-1v8 {
  39. compatible = "regulator-fixed";
  40. regulator-name = "mmc_io";
  41. regulator-min-microvolt = <1800000>;
  42. regulator-max-microvolt = <1800000>;
  43. enable-active-high;
  44. regulator-always-on;
  45. };
  46. palmbus: palmbus@1e000000 {
  47. compatible = "palmbus";
  48. reg = <0x1e000000 0x100000>;
  49. ranges = <0x0 0x1e000000 0x0fffff>;
  50. #address-cells = <1>;
  51. #size-cells = <1>;
  52. sysc: syscon@0 {
  53. compatible = "mediatek,mt7621-sysc", "syscon";
  54. reg = <0x0 0x100>;
  55. #clock-cells = <1>;
  56. #reset-cells = <1>;
  57. ralink,memctl = <&memc>;
  58. clock-output-names = "xtal", "cpu", "bus",
  59. "50m", "125m", "150m",
  60. "250m", "270m";
  61. };
  62. wdt: wdt@100 {
  63. compatible = "mediatek,mt7621-wdt";
  64. reg = <0x100 0x100>;
  65. };
  66. gpio: gpio@600 {
  67. #gpio-cells = <2>;
  68. #interrupt-cells = <2>;
  69. compatible = "mediatek,mt7621-gpio";
  70. gpio-controller;
  71. gpio-ranges = <&pinctrl 0 0 95>;
  72. interrupt-controller;
  73. reg = <0x600 0x100>;
  74. interrupt-parent = <&gic>;
  75. interrupts = <GIC_SHARED 12 IRQ_TYPE_LEVEL_HIGH>;
  76. };
  77. i2c: i2c@900 {
  78. compatible = "mediatek,mt7621-i2c";
  79. reg = <0x900 0x100>;
  80. clocks = <&sysc MT7621_CLK_I2C>;
  81. clock-names = "i2c";
  82. resets = <&sysc MT7621_RST_I2C>;
  83. reset-names = "i2c";
  84. #address-cells = <1>;
  85. #size-cells = <0>;
  86. status = "disabled";
  87. pinctrl-names = "default";
  88. pinctrl-0 = <&i2c_pins>;
  89. };
  90. memc: memory-controller@5000 {
  91. compatible = "mediatek,mt7621-memc", "syscon";
  92. reg = <0x5000 0x1000>;
  93. };
  94. serial0: serial@c00 {
  95. compatible = "ns16550a";
  96. reg = <0xc00 0x100>;
  97. clocks = <&sysc MT7621_CLK_UART1>;
  98. interrupt-parent = <&gic>;
  99. interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
  100. reg-shift = <2>;
  101. reg-io-width = <4>;
  102. no-loopback-test;
  103. };
  104. spi0: spi@b00 {
  105. status = "disabled";
  106. compatible = "ralink,mt7621-spi";
  107. reg = <0xb00 0x100>;
  108. clocks = <&sysc MT7621_CLK_SPI>;
  109. clock-names = "spi";
  110. resets = <&sysc MT7621_RST_SPI>;
  111. reset-names = "spi";
  112. #address-cells = <1>;
  113. #size-cells = <0>;
  114. pinctrl-names = "default";
  115. pinctrl-0 = <&spi_pins>;
  116. };
  117. };
  118. pinctrl: pinctrl {
  119. compatible = "ralink,mt7621-pinctrl";
  120. i2c_pins: i2c0-pins {
  121. pinmux {
  122. groups = "i2c";
  123. function = "i2c";
  124. };
  125. };
  126. spi_pins: spi0-pins {
  127. pinmux {
  128. groups = "spi";
  129. function = "spi";
  130. };
  131. };
  132. uart1_pins: uart1-pins {
  133. pinmux {
  134. groups = "uart1";
  135. function = "uart1";
  136. };
  137. };
  138. uart2_pins: uart2-pins {
  139. pinmux {
  140. groups = "uart2";
  141. function = "uart2";
  142. };
  143. };
  144. uart3_pins: uart3-pins {
  145. pinmux {
  146. groups = "uart3";
  147. function = "uart3";
  148. };
  149. };
  150. rgmii1_pins: rgmii1-pins {
  151. pinmux {
  152. groups = "rgmii1";
  153. function = "rgmii1";
  154. };
  155. };
  156. rgmii2_pins: rgmii2-pins {
  157. pinmux {
  158. groups = "rgmii2";
  159. function = "rgmii2";
  160. };
  161. };
  162. mdio_pins: mdio0-pins {
  163. pinmux {
  164. groups = "mdio";
  165. function = "mdio";
  166. };
  167. };
  168. pcie_pins: pcie0-pins {
  169. pinmux {
  170. groups = "pcie";
  171. function = "gpio";
  172. };
  173. };
  174. nand_pins: nand0-pins {
  175. spi-pinmux {
  176. groups = "spi";
  177. function = "nand1";
  178. };
  179. sdhci-pinmux {
  180. groups = "sdhci";
  181. function = "nand2";
  182. };
  183. };
  184. sdhci_pins: sdhci0-pins {
  185. pinmux {
  186. groups = "sdhci";
  187. function = "sdhci";
  188. };
  189. };
  190. };
  191. mmc: mmc@1e130000 {
  192. status = "disabled";
  193. compatible = "mediatek,mt7620-mmc";
  194. reg = <0x1e130000 0x4000>;
  195. bus-width = <4>;
  196. max-frequency = <48000000>;
  197. cap-sd-highspeed;
  198. cap-mmc-highspeed;
  199. vmmc-supply = <&mmc_fixed_3v3>;
  200. vqmmc-supply = <&mmc_fixed_1v8_io>;
  201. disable-wp;
  202. pinctrl-names = "default", "state_uhs";
  203. pinctrl-0 = <&sdhci_pins>;
  204. pinctrl-1 = <&sdhci_pins>;
  205. clocks = <&sysc MT7621_CLK_SHXC>,
  206. <&sysc MT7621_CLK_50M>;
  207. clock-names = "source", "hclk";
  208. interrupt-parent = <&gic>;
  209. interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
  210. };
  211. usb: usb@1e1c0000 {
  212. compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
  213. reg = <0x1e1c0000 0x1000
  214. 0x1e1d0700 0x0100>;
  215. reg-names = "mac", "ippc";
  216. clocks = <&sysc MT7621_CLK_XTAL>;
  217. clock-names = "sys_ck";
  218. interrupt-parent = <&gic>;
  219. interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
  220. };
  221. gic: interrupt-controller@1fbc0000 {
  222. compatible = "mti,gic";
  223. reg = <0x1fbc0000 0x2000>;
  224. interrupt-controller;
  225. #interrupt-cells = <3>;
  226. mti,reserved-cpu-vectors = <7>;
  227. timer {
  228. compatible = "mti,gic-timer";
  229. interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
  230. clocks = <&sysc MT7621_CLK_CPU>;
  231. };
  232. };
  233. cpc: cpc@1fbf0000 {
  234. compatible = "mti,mips-cpc";
  235. reg = <0x1fbf0000 0x8000>;
  236. };
  237. cdmm: cdmm@1fbf8000 {
  238. compatible = "mti,mips-cdmm";
  239. reg = <0x1fbf8000 0x8000>;
  240. };
  241. ethernet: ethernet@1e100000 {
  242. compatible = "mediatek,mt7621-eth";
  243. reg = <0x1e100000 0x10000>;
  244. clocks = <&sysc MT7621_CLK_FE>,
  245. <&sysc MT7621_CLK_ETH>;
  246. clock-names = "fe", "ethif";
  247. #address-cells = <1>;
  248. #size-cells = <0>;
  249. resets = <&sysc MT7621_RST_FE &sysc MT7621_RST_ETH>;
  250. reset-names = "fe", "eth";
  251. interrupt-parent = <&gic>;
  252. interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>;
  253. mediatek,ethsys = <&sysc>;
  254. pinctrl-names = "default";
  255. pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>, <&rgmii2_pins>;
  256. gmac0: mac@0 {
  257. compatible = "mediatek,eth-mac";
  258. reg = <0>;
  259. phy-mode = "trgmii";
  260. fixed-link {
  261. speed = <1000>;
  262. full-duplex;
  263. pause;
  264. };
  265. };
  266. gmac1: mac@1 {
  267. compatible = "mediatek,eth-mac";
  268. reg = <1>;
  269. status = "disabled";
  270. phy-mode = "rgmii";
  271. };
  272. mdio: mdio-bus {
  273. #address-cells = <1>;
  274. #size-cells = <0>;
  275. switch0: switch@1f {
  276. compatible = "mediatek,mt7621";
  277. reg = <0x1f>;
  278. mediatek,mcm;
  279. resets = <&sysc MT7621_RST_MCM>;
  280. reset-names = "mcm";
  281. interrupt-controller;
  282. #interrupt-cells = <1>;
  283. interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
  284. ports {
  285. #address-cells = <1>;
  286. #size-cells = <0>;
  287. port@0 {
  288. status = "disabled";
  289. reg = <0>;
  290. label = "lan0";
  291. };
  292. port@1 {
  293. status = "disabled";
  294. reg = <1>;
  295. label = "lan1";
  296. };
  297. port@2 {
  298. status = "disabled";
  299. reg = <2>;
  300. label = "lan2";
  301. };
  302. port@3 {
  303. status = "disabled";
  304. reg = <3>;
  305. label = "lan3";
  306. };
  307. port@4 {
  308. status = "disabled";
  309. reg = <4>;
  310. label = "lan4";
  311. };
  312. port@6 {
  313. reg = <6>;
  314. label = "cpu";
  315. ethernet = <&gmac0>;
  316. phy-mode = "trgmii";
  317. fixed-link {
  318. speed = <1000>;
  319. full-duplex;
  320. pause;
  321. };
  322. };
  323. };
  324. };
  325. };
  326. };
  327. pcie: pcie@1e140000 {
  328. compatible = "mediatek,mt7621-pci";
  329. reg = <0x1e140000 0x100>, /* host-pci bridge registers */
  330. <0x1e142000 0x100>, /* pcie port 0 RC control registers */
  331. <0x1e143000 0x100>, /* pcie port 1 RC control registers */
  332. <0x1e144000 0x100>; /* pcie port 2 RC control registers */
  333. #address-cells = <3>;
  334. #size-cells = <2>;
  335. pinctrl-names = "default";
  336. pinctrl-0 = <&pcie_pins>;
  337. device_type = "pci";
  338. ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>, /* pci memory */
  339. <0x01000000 0 0x00000000 0x1e160000 0 0x00010000>; /* io space */
  340. #interrupt-cells = <1>;
  341. interrupt-map-mask = <0xF800 0 0 0>;
  342. interrupt-map = <0x0000 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
  343. <0x0800 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
  344. <0x1000 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
  345. status = "disabled";
  346. reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
  347. pcie@0,0 {
  348. reg = <0x0000 0 0 0 0>;
  349. #address-cells = <3>;
  350. #size-cells = <2>;
  351. device_type = "pci";
  352. #interrupt-cells = <1>;
  353. interrupt-map-mask = <0 0 0 0>;
  354. interrupt-map = <0 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
  355. resets = <&sysc MT7621_RST_PCIE0>;
  356. clocks = <&sysc MT7621_CLK_PCIE0>;
  357. phys = <&pcie0_phy 1>;
  358. phy-names = "pcie-phy0";
  359. ranges;
  360. };
  361. pcie@1,0 {
  362. reg = <0x0800 0 0 0 0>;
  363. #address-cells = <3>;
  364. #size-cells = <2>;
  365. device_type = "pci";
  366. #interrupt-cells = <1>;
  367. interrupt-map-mask = <0 0 0 0>;
  368. interrupt-map = <0 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
  369. resets = <&sysc MT7621_RST_PCIE1>;
  370. clocks = <&sysc MT7621_CLK_PCIE1>;
  371. phys = <&pcie0_phy 1>;
  372. phy-names = "pcie-phy1";
  373. ranges;
  374. };
  375. pcie@2,0 {
  376. reg = <0x1000 0 0 0 0>;
  377. #address-cells = <3>;
  378. #size-cells = <2>;
  379. device_type = "pci";
  380. #interrupt-cells = <1>;
  381. interrupt-map-mask = <0 0 0 0>;
  382. interrupt-map = <0 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
  383. resets = <&sysc MT7621_RST_PCIE2>;
  384. clocks = <&sysc MT7621_CLK_PCIE2>;
  385. phys = <&pcie2_phy 0>;
  386. phy-names = "pcie-phy2";
  387. ranges;
  388. };
  389. };
  390. pcie0_phy: pcie-phy@1e149000 {
  391. compatible = "mediatek,mt7621-pci-phy";
  392. reg = <0x1e149000 0x0700>;
  393. clocks = <&sysc MT7621_CLK_XTAL>;
  394. #phy-cells = <1>;
  395. };
  396. pcie2_phy: pcie-phy@1e14a000 {
  397. compatible = "mediatek,mt7621-pci-phy";
  398. reg = <0x1e14a000 0x0700>;
  399. clocks = <&sysc MT7621_CLK_XTAL>;
  400. #phy-cells = <1>;
  401. };
  402. };