sun5i-r8-chip.dts 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /*
  2. * Copyright 2015 Free Electrons
  3. * Copyright 2015 NextThing Co
  4. *
  5. * Maxime Ripard <[email protected]>
  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. i2c1 = &i2c1;
  56. i2c2 = &i2c2;
  57. serial0 = &uart1;
  58. serial1 = &uart3;
  59. spi0 = &spi2;
  60. };
  61. chosen {
  62. stdout-path = "serial0:115200n8";
  63. };
  64. leds {
  65. compatible = "gpio-leds";
  66. status {
  67. label = "chip:white:status";
  68. gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>;
  69. default-state = "on";
  70. };
  71. };
  72. mmc0_pwrseq: mmc0_pwrseq {
  73. compatible = "mmc-pwrseq-simple";
  74. reset-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */
  75. };
  76. onewire {
  77. compatible = "w1-gpio";
  78. gpios = <&pio 3 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PD2 */
  79. };
  80. };
  81. &be0 {
  82. status = "okay";
  83. };
  84. &codec {
  85. status = "okay";
  86. };
  87. &cpu0 {
  88. cpu-supply = <&reg_dcdc2>;
  89. };
  90. &ehci0 {
  91. status = "okay";
  92. };
  93. &i2c0 {
  94. status = "okay";
  95. axp209: pmic@34 {
  96. reg = <0x34>;
  97. /*
  98. * The interrupt is routed through the "External Fast
  99. * Interrupt Request" pin (ball G13 of the module)
  100. * directly to the main interrupt controller, without
  101. * any other controller interfering.
  102. */
  103. interrupts = <0>;
  104. };
  105. };
  106. #include "axp209.dtsi"
  107. &ac_power_supply {
  108. status = "okay";
  109. };
  110. &battery_power_supply {
  111. status = "okay";
  112. };
  113. &i2c1 {
  114. status = "disabled";
  115. };
  116. &i2c2 {
  117. status = "okay";
  118. xio: gpio@38 {
  119. compatible = "nxp,pcf8574a";
  120. reg = <0x38>;
  121. gpio-controller;
  122. #gpio-cells = <2>;
  123. interrupt-parent = <&pio>;
  124. interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
  125. interrupt-controller;
  126. #interrupt-cells = <2>;
  127. };
  128. };
  129. &mmc0_pins {
  130. bias-pull-up;
  131. };
  132. &mmc0 {
  133. vmmc-supply = <&reg_vcc3v3>;
  134. mmc-pwrseq = <&mmc0_pwrseq>;
  135. bus-width = <4>;
  136. non-removable;
  137. status = "okay";
  138. };
  139. &ohci0 {
  140. status = "okay";
  141. };
  142. &otg_sram {
  143. status = "okay";
  144. };
  145. &reg_dcdc2 {
  146. regulator-min-microvolt = <1000000>;
  147. regulator-max-microvolt = <1400000>;
  148. regulator-name = "cpuvdd";
  149. regulator-always-on;
  150. };
  151. &reg_dcdc3 {
  152. regulator-min-microvolt = <1000000>;
  153. regulator-max-microvolt = <1300000>;
  154. regulator-name = "corevdd";
  155. regulator-always-on;
  156. };
  157. &reg_ldo1 {
  158. regulator-name = "rtcvdd";
  159. };
  160. &reg_ldo2 {
  161. regulator-min-microvolt = <2700000>;
  162. regulator-max-microvolt = <3300000>;
  163. regulator-name = "avcc";
  164. regulator-always-on;
  165. };
  166. /*
  167. * Both LDO3 and LDO4 are used in parallel to power up the WiFi/BT
  168. * Chip.
  169. *
  170. * If those are not enabled, the SDIO part will not enumerate, and
  171. * since there's no way currently to pass DT infos to an SDIO device,
  172. * we cannot really do better than this ugly hack for now.
  173. */
  174. &reg_ldo3 {
  175. regulator-min-microvolt = <3300000>;
  176. regulator-max-microvolt = <3300000>;
  177. regulator-name = "vcc-wifi-1";
  178. regulator-always-on;
  179. };
  180. &reg_ldo4 {
  181. regulator-min-microvolt = <3300000>;
  182. regulator-max-microvolt = <3300000>;
  183. regulator-name = "vcc-wifi-2";
  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. vin-supply = <&reg_vcc5v0>;
  193. gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
  194. status = "okay";
  195. };
  196. &spi2 {
  197. pinctrl-names = "default";
  198. pinctrl-0 = <&spi2_pe_pins>;
  199. status = "disabled";
  200. };
  201. &tcon0 {
  202. status = "okay";
  203. };
  204. &tve0 {
  205. status = "okay";
  206. };
  207. &uart1 {
  208. pinctrl-names = "default";
  209. pinctrl-0 = <&uart1_pg_pins>;
  210. status = "okay";
  211. };
  212. &uart3 {
  213. pinctrl-names = "default";
  214. pinctrl-0 = <&uart3_pg_pins>,
  215. <&uart3_cts_rts_pg_pins>;
  216. status = "okay";
  217. };
  218. &usb_otg {
  219. dr_mode = "otg";
  220. status = "okay";
  221. };
  222. &usb_power_supply {
  223. status = "okay";
  224. };
  225. &usbphy {
  226. status = "okay";
  227. usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
  228. usb0_vbus_power-supply = <&usb_power_supply>;
  229. usb0_vbus-supply = <&reg_usb0_vbus>;
  230. usb1_vbus-supply = <&reg_vcc5v0>;
  231. };