GNU Linux-libre 5.4.274-gnu1
[releases.git] / arch / arm / boot / dts / sun8i-h2-plus-bananapi-m2-zero.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4  *
5  * Based on sun8i-h3-bananapi-m2-plus.dts, which is:
6  *   Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
7  */
8
9 /dts-v1/;
10 #include "sun8i-h3.dtsi"
11 #include "sunxi-common-regulators.dtsi"
12
13 #include <dt-bindings/gpio/gpio.h>
14 #include <dt-bindings/input/input.h>
15
16 / {
17         model = "Banana Pi BPI-M2-Zero";
18         compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
19
20         aliases {
21                 serial0 = &uart0;
22                 serial1 = &uart1;
23         };
24
25         chosen {
26                 stdout-path = "serial0:115200n8";
27         };
28
29         leds {
30                 compatible = "gpio-leds";
31
32                 pwr_led {
33                         label = "bananapi-m2-zero:red:pwr";
34                         gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
35                         default-state = "on";
36                 };
37         };
38
39         gpio_keys {
40                 compatible = "gpio-keys";
41
42                 sw4 {
43                         label = "power";
44                         linux,code = <BTN_0>;
45                         gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
46                 };
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
59                 gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
60                 enable-active-high;
61                 gpios-states = <0x1>;
62                 states = <1100000 0>, <1300000 1>;
63         };
64
65         reg_vcc_dram: vcc-dram {
66                 compatible = "regulator-fixed";
67                 regulator-name = "vcc-dram";
68                 regulator-min-microvolt = <1500000>;
69                 regulator-max-microvolt = <1500000>;
70                 regulator-always-on;
71                 regulator-boot-on;
72                 enable-active-high;
73                 gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
74                 vin-supply = <&reg_vcc5v0>;
75         };
76
77         reg_vcc1v2: vcc1v2 {
78                 compatible = "regulator-fixed";
79                 regulator-name = "vcc1v2";
80                 regulator-min-microvolt = <1200000>;
81                 regulator-max-microvolt = <1200000>;
82                 regulator-always-on;
83                 regulator-boot-on;
84                 enable-active-high;
85                 gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
86                 vin-supply = <&reg_vcc5v0>;
87         };
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 1>;
93                 clock-names = "ext_clock";
94         };
95 };
96
97 &cpu0 {
98         cpu-supply = <&reg_vdd_cpux>;
99 };
100
101 &ehci0 {
102         status = "okay";
103 };
104
105 &mmc0 {
106         vmmc-supply = <&reg_vcc3v3>;
107         bus-width = <4>;
108         /*
109          * On the production batch of this board the card detect GPIO is
110          * high active (card inserted), although on the early samples it's
111          * low active.
112          */
113         cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
114         status = "okay";
115 };
116
117 &mmc1 {
118         vmmc-supply = <&reg_vcc3v3>;
119         vqmmc-supply = <&reg_vcc3v3>;
120         mmc-pwrseq = <&wifi_pwrseq>;
121         bus-width = <4>;
122         non-removable;
123         status = "okay";
124
125         brcmf: wifi@1 {
126                 reg = <1>;
127                 compatible = "brcm,bcm4329-fmac";
128                 interrupt-parent = <&pio>;
129                 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
130                 interrupt-names = "host-wake";
131         };
132 };
133
134 &ohci0 {
135         status = "okay";
136 };
137
138 &uart0 {
139         pinctrl-names = "default";
140         pinctrl-0 = <&uart0_pa_pins>;
141         status = "okay";
142 };
143
144 &uart1 {
145         pinctrl-names = "default";
146         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
147         uart-has-rtscts;
148         status = "okay";
149
150         bluetooth {
151                 compatible = "brcm,bcm43438-bt";
152                 clocks = <&rtc 1>;
153                 clock-names = "lpo";
154                 vbat-supply = <&reg_vcc3v3>;
155                 vddio-supply = <&reg_vcc3v3>;
156                 device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
157                 host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
158                 shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
159         };
160
161 };
162
163 &usb_otg {
164         dr_mode = "otg";
165         status = "okay";
166 };
167
168 &usbphy {
169         usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
170         /*
171          * There're two micro-USB connectors, one is power-only and another is
172          * OTG. The Vbus of these two connectors are connected together, so
173          * the external USB device will be powered just by the power input
174          * from the power-only USB port.
175          */
176         status = "okay";
177 };