C108.dts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. * BSD LICENSE
  3. *
  4. * Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
  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 = "hnet,c108", "ralink,mt7620a-soc";
  39. model = "HNET C108";
  40. aliases {
  41. led-boot = &led_lan_green;
  42. led-failsafe = &led_lan_green;
  43. led-running = &led_lan_green;
  44. led-upgrade = &led_lan_green;
  45. };
  46. chosen {
  47. bootargs = "console=ttyS0,115200";
  48. };
  49. gpio-export {
  50. compatible = "gpio-export";
  51. #size-cells = <0>;
  52. power_modem {
  53. gpio-export,name = "power_modem";
  54. gpio-export,output = <1>;
  55. gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
  56. };
  57. };
  58. gpio-leds {
  59. compatible = "gpio-leds";
  60. sdcard {
  61. label = "c108:green:sdcard";
  62. gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
  63. };
  64. modem_green {
  65. label = "c108:green:modem";
  66. gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
  67. };
  68. modem_red {
  69. label = "c108:red:modem";
  70. gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
  71. };
  72. lan_red {
  73. label = "c108:red:lan";
  74. gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
  75. };
  76. led_lan_green: lan_green {
  77. label = "c108:green:lan";
  78. gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
  79. };
  80. };
  81. gpio-keys-polled {
  82. compatible = "gpio-keys-polled";
  83. poll-interval = <20>;
  84. reset {
  85. label = "reset";
  86. gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
  87. linux,code = <KEY_RESTART>;
  88. };
  89. };
  90. };
  91. &gpio1 {
  92. status = "okay";
  93. };
  94. &gpio2 {
  95. status = "okay";
  96. };
  97. &spi0 {
  98. status = "okay";
  99. en25q128@0 {
  100. compatible = "jedec,spi-nor";
  101. reg = <0>;
  102. spi-max-frequency = <10000000>;
  103. partitions {
  104. compatible = "fixed-partitions";
  105. #address-cells = <1>;
  106. #size-cells = <1>;
  107. partition@0 {
  108. label = "u-boot";
  109. reg = <0x0 0x30000>;
  110. read-only;
  111. };
  112. partition@30000 {
  113. label = "u-boot-env";
  114. reg = <0x30000 0x10000>;
  115. read-only;
  116. };
  117. factory: partition@40000 {
  118. label = "factory";
  119. reg = <0x40000 0x10000>;
  120. read-only;
  121. };
  122. partition@50000 {
  123. label = "firmware";
  124. reg = <0x50000 0xfb0000>;
  125. };
  126. };
  127. };
  128. };
  129. &sdhci {
  130. status = "okay";
  131. };
  132. &ehci {
  133. status = "okay";
  134. };
  135. &ohci {
  136. status = "okay";
  137. };
  138. &ethernet {
  139. mtd-mac-address = <&factory 0x28>;
  140. };
  141. &wmac {
  142. ralink,mtd-eeprom = <&factory 0>;
  143. };
  144. &pinctrl {
  145. state_default: pinctrl0 {
  146. default {
  147. ralink,group = "i2c", "uartf", "spi refclk", "ephy";
  148. ralink,function = "gpio";
  149. };
  150. };
  151. };
  152. &pcie {
  153. status = "okay";
  154. };