Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2014 Chen-Yu Tsai
0003  *
0004  * Chen-Yu Tsai <wens@csie.org>
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 "sun9i-a80.dtsi"
0047 
0048 #include <dt-bindings/gpio/gpio.h>
0049 
0050 / {
0051         model = "Merrii A80 Optimus Board";
0052         compatible = "merrii,a80-optimus", "allwinner,sun9i-a80";
0053 
0054         aliases {
0055                 serial0 = &uart0;
0056                 serial1 = &uart4;
0057         };
0058 
0059         chosen {
0060                 stdout-path = "serial0:115200n8";
0061         };
0062 
0063         leds {
0064                 compatible = "gpio-leds";
0065 
0066                 /* The LED names match those found on the board */
0067                 led2 {
0068                         label = "optimus:led2:usr";
0069                         gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
0070                 };
0071 
0072                 led3 {
0073                         label = "optimus:led3:usr";
0074                         gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */
0075                 };
0076 
0077                 led4 {
0078                         label = "optimus:led4:usr";
0079                         gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>;
0080                 };
0081         };
0082 
0083         reg_usb1_vbus: usb1-vbus {
0084                 compatible = "regulator-fixed";
0085                 regulator-name = "usb1-vbus";
0086                 regulator-min-microvolt = <5000000>;
0087                 regulator-max-microvolt = <5000000>;
0088                 enable-active-high;
0089                 gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
0090         };
0091 
0092         reg_usb3_vbus: usb3-vbus {
0093                 compatible = "regulator-fixed";
0094                 regulator-name = "usb3-vbus";
0095                 regulator-min-microvolt = <5000000>;
0096                 regulator-max-microvolt = <5000000>;
0097                 enable-active-high;
0098                 gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
0099         };
0100 
0101         wifi_pwrseq: wifi-pwrseq {
0102                 compatible = "mmc-pwrseq-simple";
0103                 clocks = <&ac100_rtc 1>;
0104                 clock-names = "ext_clock";
0105                 /* enables internal regulator and de-asserts reset */
0106                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
0107         };
0108 };
0109 
0110 &ehci0 {
0111         status = "okay";
0112 };
0113 
0114 &ehci1 {
0115         /* Enable if HSIC peripheral is connected */
0116         status = "disabled";
0117 };
0118 
0119 &ehci2 {
0120         status = "okay";
0121 };
0122 
0123 &gmac {
0124         pinctrl-names = "default";
0125         pinctrl-0 = <&gmac_rgmii_pins>;
0126         phy-handle = <&phy1>;
0127         phy-mode = "rgmii-id";
0128         phy-supply = <&reg_cldo1>;
0129         status = "okay";
0130 };
0131 
0132 &mdio {
0133         phy1: ethernet-phy@1 {
0134                 reg = <1>;
0135         };
0136 };
0137 
0138 &mmc0 {
0139         pinctrl-names = "default";
0140         pinctrl-0 = <&mmc0_pins>;
0141         vmmc-supply = <&reg_dcdc1>;
0142         bus-width = <4>;
0143         cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH8 */
0144         status = "okay";
0145 };
0146 
0147 &mmc1 {
0148         pinctrl-names = "default";
0149         pinctrl-0 = <&mmc1_pins>;
0150         vmmc-supply = <&reg_dldo1>;
0151         vqmmc-supply = <&reg_cldo3>;
0152         mmc-pwrseq = <&wifi_pwrseq>;
0153         bus-width = <4>;
0154         non-removable;
0155         status = "okay";
0156 };
0157 
0158 &mmc1_pins {
0159         bias-pull-up;
0160 };
0161 
0162 &mmc2 {
0163         pinctrl-names = "default";
0164         pinctrl-0 = <&mmc2_8bit_pins>;
0165         vmmc-supply = <&reg_dcdc1>;
0166         bus-width = <8>;
0167         non-removable;
0168         cap-mmc-hw-reset;
0169         status = "okay";
0170 };
0171 
0172 &mmc2_8bit_pins {
0173         /* Increase drive strength for DDR modes */
0174         drive-strength = <40>;
0175 };
0176 
0177 &ohci0 {
0178         status = "okay";
0179 };
0180 
0181 &ohci2 {
0182         status = "okay";
0183 };
0184 
0185 &osc32k {
0186         /* osc32k input is from AC100 */
0187         clocks = <&ac100_rtc 0>;
0188 };
0189 
0190 &pio {
0191         vcc-pa-supply = <&reg_ldo_io1>;
0192         vcc-pb-supply = <&reg_aldo2>;
0193         vcc-pc-supply = <&reg_dcdc1>;
0194         vcc-pd-supply = <&reg_dcdc1>;
0195         vcc-pe-supply = <&reg_eldo2>;
0196         vcc-pf-supply = <&reg_dcdc1>;
0197         vcc-pg-supply = <&reg_ldo_io0>;
0198         vcc-ph-supply = <&reg_dcdc1>;
0199 };
0200 
0201 &r_ir {
0202         status = "okay";
0203 };
0204 
0205 &r_pio {
0206         vcc-pl-supply = <&reg_dldo2>;
0207         vcc-pm-supply = <&reg_eldo3>;
0208 };
0209 
0210 &r_rsb {
0211         status = "okay";
0212 
0213         axp809: pmic@3a3 {
0214                 reg = <0x3a3>;
0215                 interrupt-parent = <&nmi_intc>;
0216                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0217 
0218                 regulators {
0219                         reg_aldo1: aldo1 {
0220                                 /*
0221                                  * TODO: This should be handled by the
0222                                  * USB PHY driver.
0223                                  */
0224                                 regulator-always-on;
0225                                 regulator-min-microvolt = <3000000>;
0226                                 regulator-max-microvolt = <3000000>;
0227                                 regulator-name = "vcc33-usbh";
0228                         };
0229 
0230                         reg_aldo2: aldo2 {
0231                                 regulator-min-microvolt = <1800000>;
0232                                 regulator-max-microvolt = <1800000>;
0233                                 regulator-name = "vcc-pb-io-cam";
0234                         };
0235 
0236                         aldo3 {
0237                                 /* unused */
0238                         };
0239 
0240                         reg_dc5ldo: dc5ldo {
0241                                 regulator-always-on;
0242                                 regulator-min-microvolt = <800000>;
0243                                 regulator-max-microvolt = <1100000>;
0244                                 regulator-name = "vdd-cpus-09-usbh";
0245                         };
0246 
0247                         dc1sw {
0248                                 /* unused */
0249                         };
0250 
0251                         reg_dcdc1: dcdc1 {
0252                                 regulator-always-on;
0253                                 regulator-min-microvolt = <3000000>;
0254                                 regulator-max-microvolt = <3000000>;
0255                                 regulator-name = "vcc-3v";
0256                         };
0257 
0258                         reg_dcdc2: dcdc2 {
0259                                 regulator-min-microvolt = <800000>;
0260                                 regulator-max-microvolt = <1100000>;
0261                                 regulator-name = "vdd-gpu";
0262                         };
0263 
0264                         reg_dcdc3: dcdc3 {
0265                                 regulator-always-on;
0266                                 regulator-min-microvolt = <800000>;
0267                                 regulator-max-microvolt = <1100000>;
0268                                 regulator-name = "vdd-cpua";
0269                         };
0270 
0271                         reg_dcdc4: dcdc4 {
0272                                 regulator-always-on;
0273                                 regulator-min-microvolt = <800000>;
0274                                 regulator-max-microvolt = <1100000>;
0275                                 regulator-name = "vdd-sys-usb0-hdmi";
0276                         };
0277 
0278                         reg_dcdc5: dcdc5 {
0279                                 regulator-always-on;
0280                                 regulator-min-microvolt = <1425000>;
0281                                 regulator-max-microvolt = <1575000>;
0282                                 regulator-name = "vcc-dram";
0283                         };
0284 
0285                         reg_dldo1: dldo1 {
0286                                 /*
0287                                  * The WiFi chip supports a wide range
0288                                  * (3.0 ~ 4.8V) of voltages, and so does
0289                                  * this regulator (3.0 ~ 4.2V), but
0290                                  * Allwinner SDK always sets it to 3.3V.
0291                                  */
0292                                 regulator-min-microvolt = <3300000>;
0293                                 regulator-max-microvolt = <3300000>;
0294                                 regulator-name = "vcc-wifi";
0295                         };
0296 
0297                         reg_dldo2: dldo2 {
0298                                 regulator-min-microvolt = <3000000>;
0299                                 regulator-max-microvolt = <3000000>;
0300                                 regulator-name = "vcc-pl";
0301                         };
0302 
0303                         reg_eldo1: eldo1 {
0304                                 regulator-min-microvolt = <1200000>;
0305                                 regulator-max-microvolt = <1200000>;
0306                                 regulator-name = "vcc-dvdd-cam";
0307                         };
0308 
0309                         reg_eldo2: eldo2 {
0310                                 regulator-min-microvolt = <1800000>;
0311                                 regulator-max-microvolt = <1800000>;
0312                                 regulator-name = "vcc-pe";
0313                         };
0314 
0315                         reg_eldo3: eldo3 {
0316                                 regulator-min-microvolt = <3000000>;
0317                                 regulator-max-microvolt = <3000000>;
0318                                 regulator-name = "vcc-pm-codec-io1";
0319                         };
0320 
0321                         reg_ldo_io0: ldo_io0 {
0322                                 regulator-min-microvolt = <3000000>;
0323                                 regulator-max-microvolt = <3000000>;
0324                                 regulator-name = "vcc-pg";
0325                         };
0326 
0327                         reg_ldo_io1: ldo_io1 {
0328                                 regulator-min-microvolt = <2500000>;
0329                                 regulator-max-microvolt = <2500000>;
0330                                 regulator-name = "vcc-pa-gmac-2v5";
0331                         };
0332 
0333                         reg_rtc_ldo: rtc_ldo {
0334                                 regulator-name = "vcc-rtc-vdd1v8-io";
0335                         };
0336 
0337                         sw {
0338                                 /* unused */
0339                         };
0340                 };
0341         };
0342 
0343         axp806: pmic@745 {
0344                 compatible = "x-powers,axp806";
0345                 reg = <0x745>;
0346                 interrupt-parent = <&nmi_intc>;
0347                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0348                 interrupt-controller;
0349                 #interrupt-cells = <1>;
0350                 bldoin-supply = <&reg_dcdce>;
0351 
0352                 regulators {
0353                         reg_s_aldo1: aldo1 {
0354                                 regulator-always-on;
0355                                 regulator-min-microvolt = <3000000>;
0356                                 regulator-max-microvolt = <3000000>;
0357                                 regulator-name = "avcc";
0358                         };
0359 
0360                         aldo2 {
0361                                 /*
0362                                  * unused, but use a different name to
0363                                  * avoid name clash with axp809's aldo's
0364                                  */
0365                                 regulator-name = "s_aldo2";
0366                         };
0367 
0368                         aldo3 {
0369                                 /*
0370                                  * unused, but use a different name to
0371                                  * avoid name clash with axp809's aldo's
0372                                  */
0373                                 regulator-name = "s_aldo3";
0374                         };
0375 
0376                         reg_bldo1: bldo1 {
0377                                 regulator-always-on;
0378                                 regulator-min-microvolt = <1700000>;
0379                                 regulator-max-microvolt = <1900000>;
0380                                 regulator-name = "vcc18-efuse-adc-display-csi";
0381                         };
0382 
0383                         reg_bldo2: bldo2 {
0384                                 regulator-always-on;
0385                                 regulator-min-microvolt = <1700000>;
0386                                 regulator-max-microvolt = <1900000>;
0387                                 regulator-name =
0388                                         "vdd18-drampll-vcc18-pll-cpvdd";
0389                         };
0390 
0391                         bldo3 {
0392                                 /* unused */
0393                         };
0394 
0395                         reg_bldo4: bldo4 {
0396                                 regulator-min-microvolt = <1100000>;
0397                                 regulator-max-microvolt = <1300000>;
0398                                 regulator-name = "vcc12-hsic";
0399                         };
0400 
0401                         reg_cldo1: cldo1 {
0402                                 /*
0403                                  * This was 3V in the original design, but
0404                                  * 3.3V is the recommended supply voltage
0405                                  * for the Ethernet PHY.
0406                                  */
0407                                 regulator-min-microvolt = <3300000>;
0408                                 regulator-max-microvolt = <3300000>;
0409                                 /*
0410                                  * The PHY requires 20ms after all voltages
0411                                  * are applied until core logic is ready and
0412                                  * 30ms after the reset pin is de-asserted.
0413                                  * Set a 100ms delay to account for PMIC
0414                                  * ramp time and board traces.
0415                                  */
0416                                 regulator-enable-ramp-delay = <100000>;
0417                                 regulator-name = "vcc-gmac-phy";
0418                         };
0419 
0420                         reg_cldo2: cldo2 {
0421                                 regulator-min-microvolt = <2800000>;
0422                                 regulator-max-microvolt = <2800000>;
0423                                 regulator-name = "afvcc-cam";
0424                         };
0425 
0426                         reg_cldo3: cldo3 {
0427                                 regulator-min-microvolt = <3000000>;
0428                                 regulator-max-microvolt = <3000000>;
0429                                 regulator-name = "vcc-io-wifi-codec-io2";
0430                         };
0431 
0432                         reg_dcdca: dcdca {
0433                                 regulator-always-on;
0434                                 regulator-min-microvolt = <800000>;
0435                                 regulator-max-microvolt = <1100000>;
0436                                 regulator-name = "vdd-cpub";
0437                         };
0438 
0439                         reg_dcdcd: dcdcd {
0440                                 regulator-always-on;
0441                                 regulator-min-microvolt = <800000>;
0442                                 regulator-max-microvolt = <1100000>;
0443                                 regulator-name = "vdd-vpu";
0444                         };
0445 
0446                         reg_dcdce: dcdce {
0447                                 regulator-always-on;
0448                                 regulator-min-microvolt = <2100000>;
0449                                 regulator-max-microvolt = <2100000>;
0450                                 regulator-name = "vcc-bldo-codec-ldoin";
0451                         };
0452 
0453                         sw {
0454                                 /*
0455                                  * unused, but use a different name to
0456                                  * avoid name clash with axp809's sw
0457                                  */
0458                                 regulator-name = "s_sw";
0459                         };
0460                 };
0461         };
0462 
0463         ac100: codec@e89 {
0464                 compatible = "x-powers,ac100";
0465                 reg = <0xe89>;
0466 
0467                 ac100_codec: codec {
0468                         compatible = "x-powers,ac100-codec";
0469                         interrupt-parent = <&r_pio>;
0470                         interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
0471                         #clock-cells = <0>;
0472                         clock-output-names = "4M_adda";
0473                 };
0474 
0475                 ac100_rtc: rtc {
0476                         compatible = "x-powers,ac100-rtc";
0477                         interrupt-parent = <&nmi_intc>;
0478                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0479                         clocks = <&ac100_codec>;
0480                         #clock-cells = <1>;
0481                         clock-output-names = "cko1_rtc",
0482                                              "cko2_rtc",
0483                                              "cko3_rtc";
0484                 };
0485         };
0486 };
0487 
0488 #include "axp809.dtsi"
0489 
0490 &uart0 {
0491         pinctrl-names = "default";
0492         pinctrl-0 = <&uart0_ph_pins>;
0493         status = "okay";
0494 };
0495 
0496 &usbphy1 {
0497         phy-supply = <&reg_usb1_vbus>;
0498         status = "okay";
0499 };
0500 
0501 &usbphy2 {
0502         phy-supply = <&reg_bldo4>;
0503         /* Enable if HSIC peripheral is connected */
0504         status = "disabled";
0505 };
0506 
0507 &usbphy3 {
0508         phy-supply = <&reg_usb3_vbus>;
0509         status = "okay";
0510 };