rtl8380_tplink_sg2xxx.dtsi 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. #include "rtl838x.dtsi"
  3. #include <dt-bindings/input/input.h>
  4. #include <dt-bindings/leds/common.h>
  5. #include <dt-bindings/gpio/gpio.h>
  6. / {
  7. aliases {
  8. led-boot = &led_power;
  9. led-failsafe = &led_power;
  10. led-running = &led_power;
  11. led-upgrade = &led_power;
  12. label-mac-device = &ethernet0;
  13. };
  14. memory@0 {
  15. device_type = "memory";
  16. reg = <0x0 0x10000000>;
  17. };
  18. keys {
  19. compatible = "gpio-keys";
  20. reset {
  21. label = "reset";
  22. gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
  23. linux,code = <KEY_RESTART>;
  24. };
  25. };
  26. gpio-restart {
  27. compatible = "gpio-restart";
  28. gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
  29. };
  30. leds {
  31. compatible = "gpio-leds";
  32. led_power: led-0 {
  33. function = LED_FUNCTION_POWER;
  34. color = <LED_COLOR_ID_GREEN>;
  35. gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
  36. };
  37. };
  38. i2c1: i2c-gpio-1 {
  39. compatible = "i2c-gpio";
  40. scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  41. sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
  42. i2c-gpio,delay-us = <2>;
  43. #address-cells = <1>;
  44. #size-cells = <0>;
  45. tps23861_20: tps23861@20 {
  46. compatible = "ti,tps23861";
  47. reg = <0x20>;
  48. shunt-resistor-micro-ohms = <255000>;
  49. };
  50. tps23861_28: tps23861@28 {
  51. compatible = "ti,tps23861";
  52. reg = <0x28>;
  53. shunt-resistor-micro-ohms = <255000>;
  54. };
  55. };
  56. watchdog {
  57. compatible = "linux,wdt-gpio";
  58. gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
  59. hw_algo = "toggle";
  60. /* SGM706 specs: typical 1.6s, but minimum 1.0s. */
  61. hw_margin_ms = <1000>;
  62. };
  63. };
  64. &gpio0 {
  65. watchdog-enable {
  66. gpio-hog;
  67. gpios = <14 GPIO_ACTIVE_LOW>;
  68. output-low;
  69. line-name = "watchdog-enable";
  70. };
  71. };
  72. &spi0 {
  73. status = "okay";
  74. flash@0 {
  75. compatible = "jedec,spi-nor";
  76. reg = <0>;
  77. spi-max-frequency = <10000000>;
  78. partitions {
  79. compatible = "fixed-partitions";
  80. #address-cells = <1>;
  81. #size-cells = <1>;
  82. partition@0 {
  83. label = "u-boot";
  84. reg = <0x0 0xe0000>;
  85. read-only;
  86. };
  87. partition@e0000 {
  88. label = "u-boot-env";
  89. reg = <0xe0000 0x20000>;
  90. };
  91. partition@100000 {
  92. compatible = "denx,uimage";
  93. label = "firmware";
  94. reg = <0x100000 0x1a00000>;
  95. };
  96. partition@1b00000 {
  97. label = "usrappfs";
  98. reg = <0x1b00000 0x400000>;
  99. };
  100. partition@1f00000 {
  101. label = "para";
  102. reg = <0x1f00000 0x100000>;
  103. read-only;
  104. nvmem-layout {
  105. compatible = "fixed-layout";
  106. #address-cells = <1>;
  107. #size-cells = <1>;
  108. factory_macaddr: macaddr@fdff4 {
  109. reg = <0xfdff4 0x6>;
  110. };
  111. };
  112. };
  113. };
  114. };
  115. };
  116. &ethernet0 {
  117. nvmem-cells = <&factory_macaddr>;
  118. nvmem-cell-names = "mac-address";
  119. mdio: mdio-bus {
  120. compatible = "realtek,rtl838x-mdio";
  121. #address-cells = <1>;
  122. #size-cells = <0>;
  123. INTERNAL_PHY(8)
  124. INTERNAL_PHY(9)
  125. INTERNAL_PHY(10)
  126. INTERNAL_PHY(11)
  127. INTERNAL_PHY(12)
  128. INTERNAL_PHY(13)
  129. INTERNAL_PHY(14)
  130. INTERNAL_PHY(15)
  131. INTERNAL_PHY(24)
  132. INTERNAL_PHY(26)
  133. };
  134. };
  135. &switch0 {
  136. ports {
  137. #address-cells = <1>;
  138. #size-cells = <0>;
  139. SWITCH_PORT(15, 1, internal)
  140. SWITCH_PORT(14, 2, internal)
  141. SWITCH_PORT(13, 3, internal)
  142. SWITCH_PORT(12, 4, internal)
  143. SWITCH_PORT(11, 5, internal)
  144. SWITCH_PORT(10, 6, internal)
  145. SWITCH_PORT(9, 7, internal)
  146. SWITCH_PORT(8, 8, internal)
  147. SWITCH_SFP_PORT(24, 9, 1000base-x)
  148. SWITCH_SFP_PORT(26, 10, 1000base-x)
  149. port@28 {
  150. ethernet = <&ethernet0>;
  151. reg = <28>;
  152. phy-mode = "internal";
  153. fixed-link {
  154. speed = <1000>;
  155. full-duplex;
  156. };
  157. };
  158. };
  159. };