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

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