spacepaste

  1.  
  2. /*
  3. * Copyright 2018 Lukasz W. Hebda <l.w.hebda@gmail.com>
  4. *
  5. * This file is dual-licensed: you can use it either under the terms
  6. * of the GPL or the X11 license, at your option. Note that this dual
  7. * licensing only applies to this file, and not this project as a
  8. * whole.
  9. *
  10. * a) This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * Or, alternatively,
  21. *
  22. * b) Permission is hereby granted, free of charge, to any person
  23. * obtaining a copy of this software and associated documentation
  24. * files (the "Software"), to deal in the Software without
  25. * restriction, including without limitation the rights to use,
  26. * copy, modify, merge, publish, distribute, sublicense, and/or
  27. * sell copies of the Software, and to permit persons to whom the
  28. * Software is furnished to do so, subject to the following
  29. * conditions:
  30. *
  31. * The above copyright notice and this permission notice shall be
  32. * included in all copies or substantial portions of the Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  35. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  36. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  37. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  38. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  39. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  40. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  41. * OTHER DEALINGS IN THE SOFTWARE.
  42. */
  43. /dts-v1/;
  44. #include "sun4i-a10.dtsi"
  45. #include "sunxi-common-regulators.dtsi"
  46. #include <dt-bindings/gpio/gpio.h>
  47. #include <dt-bindings/input/input.h>
  48. #include <dt-bindings/interrupt-controller/irq.h>
  49. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50. / {
  51. model = "iNet 3F Rev 06";
  52. compatible = "inet-tek,inet3f-rev06", "allwinner,sun4i-a10";
  53. aliases {
  54. serial0 = &uart0;
  55. };
  56. chosen {
  57. stdout-path = "serial0:115200n8";
  58. };
  59. };
  60. &cpu0 {
  61. cpu-supply = <&reg_dcdc2>;
  62. };
  63. &ehci1 {
  64. status = "okay";
  65. };
  66. &i2c0 {
  67. pinctrl-names = "default";
  68. pinctrl-0 = <&i2c0_pins_a>;
  69. status = "okay";
  70. axp209: pmic@34 {
  71. reg = <0x34>;
  72. interrupts = <0>;
  73. };
  74. };
  75. #include "axp209.dtsi"
  76. &i2c1 {
  77. pinctrl-names = "default";
  78. pinctrl-0 = <&i2c1_pins_a>;
  79. status = "okay";
  80. /* Accelerometer */
  81. bma250@18 {
  82. compatible = "bosch,bma250";
  83. reg = <0x18>;
  84. interrupt-parent = <&pio>;
  85. interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
  86. };
  87. };
  88. &i2c2 {
  89. pinctrl-names = "default";
  90. pinctrl-0 = <&i2c2_pins_a>;
  91. status = "okay";
  92. ft5406ee8: touchscreen@38 {
  93. compatible = "edt,edt-ft5406";
  94. reg = <0x38>;
  95. interrupt-parent = <&pio>;
  96. interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
  97. pinctrl-names = "default";
  98. pinctrl-0 = <&touchscreen_wake_pin>;
  99. wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */
  100. touchscreen-size-x = <1024>;
  101. touchscreen-size-y = <768>;
  102. };
  103. };
  104. &lradc {
  105. vref-supply = <&reg_ldo2>;
  106. status = "okay";
  107. button@200 {
  108. label = "Menu";
  109. linux,code = <KEY_MENU>;
  110. channel = <0>;
  111. voltage = <200000>;
  112. };
  113. button@600 {
  114. label = "Volume Up";
  115. linux,code = <KEY_VOLUMEUP>;
  116. channel = <0>;
  117. voltage = <600000>;
  118. };
  119. button@800 {
  120. label = "Volume Down";
  121. linux,code = <KEY_VOLUMEDOWN>;
  122. channel = <0>;
  123. voltage = <800000>;
  124. };
  125. button@1000 {
  126. label = "Home";
  127. linux,code = <KEY_HOMEPAGE>;
  128. channel = <0>;
  129. voltage = <1000000>;
  130. };
  131. button@1200 {
  132. label = "Esc";
  133. linux,code = <KEY_ESC>;
  134. channel = <0>;
  135. voltage = <1200000>;
  136. };
  137. };
  138. &mmc0 {
  139. pinctrl-names = "default";
  140. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  141. vmmc-supply = <&reg_vcc3v3>;
  142. bus-width = <4>;
  143. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  144. cd-inverted;
  145. status = "okay";
  146. };
  147. &otg_sram {
  148. status = "okay";
  149. };
  150. &pio {
  151. touchscreen_wake_pin: touchscreen_wake_pin@0 {
  152. allwinner,pins = "PB13";
  153. allwinner,function ="gpio_out";
  154. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  155. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  156. };
  157. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  158. allwinner,pins = "PH4";
  159. allwinner,function = "gpio_in";
  160. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  161. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  162. };
  163. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  164. allwinner,pins = "PH5";
  165. allwinner,function = "gpio_in";
  166. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  167. allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
  168. };
  169. };
  170. &reg_dcdc2 {
  171. regulator-always-on;
  172. regulator-min-microvolt = <1000000>;
  173. regulator-max-microvolt = <1400000>;
  174. regulator-name = "vdd-cpu";
  175. };
  176. &reg_dcdc3 {
  177. regulator-always-on;
  178. regulator-min-microvolt = <1250000>;
  179. regulator-max-microvolt = <1250000>;
  180. regulator-name = "vdd-int-dll";
  181. };
  182. &reg_ldo1 {
  183. regulator-name = "vdd-rtc";
  184. };
  185. &reg_ldo2 {
  186. regulator-always-on;
  187. regulator-min-microvolt = <3000000>;
  188. regulator-max-microvolt = <3000000>;
  189. regulator-name = "avcc";
  190. };
  191. &reg_usb0_vbus {
  192. status = "okay";
  193. };
  194. &reg_usb2_vbus {
  195. status = "okay";
  196. };
  197. &uart0 {
  198. pinctrl-names = "default";
  199. pinctrl-0 = <&uart0_pins_a>;
  200. status = "okay";
  201. };
  202. &usb_otg {
  203. dr_mode = "otg";
  204. status = "okay";
  205. };
  206. &usbphy {
  207. pinctrl-names = "default";
  208. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  209. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  210. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  211. usb0_vbus-supply = <&reg_usb0_vbus>;
  212. usb2_vbus-supply = <&reg_usb2_vbus>;
  213. status = "okay";
  214. };
  215.