C108.dts 3.7 KB

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