1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2// Copyright (C) 2019 Ondřej Jirman <megous@megous.com> 3 4/dts-v1/; 5 6#include "sun50i-h6.dtsi" 7#include "sun50i-h6-cpu-opp.dtsi" 8 9#include <dt-bindings/gpio/gpio.h> 10 11/ { 12 model = "OrangePi 3"; 13 compatible = "xunlong,orangepi-3", "allwinner,sun50i-h6"; 14 15 aliases { 16 serial0 = &uart0; 17 serial1 = &uart1; 18 }; 19 20 chosen { 21 stdout-path = "serial0:115200n8"; 22 }; 23 24 connector { 25 compatible = "hdmi-connector"; 26 ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */ 27 type = "a"; 28 29 port { 30 hdmi_con_in: endpoint { 31 remote-endpoint = <&hdmi_out_con>; 32 }; 33 }; 34 }; 35 36 ext_osc32k: ext-osc32k-clk { 37 #clock-cells = <0>; 38 compatible = "fixed-clock"; 39 clock-frequency = <32768>; 40 clock-output-names = "ext_osc32k"; 41 }; 42 43 leds { 44 compatible = "gpio-leds"; 45 46 led-0 { 47 label = "orangepi:red:power"; 48 gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ 49 default-state = "on"; 50 }; 51 52 led-1 { 53 label = "orangepi:green:status"; 54 gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ 55 }; 56 }; 57 58 reg_vcc5v: vcc5v { 59 /* board wide 5V supply directly from the DC jack */ 60 compatible = "regulator-fixed"; 61 regulator-name = "vcc-5v"; 62 regulator-min-microvolt = <5000000>; 63 regulator-max-microvolt = <5000000>; 64 regulator-always-on; 65 }; 66 67 reg_vcc33_wifi: vcc33-wifi { 68 /* Always on 3.3V regulator for WiFi and BT */ 69 compatible = "regulator-fixed"; 70 regulator-name = "vcc33-wifi"; 71 regulator-min-microvolt = <3300000>; 72 regulator-max-microvolt = <3300000>; 73 regulator-always-on; 74 vin-supply = <®_vcc5v>; 75 }; 76 77 reg_vcc_wifi_io: vcc-wifi-io { 78 /* Always on 1.8V/300mA regulator for WiFi and BT IO */ 79 compatible = "regulator-fixed"; 80 regulator-name = "vcc-wifi-io"; 81 regulator-min-microvolt = <1800000>; 82 regulator-max-microvolt = <1800000>; 83 regulator-always-on; 84 vin-supply = <®_vcc33_wifi>; 85 }; 86 87 wifi_pwrseq: wifi-pwrseq { 88 compatible = "mmc-pwrseq-simple"; 89 clocks = <&rtc CLK_OSC32K_FANOUT>; 90 clock-names = "ext_clock"; 91 reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */ 92 post-power-on-delay-ms = <200>; 93 }; 94}; 95 96&cpu0 { 97 cpu-supply = <®_dcdca>; 98}; 99 100&de { 101 status = "okay"; 102}; 103 104&dwc3 { 105 status = "okay"; 106}; 107 108&ehci0 { 109 status = "okay"; 110}; 111 112&ehci3 { 113 status = "okay"; 114}; 115 116&gpu { 117 mali-supply = <®_dcdcc>; 118 status = "okay"; 119}; 120 121&hdmi { 122 status = "okay"; 123}; 124 125&hdmi_out { 126 hdmi_out_con: endpoint { 127 remote-endpoint = <&hdmi_con_in>; 128 }; 129}; 130 131&mmc0 { 132 vmmc-supply = <®_cldo1>; 133 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 134 disable-wp; 135 bus-width = <4>; 136 status = "okay"; 137}; 138 139&mmc1 { 140 vmmc-supply = <®_vcc33_wifi>; 141 vqmmc-supply = <®_vcc_wifi_io>; 142 mmc-pwrseq = <&wifi_pwrseq>; 143 bus-width = <4>; 144 non-removable; 145 status = "okay"; 146 147 brcm: sdio-wifi@1 { 148 reg = <1>; 149 compatible = "brcm,bcm4329-fmac"; 150 interrupt-parent = <&r_pio>; 151 interrupts = <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */ 152 interrupt-names = "host-wake"; 153 }; 154}; 155 156&mmc2 { 157 vmmc-supply = <®_cldo1>; 158 vqmmc-supply = <®_bldo2>; 159 cap-mmc-hw-reset; 160 non-removable; 161 bus-width = <8>; 162 status = "okay"; 163}; 164 165&ohci0 { 166 status = "okay"; 167}; 168 169&ohci3 { 170 status = "okay"; 171}; 172 173&pio { 174 vcc-pc-supply = <®_bldo2>; 175 vcc-pd-supply = <®_cldo1>; 176 vcc-pg-supply = <®_vcc_wifi_io>; 177}; 178 179&r_ir { 180 status = "okay"; 181}; 182 183&r_rsb { 184 status = "okay"; 185 186 axp805: pmic@745 { 187 compatible = "x-powers,axp805", "x-powers,axp806"; 188 reg = <0x745>; 189 interrupt-parent = <&r_intc>; 190 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>; 191 interrupt-controller; 192 #interrupt-cells = <1>; 193 x-powers,self-working-mode; 194 vina-supply = <®_vcc5v>; 195 vinb-supply = <®_vcc5v>; 196 vinc-supply = <®_vcc5v>; 197 vind-supply = <®_vcc5v>; 198 vine-supply = <®_vcc5v>; 199 aldoin-supply = <®_vcc5v>; 200 bldoin-supply = <®_vcc5v>; 201 cldoin-supply = <®_vcc5v>; 202 203 regulators { 204 reg_aldo1: aldo1 { 205 regulator-always-on; 206 regulator-min-microvolt = <3300000>; 207 regulator-max-microvolt = <3300000>; 208 regulator-name = "vcc-pl-led-ir"; 209 }; 210 211 reg_aldo2: aldo2 { 212 regulator-min-microvolt = <3300000>; 213 regulator-max-microvolt = <3300000>; 214 regulator-name = "vcc33-audio-tv-ephy-mac"; 215 }; 216 217 /* ALDO3 is shorted to CLDO1 */ 218 reg_aldo3: aldo3 { 219 regulator-always-on; 220 regulator-min-microvolt = <3300000>; 221 regulator-max-microvolt = <3300000>; 222 regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-1"; 223 }; 224 225 reg_bldo1: bldo1 { 226 regulator-always-on; 227 regulator-min-microvolt = <1800000>; 228 regulator-max-microvolt = <1800000>; 229 regulator-name = "vcc18-dram-bias-pll"; 230 }; 231 232 reg_bldo2: bldo2 { 233 regulator-always-on; 234 regulator-min-microvolt = <1800000>; 235 regulator-max-microvolt = <1800000>; 236 regulator-name = "vcc-efuse-pcie-hdmi-pc"; 237 }; 238 239 bldo3 { 240 /* unused */ 241 }; 242 243 bldo4 { 244 /* unused */ 245 }; 246 247 reg_cldo1: cldo1 { 248 regulator-always-on; 249 regulator-min-microvolt = <3300000>; 250 regulator-max-microvolt = <3300000>; 251 regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2"; 252 }; 253 254 cldo2 { 255 /* unused */ 256 }; 257 258 cldo3 { 259 /* unused */ 260 }; 261 262 reg_dcdca: dcdca { 263 regulator-always-on; 264 regulator-min-microvolt = <800000>; 265 regulator-max-microvolt = <1160000>; 266 regulator-ramp-delay = <2500>; 267 regulator-name = "vdd-cpu"; 268 }; 269 270 reg_dcdcc: dcdcc { 271 regulator-enable-ramp-delay = <32000>; 272 regulator-min-microvolt = <810000>; 273 regulator-max-microvolt = <1080000>; 274 regulator-ramp-delay = <2500>; 275 regulator-name = "vdd-gpu"; 276 }; 277 278 reg_dcdcd: dcdcd { 279 regulator-always-on; 280 regulator-min-microvolt = <960000>; 281 regulator-max-microvolt = <960000>; 282 regulator-name = "vdd-sys"; 283 }; 284 285 reg_dcdce: dcdce { 286 regulator-always-on; 287 regulator-min-microvolt = <1200000>; 288 regulator-max-microvolt = <1200000>; 289 regulator-name = "vcc-dram"; 290 }; 291 292 sw { 293 /* unused */ 294 }; 295 }; 296 }; 297}; 298 299&rtc { 300 clocks = <&ext_osc32k>; 301}; 302 303&uart0 { 304 pinctrl-names = "default"; 305 pinctrl-0 = <&uart0_ph_pins>; 306 status = "okay"; 307}; 308 309/* There's the BT part of the AP6256 connected to that UART */ 310&uart1 { 311 pinctrl-names = "default"; 312 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 313 uart-has-rtscts; 314 status = "okay"; 315 316 bluetooth { 317 compatible = "brcm,bcm4345c5"; 318 clocks = <&rtc CLK_OSC32K_FANOUT>; 319 clock-names = "lpo"; 320 device-wakeup-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ 321 host-wakeup-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ 322 shutdown-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ 323 max-speed = <1500000>; 324 }; 325}; 326 327&usb2otg { 328 /* 329 * This board doesn't have a controllable VBUS even though it 330 * does have an ID pin. Using it as anything but a USB host is 331 * unsafe. 332 */ 333 dr_mode = "host"; 334 status = "okay"; 335}; 336 337&usb2phy { 338 usb0_id_det-gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */ 339 usb0_vbus-supply = <®_vcc5v>; 340 usb3_vbus-supply = <®_vcc5v>; 341 status = "okay"; 342}; 343 344&usb3phy { 345 status = "okay"; 346}; 347