| .. | .. |
|---|
| 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> |
|---|
| 42 | 3 | |
|---|
| 43 | 4 | /dts-v1/; |
|---|
| 44 | 5 | |
|---|
| 45 | 6 | #include "sun50i-a64.dtsi" |
|---|
| 7 | +#include "sun50i-a64-cpu-opp.dtsi" |
|---|
| 46 | 8 | |
|---|
| 47 | 9 | #include <dt-bindings/gpio/gpio.h> |
|---|
| 48 | 10 | |
|---|
| .. | .. |
|---|
| 51 | 13 | compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64"; |
|---|
| 52 | 14 | |
|---|
| 53 | 15 | aliases { |
|---|
| 16 | + ethernet0 = &emac; |
|---|
| 54 | 17 | serial0 = &uart0; |
|---|
| 55 | 18 | }; |
|---|
| 56 | 19 | |
|---|
| .. | .. |
|---|
| 58 | 21 | stdout-path = "serial0:115200n8"; |
|---|
| 59 | 22 | }; |
|---|
| 60 | 23 | |
|---|
| 24 | + hdmi-connector { |
|---|
| 25 | + compatible = "hdmi-connector"; |
|---|
| 26 | + type = "a"; |
|---|
| 27 | + |
|---|
| 28 | + port { |
|---|
| 29 | + hdmi_con_in: endpoint { |
|---|
| 30 | + remote-endpoint = <&hdmi_out_con>; |
|---|
| 31 | + }; |
|---|
| 32 | + }; |
|---|
| 33 | + }; |
|---|
| 34 | + |
|---|
| 35 | + leds { |
|---|
| 36 | + compatible = "gpio-leds"; |
|---|
| 37 | + |
|---|
| 38 | + led-0 { |
|---|
| 39 | + label = "a64-olinuxino:red:user"; |
|---|
| 40 | + gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ |
|---|
| 41 | + }; |
|---|
| 42 | + }; |
|---|
| 43 | + |
|---|
| 44 | + reg_usb1_vbus: usb1-vbus { |
|---|
| 45 | + compatible = "regulator-fixed"; |
|---|
| 46 | + regulator-name = "usb1-vbus"; |
|---|
| 47 | + regulator-min-microvolt = <5000000>; |
|---|
| 48 | + regulator-max-microvolt = <5000000>; |
|---|
| 49 | + regulator-boot-on; |
|---|
| 50 | + enable-active-high; |
|---|
| 51 | + gpio = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 */ |
|---|
| 52 | + status = "okay"; |
|---|
| 53 | + }; |
|---|
| 54 | + |
|---|
| 61 | 55 | wifi_pwrseq: wifi_pwrseq { |
|---|
| 62 | 56 | compatible = "mmc-pwrseq-simple"; |
|---|
| 63 | 57 | reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ |
|---|
| 58 | + }; |
|---|
| 59 | +}; |
|---|
| 60 | + |
|---|
| 61 | +&cpu0 { |
|---|
| 62 | + cpu-supply = <®_dcdc2>; |
|---|
| 63 | +}; |
|---|
| 64 | + |
|---|
| 65 | +&cpu1 { |
|---|
| 66 | + cpu-supply = <®_dcdc2>; |
|---|
| 67 | +}; |
|---|
| 68 | + |
|---|
| 69 | +&cpu2 { |
|---|
| 70 | + cpu-supply = <®_dcdc2>; |
|---|
| 71 | +}; |
|---|
| 72 | + |
|---|
| 73 | +&cpu3 { |
|---|
| 74 | + cpu-supply = <®_dcdc2>; |
|---|
| 75 | +}; |
|---|
| 76 | + |
|---|
| 77 | +&de { |
|---|
| 78 | + status = "okay"; |
|---|
| 79 | +}; |
|---|
| 80 | + |
|---|
| 81 | +&ehci0 { |
|---|
| 82 | + status = "okay"; |
|---|
| 83 | +}; |
|---|
| 84 | + |
|---|
| 85 | +&ehci1 { |
|---|
| 86 | + status = "okay"; |
|---|
| 87 | +}; |
|---|
| 88 | + |
|---|
| 89 | +&emac { |
|---|
| 90 | + pinctrl-names = "default"; |
|---|
| 91 | + pinctrl-0 = <&rgmii_pins>; |
|---|
| 92 | + phy-mode = "rgmii"; |
|---|
| 93 | + phy-handle = <&ext_rgmii_phy>; |
|---|
| 94 | + phy-supply = <®_dcdc1>; |
|---|
| 95 | + allwinner,tx-delay-ps = <600>; |
|---|
| 96 | + status = "okay"; |
|---|
| 97 | +}; |
|---|
| 98 | + |
|---|
| 99 | +&hdmi { |
|---|
| 100 | + hvcc-supply = <®_dldo1>; |
|---|
| 101 | + status = "okay"; |
|---|
| 102 | +}; |
|---|
| 103 | + |
|---|
| 104 | +&hdmi_out { |
|---|
| 105 | + hdmi_out_con: endpoint { |
|---|
| 106 | + remote-endpoint = <&hdmi_con_in>; |
|---|
| 107 | + }; |
|---|
| 108 | +}; |
|---|
| 109 | + |
|---|
| 110 | +&mdio { |
|---|
| 111 | + ext_rgmii_phy: ethernet-phy@1 { |
|---|
| 112 | + compatible = "ethernet-phy-ieee802.3-c22"; |
|---|
| 113 | + reg = <1>; |
|---|
| 64 | 114 | }; |
|---|
| 65 | 115 | }; |
|---|
| 66 | 116 | |
|---|
| .. | .. |
|---|
| 92 | 142 | }; |
|---|
| 93 | 143 | }; |
|---|
| 94 | 144 | |
|---|
| 145 | +&ohci0 { |
|---|
| 146 | + status = "okay"; |
|---|
| 147 | +}; |
|---|
| 148 | + |
|---|
| 149 | +&ohci1 { |
|---|
| 150 | + status = "okay"; |
|---|
| 151 | +}; |
|---|
| 152 | + |
|---|
| 153 | +&pio { |
|---|
| 154 | + vcc-pc-supply = <®_dcdc1>; |
|---|
| 155 | + vcc-pd-supply = <®_dcdc1>; |
|---|
| 156 | + vcc-pe-supply = <®_aldo1>; |
|---|
| 157 | + vcc-pg-supply = <®_dldo4>; |
|---|
| 158 | +}; |
|---|
| 159 | + |
|---|
| 160 | +&r_pio { |
|---|
| 161 | + /* |
|---|
| 162 | + * FIXME: We can't add that supply for now since it would |
|---|
| 163 | + * create a circular dependency between pinctrl, the regulator |
|---|
| 164 | + * and the RSB Bus. |
|---|
| 165 | + * |
|---|
| 166 | + * vcc-pl-supply = <®_aldo2>; |
|---|
| 167 | + */ |
|---|
| 168 | +}; |
|---|
| 169 | + |
|---|
| 170 | +&pio { |
|---|
| 171 | + vcc-pa-supply = <®_dcdc1>; |
|---|
| 172 | + vcc-pb-supply = <®_dcdc1>; |
|---|
| 173 | + vcc-pc-supply = <®_dcdc1>; |
|---|
| 174 | + vcc-pd-supply = <®_dcdc1>; |
|---|
| 175 | + vcc-pe-supply = <®_aldo1>; |
|---|
| 176 | + vcc-pf-supply = <®_dcdc1>; |
|---|
| 177 | + vcc-pg-supply = <®_dldo4>; |
|---|
| 178 | + vcc-ph-supply = <®_dcdc1>; |
|---|
| 179 | +}; |
|---|
| 180 | + |
|---|
| 95 | 181 | &r_rsb { |
|---|
| 96 | 182 | status = "okay"; |
|---|
| 97 | 183 | |
|---|
| .. | .. |
|---|
| 100 | 186 | reg = <0x3a3>; |
|---|
| 101 | 187 | interrupt-parent = <&r_intc>; |
|---|
| 102 | 188 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
|---|
| 189 | + x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */ |
|---|
| 103 | 190 | }; |
|---|
| 104 | 191 | }; |
|---|
| 105 | 192 | |
|---|
| 193 | +/* VCC-PL is powered by aldo2 but we cannot add it as the RSB */ |
|---|
| 194 | +/* interface used to talk to the PMIC in on the PL pins */ |
|---|
| 195 | +/* &r_pio { */ |
|---|
| 196 | +/* vcc-pl-supply = <®_aldo2>; */ |
|---|
| 197 | +/* }; */ |
|---|
| 198 | + |
|---|
| 106 | 199 | #include "axp803.dtsi" |
|---|
| 200 | + |
|---|
| 201 | +&ac_power_supply { |
|---|
| 202 | + status = "okay"; |
|---|
| 203 | +}; |
|---|
| 204 | + |
|---|
| 205 | +&battery_power_supply { |
|---|
| 206 | + status = "okay"; |
|---|
| 207 | +}; |
|---|
| 107 | 208 | |
|---|
| 108 | 209 | ®_aldo1 { |
|---|
| 109 | 210 | regulator-always-on; |
|---|
| .. | .. |
|---|
| 184 | 285 | regulator-name = "vcc-wifi-io"; |
|---|
| 185 | 286 | }; |
|---|
| 186 | 287 | |
|---|
| 288 | +®_drivevbus { |
|---|
| 289 | + regulator-name = "usb0-vbus"; |
|---|
| 290 | + status = "okay"; |
|---|
| 291 | +}; |
|---|
| 292 | + |
|---|
| 187 | 293 | ®_eldo1 { |
|---|
| 188 | 294 | regulator-min-microvolt = <1800000>; |
|---|
| 189 | 295 | regulator-max-microvolt = <1800000>; |
|---|
| .. | .. |
|---|
| 224 | 330 | |
|---|
| 225 | 331 | &uart0 { |
|---|
| 226 | 332 | pinctrl-names = "default"; |
|---|
| 227 | | - pinctrl-0 = <&uart0_pins_a>; |
|---|
| 333 | + pinctrl-0 = <&uart0_pb_pins>; |
|---|
| 228 | 334 | status = "okay"; |
|---|
| 229 | 335 | }; |
|---|
| 336 | + |
|---|
| 337 | +&usb_otg { |
|---|
| 338 | + dr_mode = "otg"; |
|---|
| 339 | + status = "okay"; |
|---|
| 340 | +}; |
|---|
| 341 | + |
|---|
| 342 | +&usbphy { |
|---|
| 343 | + status = "okay"; |
|---|
| 344 | + usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ |
|---|
| 345 | + usb0_vbus-supply = <®_drivevbus>; |
|---|
| 346 | + usb1_vbus-supply = <®_usb1_vbus>; |
|---|
| 347 | +}; |
|---|