| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * Copyright (C) 2017 Jagan Teki <jteki@openedev.com> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This file is dual-licensed: you can use it either under the terms |
|---|
| 5 | | - * of the GPL or the X11 license, at your option. Note that this dual |
|---|
| 6 | | - * licensing only applies to this file, and not this project as a |
|---|
| 7 | | - * whole. |
|---|
| 8 | | - * |
|---|
| 9 | | - * a) This library is free software; you can redistribute it and/or |
|---|
| 10 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 11 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 12 | | - * License, or (at your option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This library is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * Or, alternatively, |
|---|
| 20 | | - * |
|---|
| 21 | | - * b) Permission is hereby granted, free of charge, to any person |
|---|
| 22 | | - * obtaining a copy of this software and associated documentation |
|---|
| 23 | | - * files (the "Software"), to deal in the Software without |
|---|
| 24 | | - * restriction, including without limitation the rights to use, |
|---|
| 25 | | - * copy, modify, merge, publish, distribute, sublicense, and/or |
|---|
| 26 | | - * sell copies of the Software, and to permit persons to whom the |
|---|
| 27 | | - * Software is furnished to do so, subject to the following |
|---|
| 28 | | - * conditions: |
|---|
| 29 | | - * |
|---|
| 30 | | - * The above copyright notice and this permission notice shall be |
|---|
| 31 | | - * included in all copies or substantial portions of the Software. |
|---|
| 32 | | - * |
|---|
| 33 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|---|
| 34 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|---|
| 35 | | - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|---|
| 36 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|---|
| 37 | | - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|---|
| 38 | | - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|---|
| 39 | | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|---|
| 40 | | - * OTHER DEALINGS IN THE SOFTWARE. |
|---|
| 41 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
|---|
| 2 | +// Copyright (C) 2017 Jagan Teki <jteki@openedev.com> |
|---|
| 3 | +// Copyright (C) 2017-2018 Samuel Holland <samuel@sholland.org> |
|---|
| 42 | 4 | |
|---|
| 43 | 5 | /dts-v1/; |
|---|
| 44 | 6 | |
|---|
| 45 | 7 | #include "sun50i-a64.dtsi" |
|---|
| 8 | +#include "sun50i-a64-cpu-opp.dtsi" |
|---|
| 46 | 9 | |
|---|
| 47 | 10 | #include <dt-bindings/gpio/gpio.h> |
|---|
| 48 | 11 | |
|---|
| .. | .. |
|---|
| 51 | 14 | compatible = "xunlong,orangepi-win", "allwinner,sun50i-a64"; |
|---|
| 52 | 15 | |
|---|
| 53 | 16 | aliases { |
|---|
| 17 | + ethernet0 = &emac; |
|---|
| 54 | 18 | serial0 = &uart0; |
|---|
| 19 | + serial1 = &uart1; |
|---|
| 20 | + serial2 = &uart2; |
|---|
| 21 | + serial3 = &uart3; |
|---|
| 22 | + serial4 = &uart4; |
|---|
| 55 | 23 | }; |
|---|
| 56 | 24 | |
|---|
| 57 | 25 | chosen { |
|---|
| 58 | 26 | stdout-path = "serial0:115200n8"; |
|---|
| 59 | 27 | }; |
|---|
| 28 | + |
|---|
| 29 | + hdmi-connector { |
|---|
| 30 | + compatible = "hdmi-connector"; |
|---|
| 31 | + type = "a"; |
|---|
| 32 | + |
|---|
| 33 | + port { |
|---|
| 34 | + hdmi_con_in: endpoint { |
|---|
| 35 | + remote-endpoint = <&hdmi_out_con>; |
|---|
| 36 | + }; |
|---|
| 37 | + }; |
|---|
| 38 | + }; |
|---|
| 39 | + |
|---|
| 40 | + leds { |
|---|
| 41 | + compatible = "gpio-leds"; |
|---|
| 42 | + |
|---|
| 43 | + led-0 { |
|---|
| 44 | + label = "orangepi:green:status"; |
|---|
| 45 | + gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ |
|---|
| 46 | + }; |
|---|
| 47 | + }; |
|---|
| 48 | + |
|---|
| 49 | + reg_gmac_3v3: gmac-3v3 { |
|---|
| 50 | + compatible = "regulator-fixed"; |
|---|
| 51 | + regulator-name = "gmac-3v3"; |
|---|
| 52 | + regulator-min-microvolt = <3300000>; |
|---|
| 53 | + regulator-max-microvolt = <3300000>; |
|---|
| 54 | + regulator-boot-on; |
|---|
| 55 | + enable-active-high; |
|---|
| 56 | + gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */ |
|---|
| 57 | + status = "okay"; |
|---|
| 58 | + }; |
|---|
| 59 | + |
|---|
| 60 | + reg_usb1_vbus: usb1-vbus { |
|---|
| 61 | + compatible = "regulator-fixed"; |
|---|
| 62 | + regulator-name = "usb1-vbus"; |
|---|
| 63 | + regulator-min-microvolt = <5000000>; |
|---|
| 64 | + regulator-max-microvolt = <5000000>; |
|---|
| 65 | + regulator-boot-on; |
|---|
| 66 | + enable-active-high; |
|---|
| 67 | + gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* PD7 */ |
|---|
| 68 | + status = "okay"; |
|---|
| 69 | + }; |
|---|
| 70 | + |
|---|
| 71 | + wifi_pwrseq: wifi_pwrseq { |
|---|
| 72 | + compatible = "mmc-pwrseq-simple"; |
|---|
| 73 | + reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */ |
|---|
| 74 | + clocks = <&rtc 1>; |
|---|
| 75 | + clock-names = "ext_clock"; |
|---|
| 76 | + }; |
|---|
| 77 | +}; |
|---|
| 78 | + |
|---|
| 79 | +&codec { |
|---|
| 80 | + status = "okay"; |
|---|
| 81 | +}; |
|---|
| 82 | + |
|---|
| 83 | +&codec_analog { |
|---|
| 84 | + cpvdd-supply = <®_eldo1>; |
|---|
| 85 | + status = "okay"; |
|---|
| 86 | +}; |
|---|
| 87 | + |
|---|
| 88 | +&cpu0 { |
|---|
| 89 | + cpu-supply = <®_dcdc2>; |
|---|
| 90 | +}; |
|---|
| 91 | + |
|---|
| 92 | +&cpu1 { |
|---|
| 93 | + cpu-supply = <®_dcdc2>; |
|---|
| 94 | +}; |
|---|
| 95 | + |
|---|
| 96 | +&cpu2 { |
|---|
| 97 | + cpu-supply = <®_dcdc2>; |
|---|
| 98 | +}; |
|---|
| 99 | + |
|---|
| 100 | +&cpu3 { |
|---|
| 101 | + cpu-supply = <®_dcdc2>; |
|---|
| 102 | +}; |
|---|
| 103 | + |
|---|
| 104 | +&dai { |
|---|
| 105 | + status = "okay"; |
|---|
| 106 | +}; |
|---|
| 107 | + |
|---|
| 108 | +&de { |
|---|
| 109 | + status = "okay"; |
|---|
| 110 | +}; |
|---|
| 111 | + |
|---|
| 112 | +&ehci0 { |
|---|
| 113 | + status = "okay"; |
|---|
| 60 | 114 | }; |
|---|
| 61 | 115 | |
|---|
| 62 | 116 | &ehci1 { |
|---|
| 63 | 117 | status = "okay"; |
|---|
| 118 | +}; |
|---|
| 119 | + |
|---|
| 120 | +&emac { |
|---|
| 121 | + pinctrl-names = "default"; |
|---|
| 122 | + pinctrl-0 = <&rgmii_pins>; |
|---|
| 123 | + phy-mode = "rgmii-id"; |
|---|
| 124 | + phy-handle = <&ext_rgmii_phy>; |
|---|
| 125 | + phy-supply = <®_gmac_3v3>; |
|---|
| 126 | + status = "okay"; |
|---|
| 127 | +}; |
|---|
| 128 | + |
|---|
| 129 | +&hdmi { |
|---|
| 130 | + hvcc-supply = <®_dldo1>; |
|---|
| 131 | + status = "okay"; |
|---|
| 132 | +}; |
|---|
| 133 | + |
|---|
| 134 | +&hdmi_out { |
|---|
| 135 | + hdmi_out_con: endpoint { |
|---|
| 136 | + remote-endpoint = <&hdmi_con_in>; |
|---|
| 137 | + }; |
|---|
| 138 | +}; |
|---|
| 139 | + |
|---|
| 140 | +&mdio { |
|---|
| 141 | + ext_rgmii_phy: ethernet-phy@1 { |
|---|
| 142 | + compatible = "ethernet-phy-ieee802.3-c22"; |
|---|
| 143 | + reg = <1>; |
|---|
| 144 | + }; |
|---|
| 64 | 145 | }; |
|---|
| 65 | 146 | |
|---|
| 66 | 147 | &mmc0 { |
|---|
| .. | .. |
|---|
| 73 | 154 | status = "okay"; |
|---|
| 74 | 155 | }; |
|---|
| 75 | 156 | |
|---|
| 157 | +&mmc1 { |
|---|
| 158 | + pinctrl-names = "default"; |
|---|
| 159 | + pinctrl-0 = <&mmc1_pins>; |
|---|
| 160 | + vmmc-supply = <®_dldo2>; |
|---|
| 161 | + vqmmc-supply = <®_dldo4>; |
|---|
| 162 | + mmc-pwrseq = <&wifi_pwrseq>; |
|---|
| 163 | + bus-width = <4>; |
|---|
| 164 | + non-removable; |
|---|
| 165 | + status = "okay"; |
|---|
| 166 | + |
|---|
| 167 | + brcmf: wifi@1 { |
|---|
| 168 | + reg = <1>; |
|---|
| 169 | + compatible = "brcm,bcm4329-fmac"; |
|---|
| 170 | + interrupt-parent = <&r_pio>; |
|---|
| 171 | + interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>; /* PL7 */ |
|---|
| 172 | + interrupt-names = "host-wake"; |
|---|
| 173 | + }; |
|---|
| 174 | +}; |
|---|
| 175 | + |
|---|
| 176 | +&ohci0 { |
|---|
| 177 | + status = "okay"; |
|---|
| 178 | +}; |
|---|
| 179 | + |
|---|
| 76 | 180 | &ohci1 { |
|---|
| 181 | + status = "okay"; |
|---|
| 182 | +}; |
|---|
| 183 | + |
|---|
| 184 | +&r_ir { |
|---|
| 77 | 185 | status = "okay"; |
|---|
| 78 | 186 | }; |
|---|
| 79 | 187 | |
|---|
| .. | .. |
|---|
| 85 | 193 | reg = <0x3a3>; |
|---|
| 86 | 194 | interrupt-parent = <&r_intc>; |
|---|
| 87 | 195 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
|---|
| 196 | + x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */ |
|---|
| 88 | 197 | }; |
|---|
| 89 | 198 | }; |
|---|
| 90 | 199 | |
|---|
| 91 | 200 | #include "axp803.dtsi" |
|---|
| 92 | 201 | |
|---|
| 202 | +&ac_power_supply { |
|---|
| 203 | + status = "okay"; |
|---|
| 204 | +}; |
|---|
| 205 | + |
|---|
| 206 | +&battery_power_supply { |
|---|
| 207 | + status = "okay"; |
|---|
| 208 | +}; |
|---|
| 209 | + |
|---|
| 93 | 210 | ®_aldo1 { |
|---|
| 94 | | - regulator-always-on; |
|---|
| 95 | | - regulator-min-microvolt = <1800000>; |
|---|
| 96 | | - regulator-max-microvolt = <3300000>; |
|---|
| 211 | + regulator-min-microvolt = <2800000>; |
|---|
| 212 | + regulator-max-microvolt = <2800000>; |
|---|
| 97 | 213 | regulator-name = "afvcc-csi"; |
|---|
| 98 | 214 | }; |
|---|
| 99 | 215 | |
|---|
| .. | .. |
|---|
| 165 | 281 | regulator-name = "vcc-wifi-io"; |
|---|
| 166 | 282 | }; |
|---|
| 167 | 283 | |
|---|
| 284 | +®_drivevbus { |
|---|
| 285 | + regulator-name = "usb0-vbus"; |
|---|
| 286 | + status = "okay"; |
|---|
| 287 | +}; |
|---|
| 288 | + |
|---|
| 168 | 289 | ®_eldo1 { |
|---|
| 169 | 290 | regulator-min-microvolt = <1800000>; |
|---|
| 170 | 291 | regulator-max-microvolt = <1800000>; |
|---|
| 171 | 292 | regulator-name = "cpvdd"; |
|---|
| 293 | +}; |
|---|
| 294 | + |
|---|
| 295 | +®_eldo3 { |
|---|
| 296 | + regulator-min-microvolt = <1500000>; |
|---|
| 297 | + regulator-max-microvolt = <1800000>; |
|---|
| 298 | + regulator-name = "dvdd-csi"; |
|---|
| 172 | 299 | }; |
|---|
| 173 | 300 | |
|---|
| 174 | 301 | ®_fldo1 { |
|---|
| .. | .. |
|---|
| 197 | 324 | vcc-hdmi-supply = <®_dldo1>; |
|---|
| 198 | 325 | }; |
|---|
| 199 | 326 | |
|---|
| 327 | +&sound { |
|---|
| 328 | + status = "okay"; |
|---|
| 329 | + simple-audio-card,widgets = "Headphone", "Headphone Jack", |
|---|
| 330 | + "Microphone", "Microphone Jack", |
|---|
| 331 | + "Microphone", "Onboard Microphone"; |
|---|
| 332 | + simple-audio-card,routing = |
|---|
| 333 | + "Left DAC", "DACL", |
|---|
| 334 | + "Right DAC", "DACR", |
|---|
| 335 | + "ADCL", "Left ADC", |
|---|
| 336 | + "ADCR", "Right ADC", |
|---|
| 337 | + "Headphone Jack", "HP", |
|---|
| 338 | + "MIC2", "Microphone Jack", |
|---|
| 339 | + "Onboard Microphone", "MBIAS", |
|---|
| 340 | + "MIC1", "Onboard Microphone"; |
|---|
| 341 | +}; |
|---|
| 342 | + |
|---|
| 343 | +&spi0 { |
|---|
| 344 | + status = "okay"; |
|---|
| 345 | + |
|---|
| 346 | + spi-flash@0 { |
|---|
| 347 | + compatible = "mxicy,mx25l1606e", "jedec,spi-nor"; |
|---|
| 348 | + reg = <0>; |
|---|
| 349 | + spi-max-frequency = <80000000>; |
|---|
| 350 | + m25p,fast-read; |
|---|
| 351 | + status = "okay"; |
|---|
| 352 | + }; |
|---|
| 353 | +}; |
|---|
| 354 | + |
|---|
| 355 | +/* On debug connector */ |
|---|
| 200 | 356 | &uart0 { |
|---|
| 201 | 357 | pinctrl-names = "default"; |
|---|
| 202 | | - pinctrl-0 = <&uart0_pins_a>; |
|---|
| 358 | + pinctrl-0 = <&uart0_pb_pins>; |
|---|
| 359 | + status = "okay"; |
|---|
| 360 | +}; |
|---|
| 361 | + |
|---|
| 362 | +/* Bluetooth */ |
|---|
| 363 | +&uart1 { |
|---|
| 364 | + pinctrl-names = "default"; |
|---|
| 365 | + pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; |
|---|
| 366 | + uart-has-rtscts; |
|---|
| 367 | + status = "okay"; |
|---|
| 368 | + |
|---|
| 369 | + bluetooth { |
|---|
| 370 | + compatible = "brcm,bcm43438-bt"; |
|---|
| 371 | + max-speed = <1500000>; |
|---|
| 372 | + clocks = <&rtc 1>; |
|---|
| 373 | + clock-names = "lpo"; |
|---|
| 374 | + vbat-supply = <®_dldo2>; |
|---|
| 375 | + vddio-supply = <®_dldo4>; |
|---|
| 376 | + device-wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ |
|---|
| 377 | + host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ |
|---|
| 378 | + shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ |
|---|
| 379 | + }; |
|---|
| 380 | +}; |
|---|
| 381 | + |
|---|
| 382 | +/* On Pi-2 connector, RTS/CTS optional */ |
|---|
| 383 | +&uart2 { |
|---|
| 384 | + pinctrl-names = "default"; |
|---|
| 385 | + pinctrl-0 = <&uart2_pins>; |
|---|
| 386 | + status = "disabled"; |
|---|
| 387 | +}; |
|---|
| 388 | + |
|---|
| 389 | +/* On Pi-2 connector, RTS/CTS optional */ |
|---|
| 390 | +&uart3 { |
|---|
| 391 | + pinctrl-names = "default"; |
|---|
| 392 | + pinctrl-0 = <&uart3_pins>; |
|---|
| 393 | + status = "disabled"; |
|---|
| 394 | +}; |
|---|
| 395 | + |
|---|
| 396 | +/* On Pi-2 connector (labeled for SPI1), RTS/CTS optional */ |
|---|
| 397 | +&uart4 { |
|---|
| 398 | + pinctrl-names = "default"; |
|---|
| 399 | + pinctrl-0 = <&uart4_pins>; |
|---|
| 400 | + status = "disabled"; |
|---|
| 401 | +}; |
|---|
| 402 | + |
|---|
| 403 | +&usb_otg { |
|---|
| 404 | + dr_mode = "otg"; |
|---|
| 203 | 405 | status = "okay"; |
|---|
| 204 | 406 | }; |
|---|
| 205 | 407 | |
|---|
| 206 | 408 | &usbphy { |
|---|
| 409 | + usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ |
|---|
| 410 | + usb0_vbus-supply = <®_drivevbus>; |
|---|
| 411 | + usb1_vbus-supply = <®_usb1_vbus>; |
|---|
| 207 | 412 | status = "okay"; |
|---|
| 208 | 413 | }; |
|---|
| 209 | | - |
|---|