rtl8393_zyxel_gs1900-48.dts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. /dts-v1/;
  2. #include "rtl839x.dtsi"
  3. #include <dt-bindings/input/input.h>
  4. #include <dt-bindings/gpio/gpio.h>
  5. / {
  6. compatible = "zyxel,gs1900-48", "realtek,rtl8393-soc";
  7. model = "Zyxel GS1900-48";
  8. aliases {
  9. led-boot = &led_sys;
  10. led-failsafe = &led_sys;
  11. led-running = &led_sys;
  12. led-upgrade = &led_sys;
  13. };
  14. memory@0 {
  15. device_type = "memory";
  16. reg = <0x0 0x8000000>;
  17. };
  18. leds {
  19. pinctrl-names = "default";
  20. pinctrl-0 = <&pinmux_disable_sys_led>;
  21. compatible = "gpio-leds";
  22. led_sys: sys {
  23. label = "green:sys";
  24. gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
  25. };
  26. };
  27. gpio1: rtl8231-gpio {
  28. compatible = "realtek,rtl8231-gpio";
  29. #gpio-cells = <2>;
  30. indirect-access-bus-id = <3>;
  31. gpio-controller;
  32. };
  33. gpio-restart {
  34. compatible = "gpio-restart";
  35. gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
  36. };
  37. keys {
  38. compatible = "gpio-keys-polled";
  39. poll-interval = <20>;
  40. mode {
  41. label = "reset";
  42. gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
  43. linux,code = <KEY_RESTART>;
  44. };
  45. };
  46. /* i2c of the left SFP cage: port 49 */
  47. i2c0: i2c-gpio-0 {
  48. compatible = "i2c-gpio";
  49. sda-gpios = <&gpio1 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  50. scl-gpios = <&gpio1 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  51. i2c-gpio,delay-us = <2>;
  52. #address-cells = <1>;
  53. #size-cells = <0>;
  54. };
  55. sfp0: sfp-p9 {
  56. compatible = "sff,sfp";
  57. i2c-bus = <&i2c0>;
  58. los-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>;
  59. tx-fault-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
  60. mod-def0-gpio = <&gpio1 26 GPIO_ACTIVE_LOW>;
  61. tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
  62. };
  63. /* i2c of the right SFP cage: port 50 */
  64. i2c1: i2c-gpio-1 {
  65. compatible = "i2c-gpio";
  66. sda-gpios = <&gpio1 30 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  67. scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  68. i2c-gpio,delay-us = <2>;
  69. #address-cells = <1>;
  70. #size-cells = <0>;
  71. };
  72. sfp1: sfp-p10 {
  73. compatible = "sff,sfp";
  74. i2c-bus = <&i2c1>;
  75. los-gpio = <&gpio1 33 GPIO_ACTIVE_HIGH>;
  76. tx-fault-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
  77. mod-def0-gpio = <&gpio1 32 GPIO_ACTIVE_LOW>;
  78. tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>;
  79. };
  80. };
  81. &spi0 {
  82. status = "okay";
  83. flash@0 {
  84. compatible = "jedec,spi-nor";
  85. reg = <0>;
  86. spi-max-frequency = <10000000>;
  87. partitions {
  88. compatible = "fixed-partitions";
  89. #address-cells = <1>;
  90. #size-cells = <1>;
  91. partition@0 {
  92. label = "u-boot";
  93. reg = <0x0 0x40000>;
  94. read-only;
  95. };
  96. partition@40000 {
  97. label = "u-boot-env";
  98. reg = <0x40000 0x10000>;
  99. read-only;
  100. };
  101. partition@50000 {
  102. label = "u-boot-env2";
  103. reg = <0x50000 0x10000>;
  104. read-only;
  105. };
  106. partition@60000 {
  107. label = "jffs";
  108. reg = <0x60000 0x100000>;
  109. };
  110. partition@160000 {
  111. label = "jffs2";
  112. reg = <0x160000 0x100000>;
  113. };
  114. partition@b260000 {
  115. label = "firmware";
  116. reg = <0x260000 0xda0000>;
  117. compatible = "openwrt,uimage", "denx,uimage";
  118. openwrt,ih-magic = <0x83800000>;
  119. };
  120. partition@930000 {
  121. label = "runtime2";
  122. reg = <0x930000 0x6d0000>;
  123. };
  124. };
  125. };
  126. };
  127. &ethernet0 {
  128. mdio: mdio-bus {
  129. compatible = "realtek,rtl838x-mdio";
  130. regmap = <&ethernet0>;
  131. #address-cells = <1>;
  132. #size-cells = <0>;
  133. /* External phy RTL8218B #1 */
  134. EXTERNAL_PHY(0)
  135. EXTERNAL_PHY(1)
  136. EXTERNAL_PHY(2)
  137. EXTERNAL_PHY(3)
  138. EXTERNAL_PHY(4)
  139. EXTERNAL_PHY(5)
  140. EXTERNAL_PHY(6)
  141. EXTERNAL_PHY(7)
  142. /* External phy RTL8218B #2 */
  143. EXTERNAL_PHY(8)
  144. EXTERNAL_PHY(9)
  145. EXTERNAL_PHY(10)
  146. EXTERNAL_PHY(11)
  147. EXTERNAL_PHY(12)
  148. EXTERNAL_PHY(13)
  149. EXTERNAL_PHY(14)
  150. EXTERNAL_PHY(15)
  151. /* External phy RTL8218B #3 */
  152. EXTERNAL_PHY(16)
  153. EXTERNAL_PHY(17)
  154. EXTERNAL_PHY(18)
  155. EXTERNAL_PHY(19)
  156. EXTERNAL_PHY(20)
  157. EXTERNAL_PHY(21)
  158. EXTERNAL_PHY(22)
  159. EXTERNAL_PHY(23)
  160. /* External phy RTL8218B #4 */
  161. EXTERNAL_PHY(24)
  162. EXTERNAL_PHY(25)
  163. EXTERNAL_PHY(26)
  164. EXTERNAL_PHY(27)
  165. EXTERNAL_PHY(28)
  166. EXTERNAL_PHY(29)
  167. EXTERNAL_PHY(30)
  168. EXTERNAL_PHY(31)
  169. /* External phy RTL8218B #5 */
  170. EXTERNAL_PHY(32)
  171. EXTERNAL_PHY(33)
  172. EXTERNAL_PHY(34)
  173. EXTERNAL_PHY(35)
  174. EXTERNAL_PHY(36)
  175. EXTERNAL_PHY(37)
  176. EXTERNAL_PHY(38)
  177. EXTERNAL_PHY(39)
  178. /* External phy RTL8218B #6 */
  179. EXTERNAL_PHY(40)
  180. EXTERNAL_PHY(41)
  181. EXTERNAL_PHY(42)
  182. EXTERNAL_PHY(43)
  183. EXTERNAL_PHY(44)
  184. EXTERNAL_PHY(45)
  185. EXTERNAL_PHY(46)
  186. EXTERNAL_PHY(47)
  187. /* RTL8393 Internal SerDes */
  188. INTERNAL_PHY(48)
  189. INTERNAL_PHY(49)
  190. };
  191. };
  192. &switch0 {
  193. ports {
  194. #address-cells = <1>;
  195. #size-cells = <0>;
  196. SWITCH_PORT(0, 01, qsgmii)
  197. SWITCH_PORT(1, 02, qsgmii)
  198. SWITCH_PORT(2, 03, qsgmii)
  199. SWITCH_PORT(3, 04, qsgmii)
  200. SWITCH_PORT(4, 05, qsgmii)
  201. SWITCH_PORT(5, 06, qsgmii)
  202. SWITCH_PORT(6, 07, qsgmii)
  203. SWITCH_PORT(7, 08, qsgmii)
  204. SWITCH_PORT(8, 09, qsgmii)
  205. SWITCH_PORT(9, 10, qsgmii)
  206. SWITCH_PORT(10, 11, qsgmii)
  207. SWITCH_PORT(11, 12, qsgmii)
  208. SWITCH_PORT(12, 13, qsgmii)
  209. SWITCH_PORT(13, 14, qsgmii)
  210. SWITCH_PORT(14, 15, qsgmii)
  211. SWITCH_PORT(15, 16, qsgmii)
  212. SWITCH_PORT(16, 17, qsgmii)
  213. SWITCH_PORT(17, 18, qsgmii)
  214. SWITCH_PORT(18, 19, qsgmii)
  215. SWITCH_PORT(19, 20, qsgmii)
  216. SWITCH_PORT(20, 21, qsgmii)
  217. SWITCH_PORT(21, 22, qsgmii)
  218. SWITCH_PORT(22, 23, qsgmii)
  219. SWITCH_PORT(23, 24, qsgmii)
  220. SWITCH_PORT(24, 25, qsgmii)
  221. SWITCH_PORT(25, 26, qsgmii)
  222. SWITCH_PORT(26, 27, qsgmii)
  223. SWITCH_PORT(27, 28, qsgmii)
  224. SWITCH_PORT(28, 29, qsgmii)
  225. SWITCH_PORT(29, 30, qsgmii)
  226. SWITCH_PORT(30, 31, qsgmii)
  227. SWITCH_PORT(31, 32, qsgmii)
  228. SWITCH_PORT(32, 33, qsgmii)
  229. SWITCH_PORT(33, 34, qsgmii)
  230. SWITCH_PORT(34, 35, qsgmii)
  231. SWITCH_PORT(35, 36, qsgmii)
  232. SWITCH_PORT(36, 37, qsgmii)
  233. SWITCH_PORT(37, 38, qsgmii)
  234. SWITCH_PORT(38, 39, qsgmii)
  235. SWITCH_PORT(39, 40, qsgmii)
  236. SWITCH_PORT(40, 41, qsgmii)
  237. SWITCH_PORT(41, 42, qsgmii)
  238. SWITCH_PORT(42, 43, qsgmii)
  239. SWITCH_PORT(43, 44, qsgmii)
  240. SWITCH_PORT(44, 45, qsgmii)
  241. SWITCH_PORT(45, 46, qsgmii)
  242. SWITCH_PORT(46, 47, qsgmii)
  243. SWITCH_PORT(47, 48, qsgmii)
  244. /* SFP cages */
  245. port@48 {
  246. reg = <48>;
  247. label = "lan49";
  248. phy-mode = "sgmii";
  249. phy-handle = <&phy48>;
  250. sfp = <&sfp0>;
  251. fixed-link {
  252. speed = <1000>;
  253. full-duplex;
  254. pause;
  255. };
  256. };
  257. port@49 {
  258. reg = <49>;
  259. label = "lan50";
  260. phy-mode = "sgmii";
  261. phy-handle = <&phy49>;
  262. sfp = <&sfp1>;
  263. fixed-link {
  264. speed = <1000>;
  265. full-duplex;
  266. pause;
  267. };
  268. };
  269. /* CPU-Port */
  270. port@52 {
  271. ethernet = <&ethernet0>;
  272. reg = <52>;
  273. phy-mode = "qsgmii";
  274. fixed-link {
  275. speed = <1000>;
  276. full-duplex;
  277. };
  278. };
  279. };
  280. };