Linux Audio

Check our new training course

Embedded Linux training

Mar 10-20, 2025, special US time zones
Register
Loading...
v5.14.15
  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	connector {
 30		compatible = "hdmi-connector";
 31		type = "c";
 32
 33		port {
 34			hdmi_con_in: endpoint {
 35				remote-endpoint = <&hdmi_out_con>;
 36			};
 37		};
 38	};
 39
 40	leds {
 41		compatible = "gpio-leds";
 42
 43		pwr_led {
 44			label = "bananapi-m2-zero:red:pwr";
 45			gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
 46			default-state = "on";
 47		};
 48	};
 49
 50	gpio_keys {
 51		compatible = "gpio-keys";
 52
 53		sw4 {
 54			label = "power";
 55			linux,code = <BTN_0>;
 56			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
 
 57		};
 58	};
 59
 60	reg_vdd_cpux: vdd-cpux-regulator {
 61		compatible = "regulator-gpio";
 62		regulator-name = "vdd-cpux";
 63		regulator-type = "voltage";
 64		regulator-boot-on;
 65		regulator-always-on;
 66		regulator-min-microvolt = <1100000>;
 67		regulator-max-microvolt = <1300000>;
 68		regulator-ramp-delay = <50>; /* 4ms */
 69
 70		gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
 71		enable-active-high;
 72		gpios-states = <0x1>;
 73		states = <1100000 0>, <1300000 1>;
 74	};
 75
 76	reg_vcc_dram: vcc-dram {
 77		compatible = "regulator-fixed";
 78		regulator-name = "vcc-dram";
 79		regulator-min-microvolt = <1500000>;
 80		regulator-max-microvolt = <1500000>;
 81		regulator-always-on;
 82		regulator-boot-on;
 83		enable-active-high;
 84		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
 85		vin-supply = <&reg_vcc5v0>;
 86	};
 87
 88	reg_vcc1v2: vcc1v2 {
 89		compatible = "regulator-fixed";
 90		regulator-name = "vcc1v2";
 91		regulator-min-microvolt = <1200000>;
 92		regulator-max-microvolt = <1200000>;
 93		regulator-always-on;
 94		regulator-boot-on;
 95		enable-active-high;
 96		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
 97		vin-supply = <&reg_vcc5v0>;
 98	};
 99
