sun7i-a20-lamobo-r1.dts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. /*
  2. * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
  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. /dts-v1/;
  43. #include "sun7i-a20.dtsi"
  44. #include "sunxi-common-regulators.dtsi"
  45. #include <dt-bindings/gpio/gpio.h>
  46. #include <dt-bindings/interrupt-controller/irq.h>
  47. #include <dt-bindings/pinctrl/sun4i-a10.h>
  48. / {
  49. model = "Lamobo R1";
  50. compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20";
  51. aliases {
  52. serial0 = &uart0;
  53. serial1 = &uart3;
  54. serial2 = &uart7;
  55. };
  56. chosen {
  57. stdout-path = "serial0:115200n8";
  58. };
  59. leds {
  60. compatible = "gpio-leds";
  61. pinctrl-names = "default";
  62. pinctrl-0 = <&led_pins_lamobo_r1>;
  63. green {
  64. label = "lamobo_r1:green:usr";
  65. gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
  66. };
  67. };
  68. reg_gmac_3v3: gmac-3v3 {
  69. compatible = "regulator-fixed";
  70. pinctrl-names = "default";
  71. pinctrl-0 = <&gmac_power_pin_lamobo_r1>;
  72. regulator-name = "gmac-3v3";
  73. regulator-min-microvolt = <3300000>;
  74. regulator-max-microvolt = <3300000>;
  75. startup-delay-us = <100000>;
  76. enable-active-high;
  77. gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
  78. };
  79. };
  80. &ahci_pwr_pin_a {
  81. allwinner,pins = "PB3";
  82. };
  83. &ahci {
  84. target-supply = <&reg_ahci_5v>;
  85. status = "okay";
  86. };
  87. &codec {
  88. status = "okay";
  89. };
  90. &cpu0 {
  91. cpu-supply = <&reg_dcdc2>;
  92. };
  93. &ehci0 {
  94. status = "okay";
  95. };
  96. &ehci1 {
  97. status = "okay";
  98. };
  99. &gmac {
  100. pinctrl-names = "default";
  101. pinctrl-0 = <&gmac_pins_rgmii_a>;
  102. phy-mode = "rgmii";
  103. phy-supply = <&reg_gmac_3v3>;
  104. status = "okay";
  105. fixed-link {
  106. speed = <1000>;
  107. full-duplex;
  108. };
  109. mdio {
  110. compatible = "snps,dwmac-mdio";
  111. #address-cells = <1>;
  112. #size-cells = <0>;
  113. switch: ethernet-switch@1e {
  114. compatible = "brcm,bcm53125";
  115. reg = <30>;
  116. #address-cells = <1>;
  117. #size-cells = <0>;
  118. ports {
  119. #address-cells = <1>;
  120. #size-cells = <0>;
  121. port0: port@0 {
  122. reg = <0>;
  123. label = "lan2";
  124. };
  125. port1: port@1 {
  126. reg = <1>;
  127. label = "lan3";
  128. };
  129. port2: port@2 {
  130. reg = <2>;
  131. label = "lan4";
  132. };
  133. port3: port@3 {
  134. reg = <3>;
  135. label = "wan";
  136. };
  137. port4: port@4 {
  138. reg = <4>;
  139. label = "lan1";
  140. };
  141. port8: port@8 {
  142. reg = <8>;
  143. label = "cpu";
  144. ethernet = <&gmac>;
  145. phy-mode = "rgmii";
  146. fixed-link {
  147. speed = <1000>;
  148. full-duplex;
  149. };
  150. };
  151. };
  152. };
  153. };
  154. };
  155. &i2c0 {
  156. pinctrl-names = "default";
  157. pinctrl-0 = <&i2c0_pins_a>;
  158. status = "okay";
  159. axp209: pmic@34 {
  160. reg = <0x34>;
  161. interrupt-parent = <&nmi_intc>;
  162. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  163. };
  164. };
  165. &i2c2 {
  166. pinctrl-names = "default";
  167. pinctrl-0 = <&i2c2_pins_a>;
  168. status = "okay";
  169. };
  170. &ir0 {
  171. pinctrl-names = "default";
  172. pinctrl-0 = <&ir0_rx_pins_a>;
  173. status = "okay";
  174. };
  175. &mmc0 {
  176. pinctrl-names = "default";
  177. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
  178. vmmc-supply = <&reg_vcc3v3>;
  179. bus-width = <4>;
  180. cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
  181. cd-inverted;
  182. status = "okay";
  183. };
  184. &ohci0 {
  185. status = "okay";
  186. };
  187. &otg_sram {
  188. status = "okay";
  189. };
  190. &pio {
  191. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  192. allwinner,pins = "PH4";
  193. allwinner,function = "gpio_in";
  194. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  195. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  196. };
  197. mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 {
  198. allwinner,pins = "PH10";
  199. allwinner,function = "gpio_in";
  200. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  201. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  202. };
  203. gmac_power_pin_lamobo_r1: gmac_power_pin@0 {
  204. allwinner,pins = "PH23";
  205. allwinner,function = "gpio_out";
  206. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  207. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  208. };
  209. led_pins_lamobo_r1: led_pins@0 {
  210. allwinner,pins = "PH24";
  211. allwinner,function = "gpio_out";
  212. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  213. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  214. };
  215. };
  216. #include "axp209.dtsi"
  217. &reg_ahci_5v {
  218. gpio = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
  219. status = "okay";
  220. };
  221. &reg_dcdc2 {
  222. regulator-always-on;
  223. regulator-min-microvolt = <1000000>;
  224. regulator-max-microvolt = <1400000>;
  225. regulator-name = "vdd-cpu";
  226. };
  227. &reg_dcdc3 {
  228. regulator-always-on;
  229. regulator-min-microvolt = <1000000>;
  230. regulator-max-microvolt = <1400000>;
  231. regulator-name = "vdd-int-dll";
  232. };
  233. &reg_ldo1 {
  234. regulator-name = "vdd-rtc";
  235. };
  236. &reg_ldo2 {
  237. regulator-always-on;
  238. regulator-min-microvolt = <3000000>;
  239. regulator-max-microvolt = <3000000>;
  240. regulator-name = "avcc";
  241. };
  242. &reg_usb0_vbus {
  243. status = "okay";
  244. };
  245. &reg_usb2_vbus {
  246. gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
  247. status = "okay";
  248. };
  249. &spi0 {
  250. pinctrl-names = "default";
  251. pinctrl-0 = <&spi0_pins_a>,
  252. <&spi0_cs0_pins_a>,
  253. <&spi0_cs1_pins_a>;
  254. status = "okay";
  255. };
  256. &uart0 {
  257. pinctrl-names = "default";
  258. pinctrl-0 = <&uart0_pins_a>;
  259. status = "okay";
  260. };
  261. &uart3 {
  262. pinctrl-names = "default";
  263. pinctrl-0 = <&uart3_pins_b>;
  264. status = "okay";
  265. };
  266. &uart7 {
  267. pinctrl-names = "default";
  268. pinctrl-0 = <&uart7_pins_a>;
  269. status = "okay";
  270. };
  271. &usb_otg {
  272. dr_mode = "otg";
  273. status = "okay";
  274. };
  275. &usb_power_supply {
  276. status = "okay";
  277. };
  278. &usb2_vbus_pin_a {
  279. allwinner,pins = "PH12";
  280. };
  281. &usbphy {
  282. pinctrl-names = "default";
  283. pinctrl-0 = <&usb0_id_detect_pin>;
  284. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  285. usb0_vbus_power-supply = <&usb_power_supply>;
  286. usb0_vbus-supply = <&reg_usb0_vbus>;
  287. usb2_vbus-supply = <&reg_usb2_vbus>;
  288. status = "okay";
  289. };