Advertisement
Guest User

lime2 DTS with extra GPIO headers

a guest
Nov 24th, 2015
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.33 KB | None | 0 0
  1. /*
  2. * Copyright 2014 - Iain Paton <ipaton0@gmail.com>
  3. *
  4. * This file is dual-licensed: you can use it either under the terms
  5. * of the GPL or the X11 license, at your option. Note that this dual
  6. * licensing only applies to this file, and not this project as a
  7. * whole.
  8. *
  9. * a) This file is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This file is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * Or, alternatively,
  20. *
  21. * b) Permission is hereby granted, free of charge, to any person
  22. * obtaining a copy of this software and associated documentation
  23. * files (the "Software"), to deal in the Software without
  24. * restriction, including without limitation the rights to use,
  25. * copy, modify, merge, publish, distribute, sublicense, and/or
  26. * sell copies of the Software, and to permit persons to whom the
  27. * Software is furnished to do so, subject to the following
  28. * conditions:
  29. *
  30. * The above copyright notice and this permission notice shall be
  31. * included in all copies or substantial portions of the Software.
  32. *
  33. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  34. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  35. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  36. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  37. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  38. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  39. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  40. * OTHER DEALINGS IN THE SOFTWARE.
  41. */
  42.  
  43. /dts-v1/;
  44. #include "sun7i-a20.dtsi"
  45. #include "sunxi-common-regulators.dtsi"
  46.  
  47. #include <dt-bindings/gpio/gpio.h>
  48. #include <dt-bindings/interrupt-controller/irq.h>
  49. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50.  
  51. / {
  52. model = "Olimex A20-OLinuXino-LIME2";
  53. compatible = "olimex,a20-olinuxino-lime2", "allwinner,sun7i-a20";
  54.  
  55. aliases {
  56. serial0 = &uart0;
  57. };
  58.  
  59. chosen {
  60. stdout-path = "serial0:115200n8";
  61. };
  62.  
  63. leds {
  64. compatible = "gpio-leds";
  65. pinctrl-names = "default";
  66. pinctrl-0 = <&led_pins_olinuxinolime>;
  67.  
  68. green {
  69. label = "a20-olinuxino-lime2:green:usr";
  70. gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
  71. default-state = "on";
  72. };
  73. };
  74.  
  75. reg_axp_ipsout: axp_ipsout {
  76. compatible = "regulator-fixed";
  77. regulator-name = "axp-ipsout";
  78. regulator-min-microvolt = <5000000>;
  79. regulator-max-microvolt = <5000000>;
  80. regulator-always-on;
  81. };
  82.  
  83. /* dannym */
  84. tss463aa {
  85. compatible = "tss463aa";
  86. pinctrl-names = "default";
  87. pinctrl-0 = <&clk_out_a_pins_a>;
  88. clocks = <&clk_out_a>;
  89. clock-frequency = <8192>;
  90. clock-output-names = "foo";
  91. status = "okay";
  92. };
  93. };
  94.  
  95. &ahci {
  96. target-supply = <&reg_ahci_5v>;
  97. status = "okay";
  98. };
  99.  
  100. &ehci0 {
  101. status = "okay";
  102. };
  103.  
  104. &ehci1 {
  105. status = "okay";
  106. };
  107.  
  108. &gmac {
  109. pinctrl-names = "default";
  110. pinctrl-0 = <&gmac_pins_rgmii_a>;
  111. phy = <&phy1>;
  112. phy-mode = "rgmii";
  113. status = "okay";
  114.  
  115. phy1: ethernet-phy@1 {
  116. reg = <1>;
  117. };
  118. };
  119.  
  120. &i2c0 {
  121. pinctrl-names = "default";
  122. pinctrl-0 = <&i2c0_pins_a>;
  123. status = "okay";
  124.  
  125. axp209: pmic@34 {
  126. compatible = "x-powers,axp209";
  127. reg = <0x34>;
  128. interrupt-parent = <&nmi_intc>;
  129. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  130.  
  131. interrupt-controller;
  132. #interrupt-cells = <1>;
  133.  
  134. acin-supply = <&reg_axp_ipsout>;
  135. vin2-supply = <&reg_axp_ipsout>;
  136. vin3-supply = <&reg_axp_ipsout>;
  137. ldo24in-supply = <&reg_axp_ipsout>;
  138. ldo3in-supply = <&reg_axp_ipsout>;
  139.  
  140. regulators {
  141. vdd_rtc: ldo1 {
  142. regulator-min-microvolt = <1300000>;
  143. regulator-max-microvolt = <1300000>;
  144. regulator-always-on;
  145. };
  146.  
  147. avcc: ldo2 {
  148. regulator-min-microvolt = <1800000>;
  149. regulator-max-microvolt = <3300000>;
  150. regulator-always-on;
  151. };
  152.  
  153. vcc_csi0: ldo3 {
  154. regulator-min-microvolt = <700000>;
  155. regulator-max-microvolt = <3500000>;
  156. regulator-always-on;
  157. };
  158.  
  159. vcc_csi1: ldo4 {
  160. regulator-min-microvolt = <1250000>;
  161. regulator-max-microvolt = <3300000>;
  162. regulator-always-on;
  163. };
  164.  
  165. vdd_cpu: dcdc2 {
  166. regulator-min-microvolt = <700000>;
  167. regulator-max-microvolt = <2275000>;
  168. regulator-always-on;
  169. };
  170.  
  171. vdd_int: dcdc3 {
  172. regulator-min-microvolt = <700000>;
  173. regulator-max-microvolt = <3500000>;
  174. regulator-always-on;
  175. };
  176. };
  177. };
  178. };
  179.  
  180. &i2c1 {
  181. pinctrl-names = "default";
  182. pinctrl-0 = <&i2c1_pins_a>;
  183. status = "okay";
  184.  
  185. eeprom: eeprom@50 {
  186. compatible = "atmel,24c16";
  187. reg = <0x50>;
  188. pagesize = <16>;
  189. };
  190. };
  191.  
  192. &mmc0 {
  193. pinctrl-names = "default";
  194. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  195. vmmc-supply = <&reg_vcc3v3>;
  196. bus-width = <4>;
  197. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  198. cd-inverted;
  199. status = "okay";
  200. };
  201.  
  202. &ohci0 {
  203. status = "okay";
  204. };
  205.  
  206. &ohci1 {
  207. status = "okay";
  208. };
  209.  
  210. &otg_sram {
  211. status = "okay";
  212. };
  213.  
  214. &pio {
  215. ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
  216. allwinner,pins = "PC3";
  217. allwinner,function = "gpio_out";
  218. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  219. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  220. };
  221.  
  222. led_pins_olinuxinolime: led_pins@0 {
  223. allwinner,pins = "PH2";
  224. allwinner,function = "gpio_out";
  225. allwinner,drive = <SUN4I_PINCTRL_20_MA>;
  226. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  227. };
  228.  
  229. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  230. allwinner,pins = "PH4";
  231. allwinner,function = "gpio_in";
  232. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  233. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  234. };
  235.  
  236. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  237. allwinner,pins = "PH5";
  238. allwinner,function = "gpio_in";
  239. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  240. allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
  241. };
  242.  
  243. usb0_vbus_pin_lime2: usb0_vbus_pin@0 {
  244. allwinner,pins = "PC17";
  245. allwinner,function = "gpio_out";
  246. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  247. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  248. };
  249. };
  250.  
  251. &reg_ahci_5v {
  252. pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
  253. gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
  254. status = "okay";
  255. };
  256.  
  257. &reg_usb0_vbus {
  258. pinctrl-0 = <&usb0_vbus_pin_lime2>;
  259. gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
  260. status = "okay";
  261. };
  262.  
  263. &reg_usb1_vbus {
  264. status = "okay";
  265. };
  266.  
  267. &reg_usb2_vbus {
  268. status = "okay";
  269. };
  270.  
  271. &uart0 {
  272. pinctrl-names = "default";
  273. pinctrl-0 = <&uart0_pins_a>;
  274. status = "okay";
  275. };
  276.  
  277. &usb_otg {
  278. dr_mode = "otg";
  279. status = "okay";
  280. };
  281.  
  282. &uart4 {
  283. pinctrl-names = "default";
  284. pinctrl-0 = <&uart4_pins_a>;
  285. status = "okay";
  286. };
  287.  
  288. &spi2 {
  289. status = "okay";
  290. spidev0: spidev@1 {
  291. compatible = "atmel,tss463aa";
  292. reg = <0>;
  293. spi-max-frequency = <4000000>;
  294. };
  295. };
  296.  
  297. &codec {
  298. status = "okay";
  299. };
  300.  
  301. &usbphy {
  302. pinctrl-names = "default";
  303. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  304. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  305. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  306. usb0_vbus-supply = <&reg_usb0_vbus>;
  307. usb1_vbus-supply = <&reg_usb1_vbus>;
  308. usb2_vbus-supply = <&reg_usb2_vbus>;
  309. status = "okay";
  310. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement