1724ba675SRob Herring// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2724ba675SRob Herring/* 3724ba675SRob Herring * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io> 4724ba675SRob Herring * 5724ba675SRob Herring * Based on sun8i-h3-bananapi-m2-plus.dts, which is: 6724ba675SRob Herring * Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org> 7724ba675SRob Herring */ 8724ba675SRob Herring 9724ba675SRob Herring/dts-v1/; 10724ba675SRob Herring#include "sun8i-h3.dtsi" 11724ba675SRob Herring#include "sunxi-common-regulators.dtsi" 12724ba675SRob Herring 13724ba675SRob Herring#include <dt-bindings/gpio/gpio.h> 14724ba675SRob Herring#include <dt-bindings/input/input.h> 15724ba675SRob Herring 16724ba675SRob Herring/ { 17724ba675SRob Herring model = "Banana Pi BPI-M2-Zero"; 18724ba675SRob Herring compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus"; 19724ba675SRob Herring 20724ba675SRob Herring aliases { 21724ba675SRob Herring serial0 = &uart0; 22724ba675SRob Herring serial1 = &uart1; 23724ba675SRob Herring }; 24724ba675SRob Herring 25724ba675SRob Herring chosen { 26724ba675SRob Herring stdout-path = "serial0:115200n8"; 27724ba675SRob Herring }; 28724ba675SRob Herring 29724ba675SRob Herring connector { 30724ba675SRob Herring compatible = "hdmi-connector"; 31724ba675SRob Herring type = "c"; 32724ba675SRob Herring 33724ba675SRob Herring port { 34724ba675SRob Herring hdmi_con_in: endpoint { 35724ba675SRob Herring remote-endpoint = <&hdmi_out_con>; 36724ba675SRob Herring }; 37724ba675SRob Herring }; 38724ba675SRob Herring }; 39724ba675SRob Herring 40724ba675SRob Herring leds { 41724ba675SRob Herring compatible = "gpio-leds"; 42724ba675SRob Herring 43724ba675SRob Herring pwr_led { 44724ba675SRob Herring label = "bananapi-m2-zero:red:pwr"; 45724ba675SRob Herring gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */ 46724ba675SRob Herring default-state = "on"; 47724ba675SRob Herring }; 48724ba675SRob Herring }; 49724ba675SRob Herring 50724ba675SRob Herring gpio-keys { 51724ba675SRob Herring compatible = "gpio-keys"; 52724ba675SRob Herring 53724ba675SRob Herring switch-4 { 54724ba675SRob Herring label = "power"; 55724ba675SRob Herring linux,code = <KEY_POWER>; 56724ba675SRob Herring gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; 57724ba675SRob Herring wakeup-source; 58724ba675SRob Herring }; 59724ba675SRob Herring }; 60724ba675SRob Herring 61724ba675SRob Herring reg_vdd_cpux: vdd-cpux-regulator { 62724ba675SRob Herring compatible = "regulator-gpio"; 63724ba675SRob Herring regulator-name = "vdd-cpux"; 64724ba675SRob Herring regulator-type = "voltage"; 65724ba675SRob Herring regulator-boot-on; 66724ba675SRob Herring regulator-always-on; 67724ba675SRob Herring regulator-min-microvolt = <1100000>; 68724ba675SRob Herring regulator-max-microvolt = <1300000>; 69724ba675SRob Herring regulator-ramp-delay = <50>; /* 4ms */ 70724ba675SRob Herring 71724ba675SRob Herring gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ 72724ba675SRob Herring enable-active-high; 73724ba675SRob Herring gpios-states = <0x1>; 74724ba675SRob Herring states = <1100000 0>, <1300000 1>; 75724ba675SRob Herring }; 76724ba675SRob Herring 77724ba675SRob Herring reg_vcc_dram: vcc-dram { 78724ba675SRob Herring compatible = "regulator-fixed"; 79724ba675SRob Herring regulator-name = "vcc-dram"; 80724ba675SRob Herring regulator-min-microvolt = <1500000>; 81724ba675SRob Herring regulator-max-microvolt = <1500000>; 82724ba675SRob Herring regulator-always-on; 83724ba675SRob Herring regulator-boot-on; 84724ba675SRob Herring enable-active-high; 85724ba675SRob Herring gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ 86724ba675SRob Herring vin-supply = <®_vcc5v0>; 87724ba675SRob Herring }; 88724ba675SRob Herring 89724ba675SRob Herring reg_vcc1v2: vcc1v2 { 90724ba675SRob Herring compatible = "regulator-fixed"; 91724ba675SRob Herring regulator-name = "vcc1v2"; 92724ba675SRob Herring regulator-min-microvolt = <1200000>; 93724ba675SRob Herring regulator-max-microvolt = <1200000>; 94724ba675SRob Herring regulator-always-on; 95724ba675SRob Herring regulator-boot-on; 96724ba675SRob Herring enable-active-high; 97724ba675SRob Herring gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ 98724ba675SRob Herring vin-supply = <®_vcc5v0>; 99724ba675SRob Herring }; 100724ba675SRob Herring 101724ba675SRob Herring poweroff { 102724ba675SRob Herring compatible = "regulator-poweroff"; 103724ba675SRob Herring cpu-supply = <®_vcc1v2>; 104724ba675SRob Herring }; 105724ba675SRob Herring 106*0f47ef3fSKrzysztof Kozlowski wifi_pwrseq: pwrseq { 107724ba675SRob Herring compatible = "mmc-pwrseq-simple"; 108724ba675SRob Herring reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ 109724ba675SRob Herring clocks = <&rtc CLK_OSC32K_FANOUT>; 110724ba675SRob Herring clock-names = "ext_clock"; 111724ba675SRob Herring }; 112724ba675SRob Herring}; 113724ba675SRob Herring 114724ba675SRob Herring&cpu0 { 115724ba675SRob Herring cpu-supply = <®_vdd_cpux>; 116724ba675SRob Herring}; 117724ba675SRob Herring 118724ba675SRob Herring&de { 119724ba675SRob Herring status = "okay"; 120724ba675SRob Herring}; 121724ba675SRob Herring 122724ba675SRob Herring&ehci0 { 123724ba675SRob Herring status = "okay"; 124724ba675SRob Herring}; 125724ba675SRob Herring 126724ba675SRob Herring&hdmi { 127724ba675SRob Herring status = "okay"; 128724ba675SRob Herring}; 129724ba675SRob Herring 130724ba675SRob Herring&hdmi_out { 131724ba675SRob Herring hdmi_out_con: endpoint { 132724ba675SRob Herring remote-endpoint = <&hdmi_con_in>; 133724ba675SRob Herring }; 134724ba675SRob Herring}; 135724ba675SRob Herring 136724ba675SRob Herring&mmc0 { 137724ba675SRob Herring vmmc-supply = <®_vcc3v3>; 138724ba675SRob Herring bus-width = <4>; 139724ba675SRob Herring /* 140724ba675SRob Herring * On the production batch of this board the card detect GPIO is 141724ba675SRob Herring * high active (card inserted), although on the early samples it's 142724ba675SRob Herring * low active. 143724ba675SRob Herring */ 144724ba675SRob Herring cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 145724ba675SRob Herring status = "okay"; 146724ba675SRob Herring}; 147724ba675SRob Herring 148724ba675SRob Herring&mmc1 { 149724ba675SRob Herring vmmc-supply = <®_vcc3v3>; 150724ba675SRob Herring vqmmc-supply = <®_vcc3v3>; 151724ba675SRob Herring mmc-pwrseq = <&wifi_pwrseq>; 152724ba675SRob Herring bus-width = <4>; 153724ba675SRob Herring non-removable; 154724ba675SRob Herring status = "okay"; 155724ba675SRob Herring 156724ba675SRob Herring brcmf: wifi@1 { 157724ba675SRob Herring reg = <1>; 158724ba675SRob Herring compatible = "brcm,bcm4329-fmac"; 159724ba675SRob Herring interrupt-parent = <&pio>; 160724ba675SRob Herring interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ 161724ba675SRob Herring interrupt-names = "host-wake"; 162724ba675SRob Herring }; 163724ba675SRob Herring}; 164724ba675SRob Herring 165724ba675SRob Herring&ohci0 { 166724ba675SRob Herring status = "okay"; 167724ba675SRob Herring}; 168724ba675SRob Herring 169724ba675SRob Herring&uart0 { 170724ba675SRob Herring pinctrl-names = "default"; 171724ba675SRob Herring pinctrl-0 = <&uart0_pa_pins>; 172724ba675SRob Herring status = "okay"; 173724ba675SRob Herring}; 174724ba675SRob Herring 175724ba675SRob Herring&uart1 { 176724ba675SRob Herring pinctrl-names = "default"; 177724ba675SRob Herring pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 178724ba675SRob Herring uart-has-rtscts; 179724ba675SRob Herring status = "okay"; 180724ba675SRob Herring 181724ba675SRob Herring bluetooth { 182724ba675SRob Herring compatible = "brcm,bcm43438-bt"; 183724ba675SRob Herring max-speed = <1500000>; 184724ba675SRob Herring clocks = <&rtc CLK_OSC32K_FANOUT>; 185724ba675SRob Herring clock-names = "lpo"; 186724ba675SRob Herring vbat-supply = <®_vcc3v3>; 187724ba675SRob Herring vddio-supply = <®_vcc3v3>; 188724ba675SRob Herring device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ 189724ba675SRob Herring host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ 190724ba675SRob Herring shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ 191724ba675SRob Herring }; 192724ba675SRob Herring 193724ba675SRob Herring}; 194724ba675SRob Herring 195724ba675SRob Herring&pio { 196724ba675SRob Herring gpio-line-names = 197724ba675SRob Herring /* PA */ 198724ba675SRob Herring "CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15", 199724ba675SRob Herring "CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29", 200724ba675SRob Herring "CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05", 201724ba675SRob Herring "CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16", 202724ba675SRob Herring "CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27", 203724ba675SRob Herring "CON2-P40", "CON2-P38", "", "", 204724ba675SRob Herring "", "", "", "", "", "", "", "", 205724ba675SRob Herring 206724ba675SRob Herring /* PB */ 207724ba675SRob Herring "", "", "", "", "", "", "", "", 208724ba675SRob Herring "", "", "", "", "", "", "", "", 209724ba675SRob Herring "", "", "", "", "", "", "", "", 210724ba675SRob Herring "", "", "", "", "", "", "", "", 211724ba675SRob Herring 212724ba675SRob Herring /* PC */ 213724ba675SRob Herring "CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24", 214724ba675SRob Herring "CON2-P18", "", "", "CON2-P26", 215724ba675SRob Herring "", "", "", "", "", "", "", "", 216724ba675SRob Herring "", "", "", "", "", "", "", "", 217724ba675SRob Herring "", "", "", "", "", "", "", "", 218724ba675SRob Herring 219724ba675SRob Herring /* PD */ 220724ba675SRob Herring "", "", "", "", "", "", "", "", 221724ba675SRob Herring "", "", "", "", "", "", "CSI-PWR-EN", "", 222724ba675SRob Herring "", "", "", "", "", "", "", "", 223724ba675SRob Herring "", "", "", "", "", "", "", "", 224724ba675SRob Herring 225724ba675SRob Herring /* PE */ 226724ba675SRob Herring "CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07", 227724ba675SRob Herring "CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20", 228724ba675SRob Herring "CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12", 229724ba675SRob Herring "CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08", 230724ba675SRob Herring "", "", "", "", "", "", "", "", 231724ba675SRob Herring "", "", "", "", "", "", "", "", 232724ba675SRob Herring 233724ba675SRob Herring /* PF */ 234724ba675SRob Herring "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3", 235724ba675SRob Herring "SDC0-D2", "SDC0-DET", "", 236724ba675SRob Herring "", "", "", "", "", "", "", "", 237724ba675SRob Herring "", "", "", "", "", "", "", "", 238724ba675SRob Herring "", "", "", "", "", "", "", "", 239724ba675SRob Herring 240724ba675SRob Herring /* PG */ 241724ba675SRob Herring "WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1", 242724ba675SRob Herring "WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX", 243724ba675SRob Herring "BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP", 244724ba675SRob Herring "BT-RST-N", "AP-WAKE-BT", "", "", 245724ba675SRob Herring "", "", "", "", "", "", "", "", 246724ba675SRob Herring "", "", "", "", "", "", "", ""; 247724ba675SRob Herring}; 248724ba675SRob Herring 249724ba675SRob Herring&r_pio { 250724ba675SRob Herring gpio-line-names = 251724ba675SRob Herring /* PL */ 252724ba675SRob Herring "", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36", 253724ba675SRob Herring "VCC-IO-EN", "USB0-ID", "WL-PWR-EN", 254724ba675SRob Herring "PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "", 255724ba675SRob Herring "", "", "", "", "", "", "", "", 256724ba675SRob Herring "", "", "", "", "", "", "", ""; 257724ba675SRob Herring}; 258724ba675SRob Herring 259724ba675SRob Herring&usb_otg { 260724ba675SRob Herring dr_mode = "otg"; 261724ba675SRob Herring status = "okay"; 262724ba675SRob Herring}; 263724ba675SRob Herring 264724ba675SRob Herring&usbphy { 265724ba675SRob Herring usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ 266724ba675SRob Herring /* 267724ba675SRob Herring * There're two micro-USB connectors, one is power-only and another is 268724ba675SRob Herring * OTG. The Vbus of these two connectors are connected together, so 269724ba675SRob Herring * the external USB device will be powered just by the power input 270724ba675SRob Herring * from the power-only USB port. 271724ba675SRob Herring */ 272724ba675SRob Herring status = "okay"; 273724ba675SRob Herring}; 274