0001 /*
0002 * Copyright 2016 Quentin Schulz
0003 *
0004 * Quentin Schulz <quentin.schulz@free-electrons.com>
0005 *
0006 * This file is dual-licensed: you can use it either under the terms
0007 * of the GPL or the X11 license, at your option. Note that this dual
0008 * licensing only applies to this file, and not this project as a
0009 * whole.
0010 *
0011 * a) This file is free software; you can redistribute it and/or
0012 * modify it under the terms of the GNU General Public License as
0013 * published by the Free Software Foundation; either version 2 of the
0014 * License, or (at your option) any later version.
0015 *
0016 * This file is distributed in the hope that it will be useful,
0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0019 * GNU General Public License for more details.
0020 *
0021 * Or, alternatively,
0022 *
0023 * b) Permission is hereby granted, free of charge, to any person
0024 * obtaining a copy of this software and associated documentation
0025 * files (the "Software"), to deal in the Software without
0026 * restriction, including without limitation the rights to use,
0027 * copy, modify, merge, publish, distribute, sublicense, and/or
0028 * sell copies of the Software, and to permit persons to whom the
0029 * Software is furnished to do so, subject to the following
0030 * conditions:
0031 *
0032 * The above copyright notice and this permission notice shall be
0033 * included in all copies or substantial portions of the Software.
0034 *
0035 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0036 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0037 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0038 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0039 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0040 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0041 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0042 * OTHER DEALINGS IN THE SOFTWARE.
0043 */
0044
0045 /dts-v1/;
0046 #include "sun8i-a33.dtsi"
0047 #include "sunxi-common-regulators.dtsi"
0048
0049 #include <dt-bindings/gpio/gpio.h>
0050 #include <dt-bindings/input/input.h>
0051
0052 / {
0053 model = "Allwinner R16 EVB (Parrot)";
0054 compatible = "allwinner,parrot", "allwinner,sun8i-a33";
0055
0056 aliases {
0057 serial0 = &uart0;
0058 };
0059
0060 chosen {
0061 stdout-path = "serial0:115200n8";
0062 };
0063
0064 leds {
0065 compatible = "gpio-leds";
0066
0067 led-1 {
0068 label = "parrot:led1:usr";
0069 gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
0070 };
0071
0072 led-2 {
0073 label = "parrot:led2:usr";
0074 gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */
0075 };
0076 };
0077
0078 wifi_pwrseq: wifi_pwrseq {
0079 compatible = "mmc-pwrseq-simple";
0080 reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
0081 };
0082
0083 };
0084
0085 &codec {
0086 status = "okay";
0087 };
0088
0089 &dai {
0090 status = "okay";
0091 };
0092
0093 &ehci0 {
0094 status = "okay";
0095 };
0096
0097 &i2c1 {
0098 status = "okay";
0099
0100 /*
0101 * FIXME: An as-yet-unknown accelerometer is connected to this
0102 * i2c bus.
0103 */
0104 };
0105
0106 &lradc {
0107 vref-supply = <®_aldo3>;
0108 status = "okay";
0109
0110 button-190 {
0111 label = "V+";
0112 linux,code = <KEY_VOLUMEUP>;
0113 channel = <0>;
0114 voltage = <190000>;
0115 };
0116
0117 button-390 {
0118 label = "V-";
0119 linux,code = <KEY_VOLUMEDOWN>;
0120 channel = <0>;
0121 voltage = <390000>;
0122 };
0123
0124 };
0125
0126 &mmc0 {
0127 vmmc-supply = <®_dcdc1>;
0128 cd-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
0129 bus-width = <4>;
0130 status = "okay";
0131 };
0132
0133 &mmc1 {
0134 pinctrl-names = "default";
0135 pinctrl-0 = <&mmc1_pg_pins>;
0136 vmmc-supply = <®_aldo1>;
0137 mmc-pwrseq = <&wifi_pwrseq>;
0138 bus-width = <4>;
0139 non-removable;
0140 status = "okay";
0141 };
0142
0143 &mmc2 {
0144 pinctrl-names = "default";
0145 pinctrl-0 = <&mmc2_8bit_pins>;
0146 vmmc-supply = <®_dcdc1>;
0147 bus-width = <8>;
0148 non-removable;
0149 cap-mmc-hw-reset;
0150 status = "okay";
0151 };
0152
0153 &mmc2_8bit_pins {
0154 drive-strength = <40>;
0155 };
0156
0157 &ohci0 {
0158 status = "okay";
0159 };
0160
0161 &r_rsb {
0162 status = "okay";
0163
0164 axp22x: pmic@3a3 {
0165 compatible = "x-powers,axp223";
0166 reg = <0x3a3>;
0167 interrupt-parent = <&r_intc>;
0168 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0169 drivevbus-supply = <®_vcc5v0>;
0170 x-powers,drive-vbus-en;
0171 };
0172 };
0173
0174 #include "axp223.dtsi"
0175
0176 ®_aldo1 {
0177 regulator-always-on;
0178 regulator-min-microvolt = <3000000>;
0179 regulator-max-microvolt = <3000000>;
0180 regulator-name = "vcc-io";
0181 };
0182
0183 ®_aldo2 {
0184 regulator-always-on;
0185 regulator-min-microvolt = <2350000>;
0186 regulator-max-microvolt = <2650000>;
0187 regulator-name = "vdd-dll";
0188 };
0189
0190 ®_aldo3 {
0191 regulator-always-on;
0192 regulator-min-microvolt = <2700000>;
0193 regulator-max-microvolt = <3300000>;
0194 regulator-name = "vcc-pll-avcc";
0195 };
0196
0197 ®_dc5ldo {
0198 regulator-always-on;
0199 regulator-min-microvolt = <900000>;
0200 regulator-max-microvolt = <1400000>;
0201 regulator-name = "vdd-cpus";
0202 };
0203
0204 ®_dcdc1 {
0205 regulator-always-on;
0206 regulator-min-microvolt = <3000000>;
0207 regulator-max-microvolt = <3000000>;
0208 regulator-name = "vcc-3v0";
0209 };
0210
0211 ®_dcdc2 {
0212 regulator-always-on;
0213 regulator-min-microvolt = <900000>;
0214 regulator-max-microvolt = <1400000>;
0215 regulator-name = "vdd-sys";
0216 };
0217
0218 ®_dcdc3 {
0219 regulator-always-on;
0220 regulator-min-microvolt = <900000>;
0221 regulator-max-microvolt = <1400000>;
0222 regulator-name = "vdd-cpu";
0223 };
0224
0225 ®_dcdc5 {
0226 regulator-always-on;
0227 regulator-min-microvolt = <1500000>;
0228 regulator-max-microvolt = <1500000>;
0229 regulator-name = "vcc-dram";
0230 };
0231
0232 ®_dldo1 {
0233 /*
0234 * TODO: WiFi chip needs dldo1 AND dldo2 to be on to be powered.
0235 * Remove next line once it is possible to sync two regulators.
0236 */
0237 regulator-always-on;
0238 regulator-min-microvolt = <3300000>;
0239 regulator-max-microvolt = <3300000>;
0240 regulator-name = "vcc-wifi0";
0241 };
0242
0243 ®_dldo2 {
0244 /*
0245 * TODO: WiFi chip needs dldo1 AND dldo2 to be on to be powered.
0246 * Remove next line once it is possible to sync two regulators.
0247 */
0248 regulator-always-on;
0249 regulator-min-microvolt = <3300000>;
0250 regulator-max-microvolt = <3300000>;
0251 regulator-name = "vcc-wifi1";
0252 };
0253
0254 ®_dldo3 {
0255 regulator-min-microvolt = <3000000>;
0256 regulator-max-microvolt = <3000000>;
0257 regulator-name = "vcc-3v0-csi";
0258 };
0259
0260 ®_drivevbus {
0261 regulator-name = "usb0-vbus";
0262 status = "okay";
0263 };
0264
0265 ®_eldo1 {
0266 regulator-min-microvolt = <1200000>;
0267 regulator-max-microvolt = <1200000>;
0268 regulator-name = "vcc-1v2-hsic";
0269 };
0270
0271 ®_eldo2 {
0272 regulator-min-microvolt = <3000000>;
0273 regulator-max-microvolt = <3000000>;
0274 regulator-name = "vcc-dsp";
0275 };
0276
0277 ®_eldo3 {
0278 regulator-min-microvolt = <3000000>;
0279 regulator-max-microvolt = <3000000>;
0280 regulator-name = "eldo3";
0281 };
0282
0283 ®_usb1_vbus {
0284 gpio = <&pio 3 12 GPIO_ACTIVE_HIGH>; /* PD12 */
0285 status = "okay";
0286 };
0287
0288 &sound {
0289 status = "okay";
0290 };
0291
0292 &uart0 {
0293 pinctrl-names = "default";
0294 pinctrl-0 = <&uart0_pb_pins>;
0295 status = "okay";
0296 };
0297
0298 &usb_otg {
0299 dr_mode = "otg";
0300 status = "okay";
0301 };
0302
0303 &usb_power_supply {
0304 status = "okay";
0305 };
0306
0307 &usbphy {
0308 status = "okay";
0309 usb0_vbus-supply = <®_drivevbus>;
0310 usb0_id_det-gpios = <&pio 3 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PD10 */
0311 usb0_vbus_power-supply = <&usb_power_supply>;
0312 usb1_vbus-supply = <®_usb1_vbus>;
0313 };