301-dt-sun7i-add-bananapro.patch 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. From 3613d535a77270eaf15a5f988a48434c7d1530f2 Mon Sep 17 00:00:00 2001
  2. From: Hans de Goede <hdegoede@redhat.com>
  3. Date: Wed, 7 Jan 2015 20:44:52 +0100
  4. Subject: [PATCH] ARM: dts: sun7i: Add dts file for Bananapro board
  5. Add support for the new Bananapro A20 development board from lemaker.org.
  6. This board features 1G RAM, 2 USB A receptacles, 1 micro USB receptacle for
  7. OTG, 1 micro USB receptacle for power, HDMI, sata, Gbit ethernet, ir receiver,
  8. 3.5 mm jack for a/v out, on board microphone, 40 gpio pins and sdio wifi.
  9. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  10. ---
  11. arch/arm/boot/dts/Makefile | 1 +
  12. arch/arm/boot/dts/sun7i-a20-bananapro.dts | 261 ++++++++++++++++++++++++++++++
  13. 2 files changed, 262 insertions(+)
  14. create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapro.dts
  15. --- a/arch/arm/boot/dts/Makefile
  16. +++ b/arch/arm/boot/dts/Makefile
  17. @@ -436,6 +436,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
  18. sun6i-a31-m9.dtb
  19. dtb-$(CONFIG_MACH_SUN7I) += \
  20. sun7i-a20-bananapi.dtb \
  21. + sun7i-a20-bananapro.dtb \
  22. sun7i-a20-cubieboard2.dtb \
  23. sun7i-a20-cubietruck.dtb \
  24. sun7i-a20-hummingbird.dtb \
  25. --- /dev/null
  26. +++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
  27. @@ -0,0 +1,261 @@
  28. +/*
  29. + * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
  30. + *
  31. + * This file is dual-licensed: you can use it either under the terms
  32. + * of the GPL or the X11 license, at your option. Note that this dual
  33. + * licensing only applies to this file, and not this project as a
  34. + * whole.
  35. + *
  36. + * a) This file is free software; you can redistribute it and/or
  37. + * modify it under the terms of the GNU General Public License as
  38. + * published by the Free Software Foundation; either version 2 of the
  39. + * License, or (at your option) any later version.
  40. + *
  41. + * This file is distributed in the hope that it will be useful,
  42. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  43. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  44. + * GNU General Public License for more details.
  45. + *
  46. + * You should have received a copy of the GNU General Public
  47. + * License along with this file; if not, write to the Free
  48. + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  49. + * MA 02110-1301 USA
  50. + *
  51. + * Or, alternatively,
  52. + *
  53. + * b) Permission is hereby granted, free of charge, to any person
  54. + * obtaining a copy of this software and associated documentation
  55. + * files (the "Software"), to deal in the Software without
  56. + * restriction, including without limitation the rights to use,
  57. + * copy, modify, merge, publish, distribute, sublicense, and/or
  58. + * sell copies of the Software, and to permit persons to whom the
  59. + * Software is furnished to do so, subject to the following
  60. + * conditions:
  61. + *
  62. + * The above copyright notice and this permission notice shall be
  63. + * included in all copies or substantial portions of the Software.
  64. + *
  65. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  66. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  67. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  68. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  69. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  70. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  71. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  72. + * OTHER DEALINGS IN THE SOFTWARE.
  73. + */
  74. +
  75. +/dts-v1/;
  76. +/include/ "sun7i-a20.dtsi"
  77. +/include/ "sunxi-common-regulators.dtsi"
  78. +
  79. +/ {
  80. + model = "LeMaker Banana Pro";
  81. + compatible = "lemaker,bananapro", "allwinner,sun7i-a20";
  82. +
  83. + soc@01c00000 {
  84. + spi0: spi@01c05000 {
  85. + pinctrl-names = "default";
  86. + pinctrl-0 = <&spi0_pins_a>;
  87. + status = "okay";
  88. + };
  89. +
  90. + mmc0: mmc@01c0f000 {
  91. + pinctrl-names = "default";
  92. + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
  93. + vmmc-supply = <&reg_vcc3v3>;
  94. + bus-width = <4>;
  95. + cd-gpios = <&pio 7 10 0>; /* PH10 */
  96. + cd-inverted;
  97. + status = "okay";
  98. + };
  99. +
  100. + mmc3: mmc@01c12000 {
  101. + pinctrl-names = "default";
  102. + pinctrl-0 = <&mmc3_pins_a>;
  103. + vmmc-supply = <&reg_vmmc3>;
  104. + bus-width = <4>;
  105. + non-removable;
  106. + status = "okay";
  107. + };
  108. +
  109. + usbphy: phy@01c13400 {
  110. + usb1_vbus-supply = <&reg_usb1_vbus>;
  111. + usb2_vbus-supply = <&reg_usb2_vbus>;
  112. + status = "okay";
  113. + };
  114. +
  115. + ehci0: usb@01c14000 {
  116. + status = "okay";
  117. + };
  118. +
  119. + ohci0: usb@01c14400 {
  120. + status = "okay";
  121. + };
  122. +
  123. + ahci: sata@01c18000 {
  124. + status = "okay";
  125. + };
  126. +
  127. + ehci1: usb@01c1c000 {
  128. + status = "okay";
  129. + };
  130. +
  131. + ohci1: usb@01c1c400 {
  132. + status = "okay";
  133. + };
  134. +
  135. + pinctrl@01c20800 {
  136. + usb1_vbus_pin_bananapro: usb1_vbus_pin@0 {
  137. + allwinner,pins = "PH0";
  138. + allwinner,function = "gpio_out";
  139. + allwinner,drive = <0>;
  140. + allwinner,pull = <0>;
  141. + };
  142. +
  143. + usb2_vbus_pin_bananapro: usb2_vbus_pin@0 {
  144. + allwinner,pins = "PH1";
  145. + allwinner,function = "gpio_out";
  146. + allwinner,drive = <0>;
  147. + allwinner,pull = <0>;
  148. + };
  149. +
  150. + mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
  151. + allwinner,pins = "PH10";
  152. + allwinner,function = "gpio_in";
  153. + allwinner,drive = <0>;
  154. + allwinner,pull = <1>;
  155. + };
  156. +
  157. + vmmc3_pin_bananapro: vmmc3_pin@0 {
  158. + allwinner,pins = "PH22";
  159. + allwinner,function = "gpio_out";
  160. + allwinner,drive = <0>;
  161. + allwinner,pull = <0>;
  162. + };
  163. +
  164. + gmac_power_pin_bananapi: gmac_power_pin@0 {
  165. + allwinner,pins = "PH23";
  166. + allwinner,function = "gpio_out";
  167. + allwinner,drive = <0>;
  168. + allwinner,pull = <0>;
  169. + };
  170. +
  171. + led_pins_bananapi: led_pins@0 {
  172. + allwinner,pins = "PH24", "PG2";
  173. + allwinner,function = "gpio_out";
  174. + allwinner,drive = <0>;
  175. + allwinner,pull = <0>;
  176. + };
  177. + };
  178. +
  179. + ir0: ir@01c21800 {
  180. + pinctrl-names = "default";
  181. + pinctrl-0 = <&ir0_pins_a>;
  182. + status = "okay";
  183. + };
  184. +
  185. + uart0: serial@01c28000 {
  186. + pinctrl-names = "default";
  187. + pinctrl-0 = <&uart0_pins_a>;
  188. + status = "okay";
  189. + };
  190. +
  191. + uart2: serial@01c28800 {
  192. + pinctrl-names = "default";
  193. + pinctrl-0 = <&uart2_pins_a>;
  194. + status = "okay";
  195. + };
  196. +
  197. + uart7: serial@01c29c00 {
  198. + pinctrl-names = "default";
  199. + pinctrl-0 = <&uart7_pins_a>;
  200. + status = "okay";
  201. + };
  202. +
  203. + i2c0: i2c@01c2ac00 {
  204. + pinctrl-names = "default";
  205. + pinctrl-0 = <&i2c0_pins_a>;
  206. + status = "okay";
  207. +
  208. + axp209: pmic@34 {
  209. + compatible = "x-powers,axp209";
  210. + reg = <0x34>;
  211. + interrupt-parent = <&nmi_intc>;
  212. + interrupts = <0 8>;
  213. +
  214. + interrupt-controller;
  215. + #interrupt-cells = <1>;
  216. + };
  217. + };
  218. +
  219. + i2c2: i2c@01c2b400 {
  220. + pinctrl-names = "default";
  221. + pinctrl-0 = <&i2c2_pins_a>;
  222. + status = "okay";
  223. + };
  224. +
  225. + gmac: ethernet@01c50000 {
  226. + pinctrl-names = "default";
  227. + pinctrl-0 = <&gmac_pins_rgmii_a>;
  228. + phy = <&phy1>;
  229. + phy-mode = "rgmii";
  230. + phy-supply = <&reg_gmac_3v3>;
  231. + status = "okay";
  232. +
  233. + phy1: ethernet-phy@1 {
  234. + reg = <1>;
  235. + };
  236. + };
  237. + };
  238. +
  239. + leds {
  240. + compatible = "gpio-leds";
  241. + pinctrl-names = "default";
  242. + pinctrl-0 = <&led_pins_bananapi>;
  243. +
  244. + green {
  245. + label = "bananapi:green:usr";
  246. + gpios = <&pio 7 24 0>;
  247. + };
  248. + blue {
  249. + label = "bananapi:blue:usr";
  250. + gpios = <&pio 6 2 0>;
  251. + };
  252. + };
  253. +
  254. + reg_usb1_vbus: usb1-vbus {
  255. + pinctrl-0 = <&usb1_vbus_pin_bananapro>;
  256. + gpio = <&pio 7 0 0>; /* PH0 */
  257. + status = "okay";
  258. + };
  259. +
  260. + reg_usb2_vbus: usb2-vbus {
  261. + pinctrl-0 = <&usb2_vbus_pin_bananapro>;
  262. + gpio = <&pio 7 1 0>; /* PH1 */
  263. + status = "okay";
  264. + };
  265. +
  266. + reg_gmac_3v3: gmac-3v3 {
  267. + compatible = "regulator-fixed";
  268. + pinctrl-names = "default";
  269. + pinctrl-0 = <&gmac_power_pin_bananapi>;
  270. + regulator-name = "gmac-3v3";
  271. + regulator-min-microvolt = <3300000>;
  272. + regulator-max-microvolt = <3300000>;
  273. + startup-delay-us = <100000>;
  274. + enable-active-high;
  275. + gpio = <&pio 7 23 0>;
  276. + };
  277. +
  278. + reg_vmmc3: vmmc3 {
  279. + compatible = "regulator-fixed";
  280. + pinctrl-names = "default";
  281. + pinctrl-0 = <&vmmc3_pin_bananapro>;
  282. + regulator-name = "vmmc3";
  283. + regulator-min-microvolt = <3300000>;
  284. + regulator-max-microvolt = <3300000>;
  285. + enable-active-high;
  286. + gpio = <&pio 7 22 0>;
  287. + };
  288. +};