0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
0004 *
0005 * Based on sun8i-h3-bananapi-m2-plus.dts, which is:
0006 * Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
0007 */
0008
0009 /dts-v1/;
0010 #include "sun8i-h3.dtsi"
0011 #include "sunxi-common-regulators.dtsi"
0012
0013 #include <dt-bindings/gpio/gpio.h>
0014 #include <dt-bindings/input/input.h>
0015
0016 / {
0017 model = "Banana Pi BPI-M2-Zero";
0018 compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
0019
0020 aliases {
0021 serial0 = &uart0;
0022 serial1 = &uart1;
0023 };
0024
0025 chosen {
0026 stdout-path = "serial0:115200n8";
0027 };
0028
0029 connector {
0030 compatible = "hdmi-connector";
0031 type = "c";
0032
0033 port {
0034 hdmi_con_in: endpoint {
0035 remote-endpoint = <&hdmi_out_con>;
0036 };
0037 };
0038 };
0039
0040 leds {
0041 compatible = "gpio-leds";
0042
0043 pwr_led {
0044 label = "bananapi-m2-zero:red:pwr";
0045 gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
0046 default-state = "on";
0047 };
0048 };
0049
0050 gpio-keys {
0051 compatible = "gpio-keys";
0052
0053 switch-4 {
0054 label = "power";
0055 linux,code = <KEY_POWER>;
0056 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0057 wakeup-source;
0058 };
0059 };
0060
0061 reg_vdd_cpux: vdd-cpux-regulator {
0062 compatible = "regulator-gpio";
0063 regulator-name = "vdd-cpux";
0064 regulator-type = "voltage";
0065 regulator-boot-on;
0066 regulator-always-on;
0067 regulator-min-microvolt = <1100000>;
0068 regulator-max-microvolt = <1300000>;
0069 regulator-ramp-delay = <50>; /* 4ms */
0070
0071 gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
0072 enable-active-high;
0073 gpios-states = <0x1>;
0074 states = <1100000 0>, <1300000 1>;
0075 };
0076
0077 reg_vcc_dram: vcc-dram {
0078 compatible = "regulator-fixed";
0079 regulator-name = "vcc-dram";
0080 regulator-min-microvolt = <1500000>;
0081 regulator-max-microvolt = <1500000>;
0082 regulator-always-on;
0083 regulator-boot-on;
0084 enable-active-high;
0085 gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
0086 vin-supply = <®_vcc5v0>;
0087 };
0088
0089 reg_vcc1v2: vcc1v2 {
0090 compatible = "regulator-fixed";
0091 regulator-name = "vcc1v2";
0092 regulator-min-microvolt = <1200000>;
0093 regulator-max-microvolt = <1200000>;
0094 regulator-always-on;
0095 regulator-boot-on;
0096 enable-active-high;
0097 gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
0098 vin-supply = <®_vcc5v0>;
0099 };
0100
0101 poweroff {
0102 compatible = "regulator-poweroff";
0103 cpu-supply = <®_vcc1v2>;
0104 };
0105
0106 wifi_pwrseq: wifi_pwrseq {
0107 compatible = "mmc-pwrseq-simple";
0108 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0109 clocks = <&rtc CLK_OSC32K_FANOUT>;
0110 clock-names = "ext_clock";
0111 };
0112 };
0113
0114 &cpu0 {
0115 cpu-supply = <®_vdd_cpux>;
0116 };
0117
0118 &de {
0119 status = "okay";
0120 };
0121
0122 &ehci0 {
0123 status = "okay";
0124 };
0125
0126 &hdmi {
0127 status = "okay";
0128 };
0129
0130 &hdmi_out {
0131 hdmi_out_con: endpoint {
0132 remote-endpoint = <&hdmi_con_in>;
0133 };
0134 };
0135
0136 &mmc0 {
0137 vmmc-supply = <®_vcc3v3>;
0138 bus-width = <4>;
0139 /*
0140 * On the production batch of this board the card detect GPIO is
0141 * high active (card inserted), although on the early samples it's
0142 * low active.
0143 */
0144 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
0145 status = "okay";
0146 };
0147
0148 &mmc1 {
0149 vmmc-supply = <®_vcc3v3>;
0150 vqmmc-supply = <®_vcc3v3>;
0151 mmc-pwrseq = <&wifi_pwrseq>;
0152 bus-width = <4>;
0153 non-removable;
0154 status = "okay";
0155
0156 brcmf: wifi@1 {
0157 reg = <1>;
0158 compatible = "brcm,bcm4329-fmac";
0159 interrupt-parent = <&pio>;
0160 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
0161 interrupt-names = "host-wake";
0162 };
0163 };
0164
0165 &ohci0 {
0166 status = "okay";
0167 };
0168
0169 &uart0 {
0170 pinctrl-names = "default";
0171 pinctrl-0 = <&uart0_pa_pins>;
0172 status = "okay";
0173 };
0174
0175 &uart1 {
0176 pinctrl-names = "default";
0177 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
0178 uart-has-rtscts;
0179 status = "okay";
0180
0181 bluetooth {
0182 compatible = "brcm,bcm43438-bt";
0183 max-speed = <1500000>;
0184 clocks = <&rtc CLK_OSC32K_FANOUT>;
0185 clock-names = "lpo";
0186 vbat-supply = <®_vcc3v3>;
0187 vddio-supply = <®_vcc3v3>;
0188 device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
0189 host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
0190 shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0191 };
0192
0193 };
0194
0195 &pio {
0196 gpio-line-names =
0197 /* PA */
0198 "CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15",
0199 "CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29",
0200 "CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05",
0201 "CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16",
0202 "CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27",
0203 "CON2-P40", "CON2-P38", "", "",
0204 "", "", "", "", "", "", "", "",
0205
0206 /* PB */
0207 "", "", "", "", "", "", "", "",
0208 "", "", "", "", "", "", "", "",
0209 "", "", "", "", "", "", "", "",
0210 "", "", "", "", "", "", "", "",
0211
0212 /* PC */
0213 "CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24",
0214 "CON2-P18", "", "", "CON2-P26",
0215 "", "", "", "", "", "", "", "",
0216 "", "", "", "", "", "", "", "",
0217 "", "", "", "", "", "", "", "",
0218
0219 /* PD */
0220 "", "", "", "", "", "", "", "",
0221 "", "", "", "", "", "", "CSI-PWR-EN", "",
0222 "", "", "", "", "", "", "", "",
0223 "", "", "", "", "", "", "", "",
0224
0225 /* PE */
0226 "CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07",
0227 "CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20",
0228 "CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12",
0229 "CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08",
0230 "", "", "", "", "", "", "", "",
0231 "", "", "", "", "", "", "", "",
0232
0233 /* PF */
0234 "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
0235 "SDC0-D2", "SDC0-DET", "",
0236 "", "", "", "", "", "", "", "",
0237 "", "", "", "", "", "", "", "",
0238 "", "", "", "", "", "", "", "",
0239
0240 /* PG */
0241 "WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1",
0242 "WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX",
0243 "BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP",
0244 "BT-RST-N", "AP-WAKE-BT", "", "",
0245 "", "", "", "", "", "", "", "",
0246 "", "", "", "", "", "", "", "";
0247 };
0248
0249 &r_pio {
0250 gpio-line-names =
0251 /* PL */
0252 "", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36",
0253 "VCC-IO-EN", "USB0-ID", "WL-PWR-EN",
0254 "PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "",
0255 "", "", "", "", "", "", "", "",
0256 "", "", "", "", "", "", "", "";
0257 };
0258
0259 &usb_otg {
0260 dr_mode = "otg";
0261 status = "okay";
0262 };
0263
0264 &usbphy {
0265 usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0266 /*
0267 * There're two micro-USB connectors, one is power-only and another is
0268 * OTG. The Vbus of these two connectors are connected together, so
0269 * the external USB device will be powered just by the power input
0270 * from the power-only USB port.
0271 */
0272 status = "okay";
0273 };