sun5i-r8-chip.dts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /*
  2. * Copyright 2015 Free Electrons
  3. * Copyright 2015 NextThing Co
  4. *
  5. * Maxime Ripard <maxime.ripard@free-electrons.com>
  6. *
  7. * This file is dual-licensed: you can use it either under the terms
  8. * of the GPL or the X11 license, at your option. Note that this dual
  9. * licensing only applies to this file, and not this project as a
  10. * whole.
  11. *
  12. * a) This file is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This file is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * Or, alternatively,
  23. *
  24. * b) Permission is hereby granted, free of charge, to any person
  25. * obtaining a copy of this software and associated documentation
  26. * files (the "Software"), to deal in the Software without
  27. * restriction, including without limitation the rights to use,
  28. * copy, modify, merge, publish, distribute, sublicense, and/or
  29. * sell copies of the Software, and to permit persons to whom the
  30. * Software is furnished to do so, subject to the following
  31. * conditions:
  32. *
  33. * The above copyright notice and this permission notice shall be
  34. * included in all copies or substantial portions of the Software.
  35. *
  36. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  37. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  38. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  39. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  40. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  41. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  42. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  43. * OTHER DEALINGS IN THE SOFTWARE.
  44. */
  45. /dts-v1/;
  46. #include "sun5i-r8.dtsi"
  47. #include "sunxi-common-regulators.dtsi"
  48. #include <dt-bindings/gpio/gpio.h>
  49. #include <dt-bindings/interrupt-controller/irq.h>
  50. / {
  51. model = "NextThing C.H.I.P.";
  52. compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13";
  53. aliases {
  54. i2c0 = &i2c0;
  55. i2c2 = &i2c2;
  56. serial0 = &uart1;
  57. serial1 = &uart3;
  58. };
  59. chosen {
  60. stdout-path = "serial0:115200n8";
  61. };
  62. wifi_reg_on: wifi_reg_on {
  63. compatible = "regulator-fixed";
  64. pinctrl-names = "default";
  65. pinctrl-0 = <&chip_wifi_reg_on_pin>;
  66. regulator-name = "wifi-reg-on";
  67. regulator-min-microvolt = <3300000>;
  68. regulator-max-microvolt = <3300000>;
  69. gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */
  70. enable-active-high;
  71. };
  72. };
  73. &be0 {
  74. status = "okay";
  75. };
  76. &codec {
  77. status = "okay";
  78. };
  79. &cpu0 {
  80. cpu-supply = <&reg_dcdc2>;
  81. };
  82. &ehci0 {
  83. status = "okay";
  84. };
  85. &i2c0 {
  86. pinctrl-names = "default";
  87. pinctrl-0 = <&i2c0_pins_a>;
  88. status = "okay";
  89. axp209: pmic@34 {
  90. reg = <0x34>;
  91. /*
  92. * The interrupt is routed through the "External Fast
  93. * Interrupt Request" pin (ball G13 of the module)
  94. * directly to the main interrupt controller, without
  95. * any other controller interfering.
  96. */
  97. interrupts = <0>;
  98. };
  99. };
  100. #include "axp209.dtsi"
  101. &i2c2 {
  102. pinctrl-names = "default";
  103. pinctrl-0 = <&i2c2_pins_a>;
  104. status = "okay";
  105. xio: gpio@38 {
  106. compatible = "nxp,pcf8574a";
  107. reg = <0x38>;
  108. gpio-controller;
  109. #gpio-cells = <2>;
  110. interrupt-parent = <&pio>;
  111. interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
  112. interrupt-controller;
  113. #interrupt-cells = <2>;
  114. };
  115. };
  116. &mmc0_pins_a {
  117. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  118. };
  119. &mmc0 {
  120. pinctrl-names = "default";
  121. pinctrl-0 = <&mmc0_pins_a>;
  122. vmmc-supply = <&wifi_reg_on>;
  123. bus-width = <4>;
  124. non-removable;
  125. status = "okay";
  126. };
  127. &ohci0 {
  128. status = "okay";
  129. };
  130. &otg_sram {
  131. status = "okay";
  132. };
  133. &pio {
  134. chip_vbus_pin: chip_vbus_pin@0 {
  135. allwinner,pins = "PB10";
  136. allwinner,function = "gpio_out";
  137. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  138. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  139. };
  140. chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 {
  141. allwinner,pins = "PC19";
  142. allwinner,function = "gpio_out";
  143. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  144. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  145. };
  146. chip_id_det_pin: chip_id_det_pin@0 {
  147. allwinner,pins = "PG2";
  148. allwinner,function = "gpio_in";
  149. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  150. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  151. };
  152. };
  153. &reg_dcdc2 {
  154. regulator-min-microvolt = <1000000>;
  155. regulator-max-microvolt = <1400000>;
  156. regulator-name = "cpuvdd";
  157. regulator-always-on;
  158. };
  159. &reg_dcdc3 {
  160. regulator-min-microvolt = <1000000>;
  161. regulator-max-microvolt = <1300000>;
  162. regulator-name = "corevdd";
  163. regulator-always-on;
  164. };
  165. &reg_ldo1 {
  166. regulator-name = "rtcvdd";
  167. };
  168. &reg_ldo2 {
  169. regulator-min-microvolt = <2700000>;
  170. regulator-max-microvolt = <3300000>;
  171. regulator-name = "avcc";
  172. regulator-always-on;
  173. };
  174. &reg_ldo3 {
  175. regulator-min-microvolt = <3300000>;
  176. regulator-max-microvolt = <3300000>;
  177. regulator-name = "vdd-wifi1";
  178. regulator-always-on;
  179. };
  180. &reg_ldo4 {
  181. regulator-min-microvolt = <3300000>;
  182. regulator-max-microvolt = <3300000>;
  183. regulator-name = "vdd-wifi2";
  184. regulator-always-on;
  185. };
  186. &reg_ldo5 {
  187. regulator-min-microvolt = <1800000>;
  188. regulator-max-microvolt = <1800000>;
  189. regulator-name = "vcc-1v8";
  190. };
  191. &reg_usb0_vbus {
  192. pinctrl-0 = <&chip_vbus_pin>;
  193. vin-supply = <&reg_vcc5v0>;
  194. gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
  195. status = "okay";
  196. };
  197. &tcon0 {
  198. status = "okay";
  199. };
  200. &tve0 {
  201. status = "okay";
  202. };
  203. &uart1 {
  204. pinctrl-names = "default";
  205. pinctrl-0 = <&uart1_pins_b>;
  206. status = "okay";
  207. };
  208. &uart3 {
  209. pinctrl-names = "default";
  210. pinctrl-0 = <&uart3_pins_a>,
  211. <&uart3_pins_cts_rts_a>;
  212. status = "okay";
  213. };
  214. &usb_otg {
  215. dr_mode = "otg";
  216. status = "okay";
  217. };
  218. &usb_power_supply {
  219. status = "okay";
  220. };
  221. &usbphy {
  222. pinctrl-names = "default";
  223. pinctrl-0 = <&chip_id_det_pin>;
  224. status = "okay";
  225. usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
  226. usb0_vbus_power-supply = <&usb_power_supply>;
  227. usb0_vbus-supply = <&reg_usb0_vbus>;
  228. usb1_vbus-supply = <&reg_vcc5v0>;
  229. };