Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. /dts-v1/;
  2.  
  3. #include "mt7620a.dtsi"
  4. #include <dt-bindings/gpio/gpio.h>
  5. #include <dt-bindings/input/input.h>
  6.  
  7. / {
  8. compatible = "geva,batterypoe", "ralink,mt7620a-soc";
  9. model = "GEVA Battery POE";
  10.  
  11. chosen {
  12. bootargs = "console=ttyS0,115200";
  13. };
  14.  
  15. aliases {
  16. label-mac-device = &ethernet;
  17. led-boot = &led_power;
  18. led-failsafe = &led_power;
  19. led-running = &led_power;
  20. led-upgrade = &led_power;
  21. };
  22.  
  23. leds {
  24. compatible = "gpio-leds";
  25.  
  26. led_power: power {
  27. label = "orange.power";
  28. gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
  29. };
  30.  
  31. eth {
  32. label = "blue.eth";
  33. gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
  34. };
  35.  
  36. wifi {
  37. label = "red.wifi";
  38. gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
  39. };
  40. };
  41.  
  42. keys {
  43. compatible = "gpio-keys-polled";
  44. poll-interval = <20>;
  45.  
  46. reset {
  47. label = "reset";
  48. gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
  49. linux,code = <KEY_RESTART>;
  50. };
  51. };
  52.  
  53. };
  54.  
  55. &gpio0 {
  56. status = "okay";
  57. };
  58.  
  59. &gpio2 {
  60. status = "okay";
  61. };
  62.  
  63. &gpio3 {
  64. status = "okay";
  65. };
  66.  
  67. //GPIO 9,14 are shared with UART Full, GPIO 72 - wlan LEDs (see datasheets)
  68. //GPIO 1,2 are share with I2C
  69. //so switch used gpio into gpio-mode:
  70. &state_default {
  71. gpio {
  72. groups = "i2c", "wled", "uartf", "ephy";
  73. function = "gpio";
  74. };
  75. };
  76.  
  77. //Your device use spi nor-flash 16MB, so enable spi-controller
  78. //and describe your flash layout
  79. &spi0 {
  80. status = "okay";
  81.  
  82. flash@0 {
  83. compatible = "jedec,spi-nor";
  84. reg = <0>;
  85. spi-max-frequency = <50000000>;
  86.  
  87. partitions {
  88. compatible = "fixed-partitions";
  89. #address-cells = <1>;
  90. #size-cells = <1>;
  91.  
  92. partition@0 {
  93. label = "u-boot";
  94. reg = <0x0 0x30000>;
  95. read-only;
  96. };
  97.  
  98. partition@30000 {
  99. label = "u-boot-env";
  100. reg = <0x30000 0x10000>;
  101. read-only;
  102. };
  103.  
  104. factory: partition@40000 {
  105. label = "factory";
  106. reg = <0x40000 0x10000>;
  107. read-only;
  108. };
  109.  
  110. partition@50000 {
  111. compatible = "denx,uimage";
  112. label = "firmware";
  113. reg = <0x50000 0xfb0000>;
  114. };
  115. };
  116. };
  117. };
  118.  
  119. //We known that your board use USB 2.0, so enable it (USB 1.1 too)
  120. &ehci {
  121. status = "okay";
  122. };
  123.  
  124. &ohci {
  125. status = "okay";
  126. };
  127.  
  128. //Enable eth and set MAC/switch defaults
  129. &ethernet {
  130. status = "okay";
  131. //it's useless because your factory is empty and MAC is incorrect
  132. //but linux define random MAC if invalid
  133. mtd-mac-address = <&factory 0x4>;
  134. mediatek,portmap = "wllll";
  135. };
  136.  
  137.  
  138. //Enable build-in wifi
  139. &wmac {
  140. status = "okay";
  141. //your factory is empty and data is incorrect
  142. // ralink,mtd-eeprom = <&factory 0>;
  143. };
  144.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement