xref: /openbmc/u-boot/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts (revision 6f443330186676004148930b4dd77f1c2735bd36)
1*7bb0d212SJun Nie// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*7bb0d212SJun Nie/*
3*7bb0d212SJun Nie * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4*7bb0d212SJun Nie *
5*7bb0d212SJun Nie * Based on sun8i-h3-bananapi-m2-plus.dts, which is:
6*7bb0d212SJun Nie *   Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
7*7bb0d212SJun Nie */
8*7bb0d212SJun Nie
9*7bb0d212SJun Nie/dts-v1/;
10*7bb0d212SJun Nie#include "sun8i-h3.dtsi"
11*7bb0d212SJun Nie#include "sunxi-common-regulators.dtsi"
12*7bb0d212SJun Nie
13*7bb0d212SJun Nie#include <dt-bindings/gpio/gpio.h>
14*7bb0d212SJun Nie#include <dt-bindings/input/input.h>
15*7bb0d212SJun Nie
16*7bb0d212SJun Nie/ {
17*7bb0d212SJun Nie	model = "Banana Pi BPI-M2-Zero";
18*7bb0d212SJun Nie	compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
19*7bb0d212SJun Nie
20*7bb0d212SJun Nie	aliases {
21*7bb0d212SJun Nie		serial0 = &uart0;
22*7bb0d212SJun Nie		serial1 = &uart1;
23*7bb0d212SJun Nie	};
24*7bb0d212SJun Nie
25*7bb0d212SJun Nie	chosen {
26*7bb0d212SJun Nie		stdout-path = "serial0:115200n8";
27*7bb0d212SJun Nie	};
28*7bb0d212SJun Nie
29*7bb0d212SJun Nie	leds {
30*7bb0d212SJun Nie		compatible = "gpio-leds";
31*7bb0d212SJun Nie		pinctrl-names = "default";
32*7bb0d212SJun Nie
33*7bb0d212SJun Nie		pwr_led {
34*7bb0d212SJun Nie			label = "bananapi-m2-zero:red:pwr";
35*7bb0d212SJun Nie			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
36*7bb0d212SJun Nie			default-state = "on";
37*7bb0d212SJun Nie		};
38*7bb0d212SJun Nie	};
39*7bb0d212SJun Nie
40*7bb0d212SJun Nie	gpio_keys {
41*7bb0d212SJun Nie		compatible = "gpio-keys";
42*7bb0d212SJun Nie		pinctrl-names = "default";
43*7bb0d212SJun Nie
44*7bb0d212SJun Nie		sw4 {
45*7bb0d212SJun Nie			label = "power";
46*7bb0d212SJun Nie			linux,code = <BTN_0>;
47*7bb0d212SJun Nie			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
48*7bb0d212SJun Nie		};
49*7bb0d212SJun Nie	};
50*7bb0d212SJun Nie
51*7bb0d212SJun Nie	wifi_pwrseq: wifi_pwrseq {
52*7bb0d212SJun Nie		compatible = "mmc-pwrseq-simple";
53*7bb0d212SJun Nie		pinctrl-names = "default";
54*7bb0d212SJun Nie		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
55*7bb0d212SJun Nie	};
56*7bb0d212SJun Nie};
57*7bb0d212SJun Nie
58*7bb0d212SJun Nie&ehci0 {
59*7bb0d212SJun Nie	status = "okay";
60*7bb0d212SJun Nie};
61*7bb0d212SJun Nie
62*7bb0d212SJun Nie&mmc0 {
63*7bb0d212SJun Nie	vmmc-supply = <&reg_vcc3v3>;
64*7bb0d212SJun Nie	bus-width = <4>;
65*7bb0d212SJun Nie	/*
66*7bb0d212SJun Nie	 * On the production batch of this board the card detect GPIO is
67*7bb0d212SJun Nie	 * high active (card inserted), although on the early samples it's
68*7bb0d212SJun Nie	 * low active.
69*7bb0d212SJun Nie	 */
70*7bb0d212SJun Nie	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
71*7bb0d212SJun Nie	status = "okay";
72*7bb0d212SJun Nie};
73*7bb0d212SJun Nie
74*7bb0d212SJun Nie&mmc1 {
75*7bb0d212SJun Nie	vmmc-supply = <&reg_vcc3v3>;
76*7bb0d212SJun Nie	vqmmc-supply = <&reg_vcc3v3>;
77*7bb0d212SJun Nie	mmc-pwrseq = <&wifi_pwrseq>;
78*7bb0d212SJun Nie	bus-width = <4>;
79*7bb0d212SJun Nie	non-removable;
80*7bb0d212SJun Nie	status = "okay";
81*7bb0d212SJun Nie
82*7bb0d212SJun Nie	brcmf: wifi@1 {
83*7bb0d212SJun Nie		reg = <1>;
84*7bb0d212SJun Nie		compatible = "brcm,bcm4329-fmac";
85*7bb0d212SJun Nie		interrupt-parent = <&pio>;
86*7bb0d212SJun Nie		interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
87*7bb0d212SJun Nie		interrupt-names = "host-wake";
88*7bb0d212SJun Nie	};
89*7bb0d212SJun Nie};
90*7bb0d212SJun Nie
91*7bb0d212SJun Nie&ohci0 {
92*7bb0d212SJun Nie	status = "okay";
93*7bb0d212SJun Nie};
94*7bb0d212SJun Nie
95*7bb0d212SJun Nie&uart0 {
96*7bb0d212SJun Nie	pinctrl-names = "default";
97*7bb0d212SJun Nie	pinctrl-0 = <&uart0_pins_a>;
98*7bb0d212SJun Nie	status = "okay";
99*7bb0d212SJun Nie};
100*7bb0d212SJun Nie
101*7bb0d212SJun Nie&uart1 {
102*7bb0d212SJun Nie	pinctrl-names = "default";
103*7bb0d212SJun Nie	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
104*7bb0d212SJun Nie	status = "okay";
105*7bb0d212SJun Nie};
106*7bb0d212SJun Nie
107*7bb0d212SJun Nie&usb_otg {
108*7bb0d212SJun Nie	dr_mode = "otg";
109*7bb0d212SJun Nie	status = "okay";
110*7bb0d212SJun Nie};
111*7bb0d212SJun Nie
112*7bb0d212SJun Nie&usbphy {
113*7bb0d212SJun Nie	usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
114*7bb0d212SJun Nie	/*
115*7bb0d212SJun Nie	 * There're two micro-USB connectors, one is power-only and another is
116*7bb0d212SJun Nie	 * OTG. The Vbus of these two connectors are connected together, so
117*7bb0d212SJun Nie	 * the external USB device will be powered just by the power input
118*7bb0d212SJun Nie	 * from the power-only USB port.
119*7bb0d212SJun Nie	 */
120*7bb0d212SJun Nie	status = "okay";
121*7bb0d212SJun Nie};
122