mt7621_ubnt_usw-flex.dts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #include "mt7621.dtsi"
  2. #include <dt-bindings/gpio/gpio.h>
  3. #include <dt-bindings/input/input.h>
  4. #include <dt-bindings/leds/common.h>
  5. / {
  6. model = "Ubiquiti UniFi Switch Flex";
  7. compatible = "ubnt,usw-flex", "mediatek,mt7621-soc";
  8. aliases {
  9. led-boot = &led_white;
  10. led-failsafe = &led_white;
  11. led-running = &led_blue;
  12. led-upgrade = &led_blue;
  13. label-mac-device = &gmac0;
  14. };
  15. chosen {
  16. bootargs-override = "console=ttyS0,115200";
  17. };
  18. keys {
  19. compatible = "gpio-keys";
  20. reset {
  21. label = "reset";
  22. gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
  23. linux,code = <KEY_RESTART>;
  24. };
  25. };
  26. leds {
  27. compatible = "gpio-leds";
  28. led_blue: status_blue {
  29. function = LED_FUNCTION_STATUS;
  30. color = <LED_COLOR_ID_BLUE>;
  31. gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
  32. };
  33. led_white: status_white {
  34. function = LED_FUNCTION_STATUS;
  35. color = <LED_COLOR_ID_WHITE>;
  36. gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
  37. };
  38. };
  39. i2c-gpio {
  40. compatible = "i2c-gpio";
  41. sda-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
  42. scl-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
  43. i2c-gpio,delay-us = <50>;
  44. /* Microsemi PD69104B1 PSE controller */
  45. };
  46. };
  47. &gmac0 {
  48. nvmem-cells = <&macaddr_eeprom>;
  49. nvmem-cell-names = "mac-address";
  50. label = "dsa";
  51. };
  52. &switch0 {
  53. ports {
  54. port@0 {
  55. status = "okay";
  56. label = "lan5";
  57. };
  58. port@1 {
  59. status = "okay";
  60. label = "lan4";
  61. };
  62. port@2 {
  63. status = "okay";
  64. label = "lan3";
  65. };
  66. port@3 {
  67. status = "okay";
  68. label = "lan2";
  69. };
  70. port@4 {
  71. status = "okay";
  72. label = "lan1";
  73. };
  74. };
  75. };
  76. &state_default {
  77. gpio {
  78. groups = "i2c", "uart2", "uart3", "jtag";
  79. function = "gpio";
  80. };
  81. };
  82. &spi0 {
  83. status = "okay";
  84. flash@0 {
  85. compatible = "jedec,spi-nor";
  86. reg = <0>;
  87. spi-max-frequency = <30000000>;
  88. partitions {
  89. compatible = "fixed-partitions";
  90. #address-cells = <1>;
  91. #size-cells = <1>;
  92. partition@0 {
  93. label = "u-boot";
  94. reg = <0x0 0x60000>;
  95. read-only;
  96. };
  97. partition@60000 {
  98. label = "u-boot-env";
  99. reg = <0x60000 0x10000>;
  100. };
  101. partition@70000 {
  102. label = "factory";
  103. reg = <0x70000 0x10000>;
  104. read-only;
  105. };
  106. partition@80000 {
  107. label = "eeprom";
  108. reg = <0x80000 0x10000>;
  109. read-only;
  110. nvmem-layout {
  111. compatible = "fixed-layout";
  112. #address-cells = <1>;
  113. #size-cells = <1>;
  114. macaddr_eeprom: macaddr@0 {
  115. reg = <0x0 0x6>;
  116. };
  117. };
  118. };
  119. partition@90000 {
  120. label = "bs";
  121. reg = <0x90000 0x10000>;
  122. };
  123. partition@a0000 {
  124. label = "cfg";
  125. reg = <0xa0000 0x100000>;
  126. read-only;
  127. };
  128. partition@1a0000 {
  129. /* Combine kernel0 / kernel1 */
  130. compatible = "denx,fit";
  131. label = "firmware";
  132. reg = <0x1a0000 0xe60000>;
  133. };
  134. };
  135. };
  136. };
  137. &xhci {
  138. status = "disabled";
  139. };