300-dt-sun7i-add-bananapi.patch 6.6 KB

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