Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 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 | leds { |
| 30 | compatible = "gpio-leds"; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 31 | |
| 32 | pwr_led { |
| 33 | label = "bananapi-m2-zero:red:pwr"; |
| 34 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ |
| 35 | default-state = "on"; |
| 36 | }; |
| 37 | }; |
| 38 | |
| 39 | gpio_keys { |
| 40 | compatible = "gpio-keys"; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 41 | |
| 42 | sw4 { |
| 43 | label = "power"; |
| 44 | linux,code = <BTN_0>; |
| 45 | gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; |
| 46 | }; |
| 47 | }; |
| 48 | |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 49 | reg_vdd_cpux: vdd-cpux-regulator { |
| 50 | compatible = "regulator-gpio"; |
| 51 | regulator-name = "vdd-cpux"; |
| 52 | regulator-type = "voltage"; |
| 53 | regulator-boot-on; |
| 54 | regulator-always-on; |
| 55 | regulator-min-microvolt = <1100000>; |
| 56 | regulator-max-microvolt = <1300000>; |
| 57 | regulator-ramp-delay = <50>; /* 4ms */ |
| 58 | |
| 59 | gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ |
| 60 | enable-active-high; |
| 61 | gpios-states = <0x1>; |
| 62 | states = <1100000 0>, <1300000 1>; |
| 63 | }; |
| 64 | |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 65 | wifi_pwrseq: wifi_pwrseq { |
| 66 | compatible = "mmc-pwrseq-simple"; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 67 | reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 68 | clocks = <&rtc 1>; |
| 69 | clock-names = "ext_clock"; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 70 | }; |
| 71 | }; |
| 72 | |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 73 | &cpu0 { |
| 74 | cpu-supply = <®_vdd_cpux>; |
| 75 | }; |
| 76 | |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 77 | &ehci0 { |
| 78 | status = "okay"; |
| 79 | }; |
| 80 | |
| 81 | &mmc0 { |
| 82 | vmmc-supply = <®_vcc3v3>; |
| 83 | bus-width = <4>; |
| 84 | /* |
| 85 | * On the production batch of this board the card detect GPIO is |
| 86 | * high active (card inserted), although on the early samples it's |
| 87 | * low active. |
| 88 | */ |
| 89 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ |
| 90 | status = "okay"; |
| 91 | }; |
| 92 | |
| 93 | &mmc1 { |
| 94 | vmmc-supply = <®_vcc3v3>; |
| 95 | vqmmc-supply = <®_vcc3v3>; |
| 96 | mmc-pwrseq = <&wifi_pwrseq>; |
| 97 | bus-width = <4>; |
| 98 | non-removable; |
| 99 | status = "okay"; |
| 100 | |
| 101 | brcmf: wifi@1 { |
| 102 | reg = <1>; |
| 103 | compatible = "brcm,bcm4329-fmac"; |
| 104 | interrupt-parent = <&pio>; |
| 105 | interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ |
| 106 | interrupt-names = "host-wake"; |
| 107 | }; |
| 108 | }; |
| 109 | |
| 110 | &ohci0 { |
| 111 | status = "okay"; |
| 112 | }; |
| 113 | |
| 114 | &uart0 { |
| 115 | pinctrl-names = "default"; |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 116 | pinctrl-0 = <&uart0_pa_pins>; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 117 | status = "okay"; |
| 118 | }; |
| 119 | |
| 120 | &uart1 { |
| 121 | pinctrl-names = "default"; |
| 122 | pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 123 | uart-has-rtscts; |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 124 | status = "okay"; |
Chen-Yu Tsai | b5fe523 | 2020-01-12 23:36:13 +0800 | [diff] [blame] | 125 | |
| 126 | bluetooth { |
| 127 | compatible = "brcm,bcm43438-bt"; |
| 128 | clocks = <&rtc 1>; |
| 129 | clock-names = "lpo"; |
| 130 | vbat-supply = <®_vcc3v3>; |
| 131 | vddio-supply = <®_vcc3v3>; |
| 132 | device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ |
| 133 | host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ |
| 134 | shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ |
| 135 | }; |
| 136 | |
Jun Nie | 7bb0d21 | 2018-10-27 13:11:00 +0800 | [diff] [blame] | 137 | }; |
| 138 | |
| 139 | &usb_otg { |
| 140 | dr_mode = "otg"; |
| 141 | status = "okay"; |
| 142 | }; |
| 143 | |
| 144 | &usbphy { |
| 145 | usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ |
| 146 | /* |
| 147 | * There're two micro-USB connectors, one is power-only and another is |
| 148 | * OTG. The Vbus of these two connectors are connected together, so |
| 149 | * the external USB device will be powered just by the power input |
| 150 | * from the power-only USB port. |
| 151 | */ |
| 152 | status = "okay"; |
| 153 | }; |