100	poweroff {
101		compatible = "regulator-poweroff";
102		cpu-supply = <&reg_vcc1v2>;
103	};
104
105	wifi_pwrseq: wifi_pwrseq {
106		compatible = "mmc-pwrseq-simple";
107		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
108		clocks = <&rtc 1>;
109		clock-names = "ext_clock";
110	};
111};
112
113&cpu0 {
114	cpu-supply = <&reg_vdd_cpux>;
115};
116
117&de {
118	status = "okay";
119};
120
121&ehci0 {
122	status = "okay";
123};
124
125&hdmi {
126	status = "okay";
127};
128
129&hdmi_out {
130	hdmi_out_con: endpoint {
131		remote-endpoint = <&hdmi_con_in>;
132	};
133};
134
135&mmc0 {
136	vmmc-supply = <&reg_vcc3v3>;
137	bus-width = <4>;
138	/*
139	 * On the production batch of this board the card detect GPIO is
140	 * high active (card inserted), although on the early samples it's
141	 * low active.
142	 */
143	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
144	status = "okay";
145};
146
147&mmc1 {
148	vmmc-supply = <&reg_vcc3v3>;
149	vqmmc-supply = <&reg_vcc3v3>;
150	mmc-pwrseq = <&wifi_pwrseq>;
151	bus-width = <4>;
152	non-removable;
153	status = "okay";
154
155	brcmf: wifi@1 {
156		reg = <1>;
157		compatible = "brcm,bcm4329-fmac";
158		interrupt-parent = <&pio>;
159		interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
160		interrupt-names = "host-wake";
161	};
162};
163
164&ohci0 {
165	status = "okay";
166};
167
168&uart0 {
169	pinctrl-names = "default";
170	pinctrl-0 = <&uart0_pa_pins>;
171	status = "okay";
172};
173
174&uart1 {
175	pinctrl-names = "default";
176	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
177	uart-has-rtscts;
178	status = "okay";
179
180	bluetooth {
181		compatible = "brcm,bcm43438-bt";
182		max-speed = <1500000>;
183		clocks = <&rtc 1>;
184		clock-names = "lpo";
185		vbat-supply = <&reg_vcc3v3>;
186		vddio-supply = <&reg_vcc3v3>;
187		device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
188		host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
189		shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
190	};
191
192};
193
194&pio {
195	gpio-line-names =
196		/* PA */
197		"CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15",
198			"CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29",
199		"CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05",
200			"CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16",
201		"CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27",
202			"CON2-P40", "CON2-P38", "", "",
203		"", "", "", "", "", "", "", "",
204
205		/* PB */
206		"", "", "", "", "", "", "", "",
207		"", "", "", "", "", "", "", "",
208		"", "", "", "", "", "", "", "",
209		"", "", "", "", "", "", "", "",
210
211		/* PC */
212		"CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24",
213			"CON2-P18", "", "", "CON2-P26",
214		"", "", "", "", "", "", "", "",
215		"", "", "", "", "", "", "", "",
216		"", "", "", "", "", "", "", "",
217
218		/* PD */
219		"", "", "", "", "", "", "", "",
220		"", "", "", "", "", "", "CSI-PWR-EN", "",
221		"", "", "", "", "", "", "", "",
222		"", "", "", "", "", "", "", "",
223
224		/* PE */
225		"CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07",
226			"CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20",
227		"CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12",
228			"CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08",
229		"", "", "", "", "", "", "", "",
230		"", "", "", "", "", "", "", "",
231
232		/* PF */
233		"SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
234			"SDC0-D2", "SDC0-DET", "",
235		"", "", "", "", "", "", "", "",
236		"", "", "", "", "", "", "", "",
237		"", "", "", "", "", "", "", "",
238
239		/* PG */
240		"WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1",
241			"WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX",
242		"BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP",
243			"BT-RST-N", "AP-WAKE-BT", "", "",
244		"", "", "", "", "", "", "", "",
245		"", "", "", "", "", "", "", "";
246};
247
248&r_pio {
249	gpio-line-names =
250		/* PL */
251		"", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36",
252			"VCC-IO-EN", "USB0-ID", "WL-PWR-EN",
253		"PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "",
254		"", "", "", "", "", "", "", "",
255		"", "", "", "", "", "", "", "";
256};
257
258&usb_otg {
259	dr_mode = "otg";
260	status = "okay";
261};
262
263&usbphy {
264	usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
265	/*
266	 * There're two micro-USB connectors, one is power-only and another is
267	 * OTG. The Vbus of these two connectors are connected together, so
268	 * the external USB device will be powered just by the power input
269	 * from the power-only USB port.
270	 */
271	status = "okay";
272};
v6.2
  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	connector {
 30		compatible = "hdmi-connector";
 31		type = "c";
 32
 33		port {
 34			hdmi_con_in: endpoint {
 35				remote-endpoint = <&hdmi_out_con>;
 36			};
 37		};
 38	};
 39
 40	leds {
 41		compatible = "gpio-leds";
 42
 43		pwr_led {
 44			label = "bananapi-m2-zero:red:pwr";
 45			gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
 46			default-state = "on";
 47		};
 48	};
 49
 50	gpio-keys {
 51		compatible = "gpio-keys";
 52
 53		switch-4 {
 54			label = "power";
 55			linux,code = <KEY_POWER>;
 56			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
 57			wakeup-source;
 58		};
 59	};
 60
 61	reg_vdd_cpux: vdd-cpux-regulator {
 62		compatible = "regulator-gpio";
 63		regulator-name = "vdd-cpux";
 64		regulator-type = "voltage";
 65		regulator-boot-on;
 66		regulator-always-on;
 67		regulator-min-microvolt = <1100000>;
 68		regulator-max-microvolt = <1300000>;
 69		regulator-ramp-delay = <50>; /* 4ms */
 70
 71		gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
 72		enable-active-high;
 73		gpios-states = <0x1>;
 74		states = <1100000 0>, <1300000 1>;
 75	};
 76
 77	reg_vcc_dram: vcc-dram {
 78		compatible = "regulator-fixed";
 79		regulator-name = "vcc-dram";
 80		regulator-min-microvolt = <1500000>;
 81		regulator-max-microvolt = <1500000>;
 82		regulator-always-on;
 83		regulator-boot-on;
 84		enable-active-high;
 85		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
 86		vin-supply = <&reg_vcc5v0>;
 87	};
 88
 89	reg_vcc1v2: vcc1v2 {
 90		compatible = "regulator-fixed";
 91		regulator-name = "vcc1v2";
 92		regulator-min-microvolt = <1200000>;
 93		regulator-max-microvolt = <1200000>;
 94		regulator-always-on;
 95		regulator-boot-on;
 96		enable-active-high;
 97		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
 98		vin-supply = <&reg_vcc5v0>;
 99	};
