sun8i-h2-plus-bananapi-m2-zero.dts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (C) 2017 Icenowy Zheng <[email protected]>
  4. *
  5. * Based on sun8i-h3-bananapi-m2-plus.dts, which is:
  6. * Copyright (C) 2016 Chen-Yu Tsai <[email protected]>
  7. */
  8. /dts-v1/;
  9. #include "sun8i-h3.dtsi"
  10. #include "sunxi-common-regulators.dtsi"
  11. #include <dt-bindings/gpio/gpio.h>
  12. #include <dt-bindings/input/input.h>
  13. / {
  14. model = "Banana Pi BPI-M2-Zero";
  15. compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
  16. aliases {
  17. serial0 = &uart0;
  18. serial1 = &uart1;
  19. };
  20. chosen {
  21. stdout-path = "serial0:115200n8";
  22. };
  23. connector {
  24. compatible = "hdmi-connector";
  25. type = "c";
  26. port {
  27. hdmi_con_in: endpoint {
  28. remote-endpoint = <&hdmi_out_con>;
  29. };
  30. };
  31. };
  32. leds {
  33. compatible = "gpio-leds";
  34. pwr_led {
  35. label = "bananapi-m2-zero:red:pwr";
  36. gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
  37. default-state = "on";
  38. };
  39. };
  40. gpio-keys {
  41. compatible = "gpio-keys";
  42. switch-4 {
  43. label = "power";
  44. linux,code = <KEY_POWER>;
  45. gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
  46. wakeup-source;
  47. };
  48. };
  49. reg_vdd_cpux: vdd-cpux-regulator {
  50. compatible = "regulator-gpio";
  51. regulator-name = "vdd-cpux";
  52. regulator-type = "voltage";
  53. regulator-boot-on;
  54. regulator-always-on;
  55. regulator-min-microvolt = <1100000>;
  56. regulator-max-microvolt = <1300000>;
  57. regulator-ramp-delay = <50>; /* 4ms */
  58. gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
  59. enable-active-high;
  60. gpios-states = <0x1>;
  61. states = <1100000 0>, <1300000 1>;
  62. };
  63. reg_vcc_dram: vcc-dram {
  64. compatible = "regulator-fixed";
  65. regulator-name = "vcc-dram";
  66. regulator-min-microvolt = <1500000>;
  67. regulator-max-microvolt = <1500000>;
  68. regulator-always-on;
  69. regulator-boot-on;
  70. enable-active-high;
  71. gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
  72. vin-supply = <&reg_vcc5v0>;
  73. };
  74. reg_vcc1v2: vcc1v2 {
  75. compatible = "regulator-fixed";
  76. regulator-name = "vcc1v2";
  77. regulator-min-microvolt = <1200000>;
  78. regulator-max-microvolt = <1200000>;
  79. regulator-always-on;
  80. regulator-boot-on;
  81. enable-active-high;
  82. gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
  83. vin-supply = <&reg_vcc5v0>;
  84. };
  85. poweroff {
  86. compatible = "regulator-poweroff";
  87. cpu-supply = <&reg_vcc1v2>;
  88. };
  89. wifi_pwrseq: wifi_pwrseq {
  90. compatible = "mmc-pwrseq-simple";
  91. reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
  92. clocks = <&rtc CLK_OSC32K_FANOUT>;
  93. clock-names = "ext_clock";
  94. };
  95. };
  96. &cpu0 {
  97. cpu-supply = <&reg_vdd_cpux>;
  98. };
  99. &de {
  100. status = "okay";
  101. };
  102. &ehci0 {
  103. status = "okay";
  104. };
  105. &hdmi {
  106. status = "okay";
  107. };
  108. &hdmi_out {
  109. hdmi_out_con: endpoint {
  110. remote-endpoint = <&hdmi_con_in>;
  111. };
  112. };
  113. &mmc0 {
  114. vmmc-supply = <&reg_vcc3v3>;
  115. bus-width = <4>;
  116. /*
  117. * On the production batch of this board the card detect GPIO is
  118. * high active (card inserted), although on the early samples it's
  119. * low active.
  120. */
  121. cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
  122. status = "okay";
  123. };
  124. &mmc1 {
  125. vmmc-supply = <&reg_vcc3v3>;
  126. vqmmc-supply = <&reg_vcc3v3>;
  127. mmc-pwrseq = <&wifi_pwrseq>;
  128. bus-width = <4>;
  129. non-removable;
  130. status = "okay";
  131. brcmf: wifi@1 {
  132. reg = <1>;
  133. compatible = "brcm,bcm4329-fmac";
  134. interrupt-parent = <&pio>;
  135. interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
  136. interrupt-names = "host-wake";
  137. };
  138. };
  139. &ohci0 {
  140. status = "okay";
  141. };
  142. &uart0 {
  143. pinctrl-names = "default";
  144. pinctrl-0 = <&uart0_pa_pins>;
  145. status = "okay";
  146. };
  147. &uart1 {
  148. pinctrl-names = "default";
  149. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  150. uart-has-rtscts;
  151. status = "okay";
  152. bluetooth {
  153. compatible = "brcm,bcm43438-bt";
  154. max-speed = <1500000>;
  155. clocks = <&rtc CLK_OSC32K_FANOUT>;
  156. clock-names = "lpo";
  157. vbat-supply = <&reg_vcc3v3>;
  158. vddio-supply = <&reg_vcc3v3>;
  159. device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
  160. host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
  161. shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
  162. };
  163. };
  164. &pio {
  165. gpio-line-names =
  166. /* PA */
  167. "CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15",
  168. "CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29",
  169. "CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05",
  170. "CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16",
  171. "CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27",
  172. "CON2-P40", "CON2-P38", "", "",
  173. "", "", "", "", "", "", "", "",
  174. /* PB */
  175. "", "", "", "", "", "", "", "",
  176. "", "", "", "", "", "", "", "",
  177. "", "", "", "", "", "", "", "",
  178. "", "", "", "", "", "", "", "",
  179. /* PC */
  180. "CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24",
  181. "CON2-P18", "", "", "CON2-P26",
  182. "", "", "", "", "", "", "", "",
  183. "", "", "", "", "", "", "", "",
  184. "", "", "", "", "", "", "", "",
  185. /* PD */
  186. "", "", "", "", "", "", "", "",
  187. "", "", "", "", "", "", "CSI-PWR-EN", "",
  188. "", "", "", "", "", "", "", "",
  189. "", "", "", "", "", "", "", "",
  190. /* PE */
  191. "CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07",
  192. "CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20",
  193. "CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12",
  194. "CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08",
  195. "", "", "", "", "", "", "", "",
  196. "", "", "", "", "", "", "", "",
  197. /* PF */
  198. "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
  199. "SDC0-D2", "SDC0-DET", "",
  200. "", "", "", "", "", "", "", "",
  201. "", "", "", "", "", "", "", "",
  202. "", "", "", "", "", "", "", "",
  203. /* PG */
  204. "WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1",
  205. "WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX",
  206. "BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP",
  207. "BT-RST-N", "AP-WAKE-BT", "", "",
  208. "", "", "", "", "", "", "", "",
  209. "", "", "", "", "", "", "", "";
  210. };
  211. &r_pio {
  212. gpio-line-names =
  213. /* PL */
  214. "", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36",
  215. "VCC-IO-EN", "USB0-ID", "WL-PWR-EN",
  216. "PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "",
  217. "", "", "", "", "", "", "", "",
  218. "", "", "", "", "", "", "", "";
  219. };
  220. &usb_otg {
  221. dr_mode = "otg";
  222. status = "okay";
  223. };
  224. &usbphy {
  225. usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
  226. /*
  227. * There're two micro-USB connectors, one is power-only and another is
  228. * OTG. The Vbus of these two connectors are connected together, so
  229. * the external USB device will be powered just by the power input
  230. * from the power-only USB port.
  231. */
  232. status = "okay";
  233. };