D240.dts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * BSD LICENSE
  3. *
  4. * Copyright(c) 2017 Kristian Evensen <[email protected]>.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * * Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in
  15. * the documentation and/or other materials provided with the
  16. * distribution.
  17. * * Neither the name of Broadcom Corporation nor the names of its
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. /dts-v1/;
  34. #include "mt7620a.dtsi"
  35. #include <dt-bindings/gpio/gpio.h>
  36. #include <dt-bindings/input/input.h>
  37. / {
  38. compatible = "sanlinking,d240", "ralink,mt7620a-soc";
  39. model = "Sanlinking Technologies D240";
  40. aliases {
  41. led-boot = &led_power;
  42. led-failsafe = &led_power;
  43. led-running = &led_power;
  44. led-upgrade = &led_power;
  45. };
  46. chosen {
  47. bootargs = "console=ttyS0,115200";
  48. };
  49. gpio-export {
  50. compatible = "gpio-export";
  51. #size-cells = <0>;
  52. power_mpcie2 {
  53. gpio-export,name = "power_mpcie2";
  54. gpio-export,output = <1>;
  55. gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
  56. };
  57. power_mpcie1 {
  58. gpio-export,name = "power_mpcie1";
  59. gpio-export,output = <1>;
  60. gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
  61. };
  62. };
  63. leds {
  64. compatible = "gpio-leds";
  65. led_power: power {
  66. label = "d240:blue:power";
  67. gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
  68. };
  69. usb {
  70. label = "d240:blue:usb";
  71. gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
  72. trigger-sources = <&ohci_port1>, <&ehci_port1>;
  73. linux,default-trigger = "usbport";
  74. };
  75. air {
  76. label = "d240:blue:wifi";
  77. gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
  78. };
  79. };
  80. keys {
  81. compatible = "gpio-keys-polled";
  82. poll-interval = <20>;
  83. reset {
  84. label = "reset";
  85. gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
  86. linux,code = <KEY_RESTART>;
  87. };
  88. };
  89. };
  90. &gpio1 {
  91. status = "okay";
  92. };
  93. &gpio2 {
  94. status = "okay";
  95. };
  96. &gpio3 {
  97. status = "okay";
  98. };
  99. &spi0 {
  100. status = "okay";
  101. en25q128@0 {
  102. compatible = "jedec,spi-nor";
  103. reg = <0>;
  104. spi-max-frequency = <10000000>;
  105. partitions {
  106. compatible = "fixed-partitions";
  107. #address-cells = <1>;
  108. #size-cells = <1>;
  109. partition@0 {
  110. label = "u-boot";
  111. reg = <0x0 0x30000>;
  112. read-only;
  113. };
  114. partition@30000 {
  115. label = "u-boot-env";
  116. reg = <0x30000 0x10000>;
  117. read-only;
  118. };
  119. factory: partition@40000 {
  120. label = "factory";
  121. reg = <0x40000 0x10000>;
  122. read-only;
  123. };
  124. partition@50000 {
  125. compatible = "denx,uimage";
  126. label = "firmware";
  127. reg = <0x50000 0xfb0000>;
  128. };
  129. };
  130. };
  131. };
  132. &sdhci {
  133. status = "okay";
  134. /* the pins function is already set during pinmux driver load */
  135. /delete-property/ pinctrl-0;
  136. };
  137. &ehci {
  138. status = "okay";
  139. };
  140. &ohci {
  141. status = "okay";
  142. };
  143. &ethernet {
  144. mtd-mac-address = <&factory 0x4>;
  145. mediatek,portmap = "wllll";
  146. };
  147. &wmac {
  148. ralink,mtd-eeprom = <&factory 0>;
  149. };
  150. &pinctrl {
  151. state_default: pinctrl0 {
  152. default {
  153. ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa";
  154. ralink,function = "gpio";
  155. };
  156. /*
  157. * The sd function of the nd_sd group configures two of the
  158. * groups pins as gpios. The pins are used as PCIe reset/power.
  159. * Due to the driver load order, the pins are configured way to
  160. * late if triggered by the sd-card driver.
  161. * To not introduce another kind of driver load order
  162. * dependency and configure the pins as early as possible,
  163. * means during pinmux driver load.
  164. */
  165. gpio_sd {
  166. ralink,group = "nd_sd";
  167. ralink,function = "sd";
  168. };
  169. };
  170. };
  171. &pcie {
  172. status = "okay";
  173. };