100
101	poweroff {
102		compatible = "regulator-poweroff";
103		cpu-supply = <&reg_vcc1v2>;
104	};
105
106	wifi_pwrseq: wifi_pwrseq {
107		compatible = "mmc-pwrseq-simple";
108		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
109		clocks = <&rtc CLK_OSC32K_FANOUT>;
110		clock-names = "ext_clock";
111	};
112};
113
114&cpu0 {
115	cpu-supply = <&reg_vdd_cpux>;
116};
117
118&de {
119	status = "okay";
120};
121
122&ehci0 {
123	status = "okay";
124};
125
126&hdmi {
127	status = "okay";
128};
129
130&hdmi_out {
131	hdmi_out_con: endpoint {
132		remote-endpoint = <&hdmi_con_in>;
133	};
134};
135
136&mmc0 {
137	vmmc-supply = <&reg_vcc3v3>;
138	bus-width = <4>;
139	/*
140	 * On the production batch of this board the card detect GPIO is
141	 * high active (card inserted), although on the early samples it's
142	 * low active.
143	 */
144	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
145	status = "okay";
146};
147
148&mmc1 {
149	vmmc-supply = <&reg_vcc3v3>;
150	vqmmc-supply = <&reg_vcc3v3>;
151	mmc-pwrseq = <&wifi_pwrseq>;
152	bus-width = <4>;
153	non-removable;
154	status = "okay";
155
156	brcmf: wifi@1 {
157		reg = <1>;
158		compatible = "brcm,bcm4329-fmac";
159		interrupt-parent = <&pio>;
160		interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
161		interrupt-names = "host-wake";
162	};
163};
164
165&ohci0 {
166	status = "okay";
167};
168
169&uart0 {
170	pinctrl-names = "default";
171	pinctrl-0 = <&uart0_pa_pins>;
172	status = "okay";
173};
174
175&uart1 {
176	pinctrl-names = "default";
177	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
178	uart-has-rtscts;
179	status = "okay";
180
181	bluetooth {
182		compatible = "brcm,bcm43438-bt";
183		max-speed = <1500000>;
184		clocks = <&rtc CLK_OSC32K_FANOUT>;
185		clock-names = "lpo";
186		vbat-supply = <&reg_vcc3v3>;
187		vddio-supply = <&reg_vcc3v3>;
188		device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
189		host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
190		shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
191	};
192
193};
194
195&pio {
196	gpio-line-names =
197		/* PA */
198		"CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15",
199			"CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29",
200		"CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05",
201			"CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16",
202		"CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27",
203			"CON2-P40", "CON2-P38", "", "",
204		"", "", "", "", "", "", "", "",
205
206		/* PB */
207		"", "", "", "", "", "", "", "",
208		"", "", "", "", "", "", "", "",
209		"", "", "", "", "", "", "", "",
210		"", "", "", "", "", "", "", "",
211
212		/* PC */
213		"CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24",
214			"CON2-P18", "", "", "CON2-P26",
215		"", "", "", "", "", "", "", "",
216		"", "", "", "", "", "", "", "",
217		"", "", "", "", "", "", "", "",
218
219		/* PD */
220		"", "", "", "", "", "", "", "",
221		"", "", "", "", "", "", "CSI-PWR-EN", "",
222		"", "", "", "", "", "", "", "",
223		"", "", "", "", "", "", "", "",
224
225		/* PE */
226		"CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07",
227			"CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20",
228		"CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12",
229			"CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08",
230		"", "", "", "", "", "", "", "",
231		"", "", "", "", "", "", "", "",
232
233		/* PF */
234		"SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
235			"SDC0-D2", "SDC0-DET", "",
236		"", "", "", "", "", "", "", "",
237		"", "", "", "", "", "", "", "",
238		"", "", "", "", "", "", "", "",
239
240		/* PG */
241		"WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1",
242			"WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX",
243		"BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP",
244			"BT-RST-N", "AP-WAKE-BT", "", "",
245		"", "", "", "", "", "", "", "",
246		"", "", "", "", "", "", "", "";
247};
248
249&r_pio {
250	gpio-line-names =
251		/* PL */
252		"", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36",
253			"VCC-IO-EN", "USB0-ID", "WL-PWR-EN",
254		"PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "",
255		"", "", "", "", "", "", "", "",
256		"", "", "", "", "", "", "", "";
257};
258
259&usb_otg {
260	dr_mode = "otg";
261	status = "okay";
262};
263
264&usbphy {
265	usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
266	/*
267	 * There're two micro-USB connectors, one is power-only and another is
268	 * OTG. The Vbus of these two connectors are connected together, so
269	 * the external USB device will be powered just by the power input
270	 * from the power-only USB port.
271	 */
272	status = "okay";
273};