200-dt-sun7i-add-lamobo-r1.patch 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. From 46662c86b453d7098ff22d6112d0481f07d523a1 Mon Sep 17 00:00:00 2001
  2. From: Jelle de Jong <jelledejong@powercraft.nl>
  3. Date: Sun, 18 Oct 2015 16:34:39 +0200
  4. Subject: [PATCH] ARM: dts: sun7i: Add dts file for the lamobo-r1 board
  5. The lamobo-r1 board, sometimes called the BPI-R1 but not labelled as such
  6. on the PCB, is meant as a A20 based router board. As such the board comes
  7. with a built-in switch chip giving it 5 gigabit ethernet boards, and it
  8. has a large empty area on the pcb with mounting holes which will fit a
  9. 2.5 inch harddisk. To complete its networking features it has a
  10. Realtek RTL8192CU for WiFi 802.11 b/g/n.
  11. Signed-off-by: Jelle de Jong <jelledejong@powercraft.nl>
  12. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  13. ---
  14. arch/arm/boot/dts/Makefile | 1 +
  15. arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 297 ++++++++++++++++++++++++++++++
  16. 2 files changed, 298 insertions(+)
  17. create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
  18. --- a/arch/arm/boot/dts/Makefile
  19. +++ b/arch/arm/boot/dts/Makefile
  20. @@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
  21. sun7i-a20-cubietruck.dtb \
  22. sun7i-a20-hummingbird.dtb \
  23. sun7i-a20-i12-tvbox.dtb \
  24. + sun7i-a20-lamobo-r1.dtb \
  25. sun7i-a20-m3.dtb \
  26. sun7i-a20-mk808c.dtb \
  27. sun7i-a20-olimex-som-evb.dtb \
  28. --- /dev/null
  29. +++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
  30. @@ -0,0 +1,297 @@
  31. +/*
  32. + * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
  33. + *
  34. + * This file is dual-licensed: you can use it either under the terms
  35. + * of the GPL or the X11 license, at your option. Note that this dual
  36. + * licensing only applies to this file, and not this project as a
  37. + * whole.
  38. + *
  39. + * a) This file is free software; you can redistribute it and/or
  40. + * modify it under the terms of the GNU General Public License as
  41. + * published by the Free Software Foundation; either version 2 of the
  42. + * License, or (at your option) any later version.
  43. + *
  44. + * This file is distributed in the hope that it will be useful,
  45. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  47. + * GNU General Public License for more details.
  48. + *
  49. + * Or, alternatively,
  50. + *
  51. + * b) Permission is hereby granted, free of charge, to any person
  52. + * obtaining a copy of this software and associated documentation
  53. + * files (the "Software"), to deal in the Software without
  54. + * restriction, including without limitation the rights to use,
  55. + * copy, modify, merge, publish, distribute, sublicense, and/or
  56. + * sell copies of the Software, and to permit persons to whom the
  57. + * Software is furnished to do so, subject to the following
  58. + * conditions:
  59. + *
  60. + * The above copyright notice and this permission notice shall be
  61. + * included in all copies or substantial portions of the Software.
  62. + *
  63. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  64. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  65. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  66. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  67. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  68. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  69. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  70. + * OTHER DEALINGS IN THE SOFTWARE.
  71. + */
  72. +
  73. +/dts-v1/;
  74. +#include "sun7i-a20.dtsi"
  75. +#include "sunxi-common-regulators.dtsi"
  76. +
  77. +#include <dt-bindings/gpio/gpio.h>
  78. +#include <dt-bindings/interrupt-controller/irq.h>
  79. +#include <dt-bindings/pinctrl/sun4i-a10.h>
  80. +
  81. +/ {
  82. + model = "Lamobo R1";
  83. + compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20";
  84. +
  85. + aliases {
  86. + serial0 = &uart0;
  87. + serial1 = &uart3;
  88. + serial2 = &uart7;
  89. + };
  90. +
  91. + chosen {
  92. + stdout-path = "serial0:115200n8";
  93. + };
  94. +
  95. + leds {
  96. + compatible = "gpio-leds";
  97. + pinctrl-names = "default";
  98. + pinctrl-0 = <&led_pins_lamobo_r1>;
  99. +
  100. + green {
  101. + label = "lamobo_r1:green:usr";
  102. + gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
  103. + };
  104. + };
  105. +
  106. + reg_gmac_3v3: gmac-3v3 {
  107. + compatible = "regulator-fixed";
  108. + pinctrl-names = "default";
  109. + pinctrl-0 = <&gmac_power_pin_lamobo_r1>;
  110. + regulator-name = "gmac-3v3";
  111. + regulator-min-microvolt = <3300000>;
  112. + regulator-max-microvolt = <3300000>;
  113. + startup-delay-us = <100000>;
  114. + enable-active-high;
  115. + gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
  116. + };
  117. +};
  118. +
  119. +&ahci_pwr_pin_a {
  120. + allwinner,pins = "PB3";
  121. +};
  122. +
  123. +&ahci {
  124. + target-supply = <&reg_ahci_5v>;
  125. + status = "okay";
  126. +};
  127. +
  128. +&cpu0 {
  129. + cpu-supply = <&reg_dcdc2>;
  130. + operating-points = <
  131. + /* kHz uV */
  132. + 960000 1400000
  133. + 912000 1400000
  134. + 864000 1350000
  135. + 720000 1250000
  136. + 528000 1150000
  137. + 312000 1100000
  138. + 144000 1050000
  139. + >;
  140. +};
  141. +
  142. +&ehci0 {
  143. + status = "okay";
  144. +};
  145. +
  146. +&ehci1 {
  147. + status = "okay";
  148. +};
  149. +
  150. +&gmac {
  151. + pinctrl-names = "default";
  152. + pinctrl-0 = <&gmac_pins_rgmii_a>;
  153. + phy = <&phy1>;
  154. + phy-mode = "rgmii";
  155. + phy-supply = <&reg_gmac_3v3>;
  156. + status = "okay";
  157. +
  158. + phy1: ethernet-phy@1 {
  159. + reg = <1>;
  160. + };
  161. +};
  162. +
  163. +&i2c0 {
  164. + pinctrl-names = "default";
  165. + pinctrl-0 = <&i2c0_pins_a>;
  166. + status = "okay";
  167. +
  168. + axp209: pmic@34 {
  169. + reg = <0x34>;
  170. + interrupt-parent = <&nmi_intc>;
  171. + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  172. + };
  173. +};
  174. +
  175. +&i2c2 {
  176. + pinctrl-names = "default";
  177. + pinctrl-0 = <&i2c2_pins_a>;
  178. + status = "okay";
  179. +};
  180. +
  181. +&ir0 {
  182. + pinctrl-names = "default";
  183. + pinctrl-0 = <&ir0_rx_pins_a>;
  184. + status = "okay";
  185. +};
  186. +
  187. +&mmc0 {
  188. + pinctrl-names = "default";
  189. + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
  190. + vmmc-supply = <&reg_vcc3v3>;
  191. + bus-width = <4>;
  192. + cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
  193. + cd-inverted;
  194. + status = "okay";
  195. +};
  196. +
  197. +&ohci0 {
  198. + status = "okay";
  199. +};
  200. +
  201. +&ohci1 {
  202. + status = "okay";
  203. +};
  204. +
  205. +&otg_sram {
  206. + status = "okay";
  207. +};
  208. +
  209. +&pio {
  210. + usb0_id_detect_pin: usb0_id_detect_pin@0 {
  211. + allwinner,pins = "PH4";
  212. + allwinner,function = "gpio_in";
  213. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  214. + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  215. + };
  216. +
  217. + mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 {
  218. + allwinner,pins = "PH10";
  219. + allwinner,function = "gpio_in";
  220. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  221. + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  222. + };
  223. +
  224. + gmac_power_pin_lamobo_r1: gmac_power_pin@0 {
  225. + allwinner,pins = "PH23";
  226. + allwinner,function = "gpio_out";
  227. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  228. + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  229. + };
  230. +
  231. + led_pins_lamobo_r1: led_pins@0 {
  232. + allwinner,pins = "PH24";
  233. + allwinner,function = "gpio_out";
  234. + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  235. + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  236. + };
  237. +};
  238. +
  239. +#include "axp209.dtsi"
  240. +
  241. +&reg_ahci_5v {
  242. + gpio = <&pio 1 3 0>; /* PB3 */
  243. + status = "okay";
  244. +};
  245. +
  246. +&reg_dcdc2 {
  247. + regulator-always-on;
  248. + regulator-min-microvolt = <1000000>;
  249. + regulator-max-microvolt = <1400000>;
  250. + regulator-name = "vdd-cpu";
  251. +};
  252. +
  253. +&reg_dcdc3 {
  254. + regulator-always-on;
  255. + regulator-min-microvolt = <1000000>;
  256. + regulator-max-microvolt = <1400000>;
  257. + regulator-name = "vdd-int-dll";
  258. +};
  259. +
  260. +&reg_ldo1 {
  261. + regulator-name = "vdd-rtc";
  262. +};
  263. +
  264. +&reg_ldo2 {
  265. + regulator-always-on;
  266. + regulator-min-microvolt = <3000000>;
  267. + regulator-max-microvolt = <3000000>;
  268. + regulator-name = "avcc";
  269. +};
  270. +
  271. +&reg_usb0_vbus {
  272. + status = "okay";
  273. +};
  274. +
  275. +&reg_usb1_vbus {
  276. + status = "okay";
  277. +};
  278. +
  279. +&reg_usb2_vbus {
  280. + status = "okay";
  281. +};
  282. +
  283. +&spi0 {
  284. + pinctrl-names = "default";
  285. + pinctrl-0 = <&spi0_pins_a>,
  286. + <&spi0_cs0_pins_a>,
  287. + <&spi0_cs1_pins_a>;
  288. + status = "okay";
  289. +};
  290. +
  291. +&uart0 {
  292. + pinctrl-names = "default";
  293. + pinctrl-0 = <&uart0_pins_a>;
  294. + status = "okay";
  295. +};
  296. +
  297. +&uart3 {
  298. + pinctrl-names = "default";
  299. + pinctrl-0 = <&uart3_pins_b>;
  300. + status = "okay";
  301. +};
  302. +
  303. +&uart7 {
  304. + pinctrl-names = "default";
  305. + pinctrl-0 = <&uart7_pins_a>;
  306. + status = "okay";
  307. +};
  308. +
  309. +&usb_otg {
  310. + dr_mode = "otg";
  311. + status = "okay";
  312. +};
  313. +
  314. +&usb_power_supply {
  315. + status = "okay";
  316. +};
  317. +
  318. +&usbphy {
  319. + pinctrl-names = "default";
  320. + pinctrl-0 = <&usb0_id_detect_pin>;
  321. + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  322. + usb0_vbus_power-supply = <&usb_power_supply>;
  323. + usb0_vbus-supply = <&reg_usb0_vbus>;
  324. + usb1_vbus-supply = <&reg_usb1_vbus>;
  325. + usb2_vbus-supply = <&reg_usb2_vbus>;
  326. + status = "okay";
  327. +};