sun5i-r8-chip.dts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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";
  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. &codec {
  74. status = "okay";
  75. };
  76. &cpu0 {
  77. cpu-supply = <&reg_dcdc2>;
  78. };
  79. &ehci0 {
  80. status = "okay";
  81. };
  82. &i2c0 {
  83. pinctrl-names = "default";
  84. pinctrl-0 = <&i2c0_pins_a>;
  85. status = "okay";
  86. axp209: pmic@34 {
  87. reg = <0x34>;
  88. /*
  89. * The interrupt is routed through the "External Fast
  90. * Interrupt Request" pin (ball G13 of the module)
  91. * directly to the main interrupt controller, without
  92. * any other controller interfering.
  93. */
  94. interrupts = <0>;
  95. };
  96. };
  97. #include "axp209.dtsi"
  98. &i2c2 {
  99. pinctrl-names = "default";
  100. pinctrl-0 = <&i2c2_pins_a>;
  101. status = "okay";
  102. xio: gpio@38 {
  103. compatible = "nxp,pcf8574a";
  104. reg = <0x38>;
  105. gpio-controller;
  106. #gpio-cells = <2>;
  107. interrupt-parent = <&pio>;
  108. interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
  109. interrupt-controller;
  110. #interrupt-cells = <2>;
  111. };
  112. };
  113. &mmc0_pins_a {
  114. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  115. };
  116. &mmc0 {
  117. pinctrl-names = "default";
  118. pinctrl-0 = <&mmc0_pins_a>;
  119. vmmc-supply = <&wifi_reg_on>;
  120. bus-width = <4>;
  121. non-removable;
  122. status = "okay";
  123. };
  124. &ohci0 {
  125. status = "okay";
  126. };
  127. &otg_sram {
  128. status = "okay";
  129. };
  130. &pio {
  131. chip_vbus_pin: chip_vbus_pin@0 {
  132. allwinner,pins = "PB10";
  133. allwinner,function = "gpio_out";
  134. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  135. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  136. };
  137. chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 {
  138. allwinner,pins = "PC19";
  139. allwinner,function = "gpio_out";
  140. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  141. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  142. };
  143. chip_id_det_pin: chip_id_det_pin@0 {
  144. allwinner,pins = "PG2";
  145. allwinner,function = "gpio_in";
  146. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  147. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  148. };
  149. };
  150. &reg_dcdc2 {
  151. regulator-min-microvolt = <1000000>;
  152. regulator-max-microvolt = <1400000>;
  153. regulator-name = "cpuvdd";
  154. regulator-always-on;
  155. };
  156. &reg_dcdc3 {
  157. regulator-min-microvolt = <1000000>;
  158. regulator-max-microvolt = <1300000>;
  159. regulator-name = "corevdd";
  160. regulator-always-on;
  161. };
  162. &reg_ldo1 {
  163. regulator-name = "rtcvdd";
  164. };
  165. &reg_ldo2 {
  166. regulator-min-microvolt = <2700000>;
  167. regulator-max-microvolt = <3300000>;
  168. regulator-name = "avcc";
  169. regulator-always-on;
  170. };
  171. &reg_ldo3 {
  172. regulator-min-microvolt = <3300000>;
  173. regulator-max-microvolt = <3300000>;
  174. regulator-name = "vdd-wifi1";
  175. regulator-always-on;
  176. };
  177. &reg_ldo4 {
  178. regulator-min-microvolt = <3300000>;
  179. regulator-max-microvolt = <3300000>;
  180. regulator-name = "vdd-wifi2";
  181. regulator-always-on;
  182. };
  183. &reg_ldo5 {
  184. regulator-min-microvolt = <1800000>;
  185. regulator-max-microvolt = <1800000>;
  186. regulator-name = "vcc-1v8";
  187. };
  188. &reg_usb0_vbus {
  189. pinctrl-0 = <&chip_vbus_pin>;
  190. vin-supply = <&reg_vcc5v0>;
  191. gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
  192. status = "okay";
  193. };
  194. &uart1 {
  195. pinctrl-names = "default";
  196. pinctrl-0 = <&uart1_pins_b>;
  197. status = "okay";
  198. };
  199. &uart3 {
  200. pinctrl-names = "default";
  201. pinctrl-0 = <&uart3_pins_a>,
  202. <&uart3_pins_cts_rts_a>;
  203. status = "okay";
  204. };
  205. &usb_otg {
  206. dr_mode = "otg";
  207. status = "okay";
  208. };
  209. &usb_power_supply {
  210. status = "okay";
  211. };
  212. &usbphy {
  213. pinctrl-names = "default";
  214. pinctrl-0 = <&chip_id_det_pin>;
  215. status = "okay";
  216. usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
  217. usb0_vbus_power-supply = <&usb_power_supply>;
  218. usb0_vbus-supply = <&reg_usb0_vbus>;
  219. usb1_vbus-supply = <&reg_vcc5v0>;
  220. };