rtl9302_zyxel_xgs1250-12.dts 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /dts-v1/;
  3. #include "rtl930x.dtsi"
  4. #include <dt-bindings/input/input.h>
  5. #include <dt-bindings/gpio/gpio.h>
  6. #include <dt-bindings/leds/common.h>
  7. / {
  8. compatible = "zyxel,xgs1250-12", "realtek,rtl838x-soc";
  9. model = "Zyxel XGS1250-12 Switch";
  10. aliases {
  11. led-boot = &led_pwr_sys;
  12. led-failsafe = &led_pwr_sys;
  13. led-running = &led_pwr_sys;
  14. led-upgrade = &led_pwr_sys;
  15. };
  16. keys {
  17. compatible = "gpio-keys";
  18. mode {
  19. label = "reset";
  20. gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
  21. linux,code = <KEY_RESTART>;
  22. };
  23. };
  24. /* i2c of the SFP cage: port 12 */
  25. i2c0: i2c-rtl9300 {
  26. compatible = "realtek,rtl9300-i2c";
  27. reg = <0x1b00036c 0x3c>;
  28. #address-cells = <1>;
  29. #size-cells = <0>;
  30. sda-pin = <10>;
  31. scl-pin = <8>;
  32. clock-frequency = <100000>;
  33. };
  34. leds {
  35. compatible = "gpio-leds";
  36. pinctrl-names = "default";
  37. pinctrl-0 = <&pinmux_disable_sys_led>;
  38. led_pwr_sys: led-0 {
  39. label = "green:power";
  40. color = <LED_COLOR_ID_GREEN>;
  41. function = LED_FUNCTION_POWER;
  42. gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
  43. };
  44. };
  45. sfp0: sfp-p12 {
  46. compatible = "sff,sfp";
  47. i2c-bus = <&i2c0>;
  48. los-gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>;
  49. tx-fault-gpio = <&gpio0 20 GPIO_ACTIVE_HIGH>;
  50. mod-def0-gpio = <&gpio0 16 GPIO_ACTIVE_LOW>;
  51. tx-disable-gpio = <&gpio0 15 GPIO_ACTIVE_HIGH>;
  52. };
  53. led_set: led_set@0 {
  54. compatible = "realtek,rtl9300-leds";
  55. led_set0 = <0x0000 0xffff 0x0a20 0x0b80>; // LED set 0: 1000Mbps, 10/100Mbps
  56. led_set1 = <0x0a0b 0x0a28 0x0a82 0x0a0b>; // LED set 1: (10G, 5G, 2.5G) (2.5G, 1G)
  57. // (5G, 10/100) (10G, 5G, 2.5G)
  58. led_set2 = <0x0000 0xffff 0x0a20 0x0a01>; // LED set 2: 1000MBit, 10GBit
  59. };
  60. };
  61. &spi0 {
  62. status = "okay";
  63. flash@0 {
  64. compatible = "jedec,spi-nor";
  65. reg = <0>;
  66. spi-max-frequency = <10000000>;
  67. partitions {
  68. compatible = "fixed-partitions";
  69. #address-cells = <1>;
  70. #size-cells = <1>;
  71. partition@0 {
  72. label = "u-boot";
  73. reg = <0x0 0xe0000>;
  74. read-only;
  75. };
  76. partition@e0000 {
  77. label = "u-boot-env";
  78. reg = <0xe0000 0x10000>;
  79. };
  80. partition@f0000 {
  81. label = "u-boot-env2";
  82. reg = <0xf0000 0x10000>;
  83. read-only;
  84. };
  85. partition@100000 {
  86. label = "jffs";
  87. reg = <0x100000 0x100000>;
  88. };
  89. partition@200000 {
  90. label = "jffs2";
  91. reg = <0x200000 0x100000>;
  92. };
  93. partition@b300000 {
  94. label = "firmware";
  95. reg = <0x300000 0xce0000>;
  96. compatible = "openwrt,uimage", "denx,uimage";
  97. openwrt,ih-magic = <0x93001250>;
  98. };
  99. partition@fe0000 {
  100. label = "log";
  101. reg = <0xfe0000 0x20000>;
  102. };
  103. };
  104. };
  105. };
  106. &ethernet0 {
  107. mdio: mdio-bus {
  108. compatible = "realtek,rtl838x-mdio";
  109. regmap = <&ethernet0>;
  110. #address-cells = <1>;
  111. #size-cells = <0>;
  112. /* External RTL8218D PHY */
  113. phy0: ethernet-phy@0 {
  114. reg = <0>;
  115. compatible = "ethernet-phy-ieee802.3-c22";
  116. rtl9300,smi-address = <0 0>;
  117. sds = < 2 >;
  118. // Disabled because we do not know how to bring up again
  119. // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
  120. };
  121. phy1: ethernet-phy@1 {
  122. reg = <1>;
  123. compatible = "ethernet-phy-ieee802.3-c22";
  124. rtl9300,smi-address = <0 1>;
  125. };
  126. phy2: ethernet-phy@2 {
  127. reg = <2>;
  128. compatible = "ethernet-phy-ieee802.3-c22";
  129. rtl9300,smi-address = <0 2>;
  130. };
  131. phy3: ethernet-phy@3 {
  132. reg = <3>;
  133. compatible = "ethernet-phy-ieee802.3-c22";
  134. rtl9300,smi-address = <0 3>;
  135. };
  136. phy4: ethernet-phy@4 {
  137. reg = <4>;
  138. compatible = "ethernet-phy-ieee802.3-c22";
  139. rtl9300,smi-address = <0 4>;
  140. };
  141. phy5: ethernet-phy@5 {
  142. reg = <5>;
  143. compatible = "ethernet-phy-ieee802.3-c22";
  144. rtl9300,smi-address = <0 5>;
  145. };
  146. phy6: ethernet-phy@6 {
  147. reg = <6>;
  148. compatible = "ethernet-phy-ieee802.3-c22";
  149. rtl9300,smi-address = <0 6>;
  150. };
  151. phy7: ethernet-phy@7 {
  152. reg = <7>;
  153. compatible = "ethernet-phy-ieee802.3-c22";
  154. rtl9300,smi-address = <0 7>;
  155. };
  156. /* External Aquantia 113C PHYs */
  157. phy24: ethernet-phy@24 {
  158. reg = <24>;
  159. compatible = "ethernet-phy-ieee802.3-c45";
  160. rtl9300,smi-address = <1 8>;
  161. sds = < 6 >;
  162. // Disabled because we do not know how to bring up again
  163. // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
  164. };
  165. phy25: ethernet-phy@25 {
  166. reg = <25>;
  167. compatible = "ethernet-phy-ieee802.3-c45";
  168. rtl9300,smi-address = <2 8>;
  169. sds = < 7 >;
  170. // Disabled because we do not know how to bring up again
  171. // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
  172. };
  173. phy26: ethernet-phy@26 {
  174. reg = <26>;
  175. compatible = "ethernet-phy-ieee802.3-c45";
  176. rtl9300,smi-address = <3 8>;
  177. sds = < 8 >;
  178. // Disabled because we do not know how to bring up again
  179. // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
  180. };
  181. /* SFP Ports */
  182. phy27: ethernet-phy@27 {
  183. compatible = "ethernet-phy-ieee802.3-c22";
  184. phy-is-integrated;
  185. reg = <27>;
  186. rtl9300,smi-address = <4 0>;
  187. sds = < 9 >;
  188. };
  189. };
  190. };
  191. &switch0 {
  192. ports {
  193. #address-cells = <1>;
  194. #size-cells = <0>;
  195. port@0 {
  196. reg = <0>;
  197. label = "lan1";
  198. phy-handle = <&phy0>;
  199. phy-mode = "xgmii";
  200. led-set = <0>;
  201. };
  202. port@1 {
  203. reg = <1>;
  204. label = "lan2";
  205. phy-handle = <&phy1>;
  206. phy-mode = "xgmii";
  207. led-set = <0>;
  208. };
  209. port@2 {
  210. reg = <2>;
  211. label = "lan3";
  212. phy-handle = <&phy2>;
  213. phy-mode = "xgmii";
  214. led-set = <0>;
  215. };
  216. port@3 {
  217. reg = <3>;
  218. label = "lan4";
  219. phy-handle = <&phy3>;
  220. phy-mode = "xgmii";
  221. led-set = <0>;
  222. };
  223. port@4 {
  224. reg = <4>;
  225. label = "lan5";
  226. phy-handle = <&phy4>;
  227. phy-mode = "xgmii";
  228. led-set = <0>;
  229. };
  230. port@5 {
  231. reg = <5>;
  232. label = "lan6";
  233. phy-handle = <&phy5>;
  234. phy-mode = "xgmii";
  235. led-set = <0>;
  236. };
  237. port@6 {
  238. reg = <6>;
  239. label = "lan7";
  240. phy-handle = <&phy6>;
  241. phy-mode = "xgmii";
  242. led-set = <0>;
  243. };
  244. port@7 {
  245. reg = <7>;
  246. label = "lan8";
  247. phy-handle = <&phy7>;
  248. phy-mode = "xgmii";
  249. led-set = <0>;
  250. };
  251. port@24 {
  252. reg = <24>;
  253. label = "lan9";
  254. phy-mode = "usxgmii";
  255. phy-handle = <&phy24>;
  256. led-set = <1>;
  257. };
  258. port@25 {
  259. reg = <25>;
  260. label = "lan10";
  261. phy-mode = "usxgmii";
  262. phy-handle = <&phy25>;
  263. led-set = <1>;
  264. };
  265. port@26 {
  266. reg = <26>;
  267. label = "lan11";
  268. phy-mode = "usxgmii";
  269. phy-handle = <&phy26>;
  270. led-set = <1>;
  271. };
  272. port@27 {
  273. reg = <27>;
  274. label = "lan12";
  275. phy-mode = "10gbase-r";
  276. phy-handle = <&phy27>;
  277. sfp = <&sfp0>;
  278. led-set = <2>;
  279. fixed-link {
  280. speed = <10000>;
  281. full-duplex;
  282. pause;
  283. };
  284. };
  285. port@28 {
  286. ethernet = <&ethernet0>;
  287. reg = <28>;
  288. phy-mode = "internal";
  289. fixed-link {
  290. speed = <10000>;
  291. full-duplex;
  292. };
  293. };
  294. };
  295. };