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