0001 /*
0002 * Copyright 2015 Tyler Baker
0003 *
0004 * Tyler Baker <tyler.baker@linaro.org>
0005 * Chen-Yu Tsai <wens@csie.org>
0006 *
0007 * This file is dual-licensed: you can use it either under the terms
0008 * of the GPL or the X11 license, at your option. Note that this dual
0009 * licensing only applies to this file, and not this project as a
0010 * whole.
0011 *
0012 * a) This file is free software; you can redistribute it and/or
0013 * modify it under the terms of the GNU General Public License as
0014 * published by the Free Software Foundation; either version 2 of the
0015 * License, or (at your option) any later version.
0016 *
0017 * This file is distributed in the hope that it will be useful,
0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020 * GNU General Public License for more details.
0021 *
0022 * Or, alternatively,
0023 *
0024 * b) Permission is hereby granted, free of charge, to any person
0025 * obtaining a copy of this software and associated documentation
0026 * files (the "Software"), to deal in the Software without
0027 * restriction, including without limitation the rights to use,
0028 * copy, modify, merge, publish, distribute, sublicense, and/or
0029 * sell copies of the Software, and to permit persons to whom the
0030 * Software is furnished to do so, subject to the following
0031 * conditions:
0032 *
0033 * The above copyright notice and this permission notice shall be
0034 * included in all copies or substantial portions of the Software.
0035 *
0036 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0037 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0038 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0039 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0040 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0041 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0042 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0043 * OTHER DEALINGS IN THE SOFTWARE.
0044 */
0045
0046 /dts-v1/;
0047 #include "sun9i-a80.dtsi"
0048
0049 #include <dt-bindings/gpio/gpio.h>
0050
0051 / {
0052 model = "Cubietech Cubieboard4";
0053 compatible = "cubietech,a80-cubieboard4", "allwinner,sun9i-a80";
0054
0055 aliases {
0056 serial0 = &uart0;
0057 };
0058
0059 chosen {
0060 stdout-path = "serial0:115200n8";
0061 };
0062
0063 leds {
0064 compatible = "gpio-leds";
0065
0066 led-0 {
0067 label = "cubieboard4:green:usr";
0068 gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
0069 };
0070
0071 led-1 {
0072 label = "cubieboard4:red:usr";
0073 gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
0074 };
0075 };
0076
0077 vga-connector {
0078 compatible = "vga-connector";
0079 label = "vga";
0080 ddc-i2c-bus = <&i2c3>;
0081
0082 port {
0083 vga_con_in: endpoint {
0084 remote-endpoint = <&vga_dac_out>;
0085 };
0086 };
0087 };
0088
0089 vga-dac {
0090 compatible = "corpro,gm7123", "adi,adv7123";
0091 vdd-supply = <®_dcdc1>;
0092
0093 ports {
0094 #address-cells = <1>;
0095 #size-cells = <0>;
0096
0097 port@0 {
0098 reg = <0>;
0099
0100 vga_dac_in: endpoint {
0101 remote-endpoint = <&tcon0_out_vga>;
0102 };
0103 };
0104
0105 port@1 {
0106 reg = <1>;
0107
0108 vga_dac_out: endpoint {
0109 remote-endpoint = <&vga_con_in>;
0110 };
0111 };
0112 };
0113 };
0114
0115 wifi_pwrseq: wifi-pwrseq {
0116 compatible = "mmc-pwrseq-simple";
0117 clocks = <&ac100_rtc 1>;
0118 clock-names = "ext_clock";
0119 /* enables internal regulator and de-asserts reset */
0120 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
0121 };
0122 };
0123
0124 &de {
0125 status = "okay";
0126 };
0127
0128 &gmac {
0129 pinctrl-names = "default";
0130 pinctrl-0 = <&gmac_rgmii_pins>;
0131 phy-handle = <&phy1>;
0132 phy-mode = "rgmii-id";
0133 phy-supply = <®_cldo1>;
0134 status = "okay";
0135 };
0136
0137 &i2c3 {
0138 pinctrl-names = "default";
0139 pinctrl-0 = <&i2c3_pins>;
0140 status = "okay";
0141 };
0142
0143 &mdio {
0144 phy1: ethernet-phy@1 {
0145 reg = <1>;
0146 };
0147 };
0148
0149 &mmc0 {
0150 pinctrl-names = "default";
0151 pinctrl-0 = <&mmc0_pins>;
0152 vmmc-supply = <®_dcdc1>;
0153 bus-width = <4>;
0154 cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH18 */
0155 status = "okay";
0156 };
0157
0158 &mmc1 {
0159 pinctrl-names = "default";
0160 pinctrl-0 = <&mmc1_pins>;
0161 vmmc-supply = <®_dldo1>;
0162 vqmmc-supply = <®_cldo3>;
0163 mmc-pwrseq = <&wifi_pwrseq>;
0164 bus-width = <4>;
0165 non-removable;
0166 status = "okay";
0167 };
0168
0169 &mmc1_pins {
0170 bias-pull-up;
0171 };
0172
0173 &mmc2 {
0174 pinctrl-names = "default";
0175 pinctrl-0 = <&mmc2_8bit_pins>;
0176 vmmc-supply = <®_dcdc1>;
0177 bus-width = <8>;
0178 non-removable;
0179 cap-mmc-hw-reset;
0180 status = "okay";
0181 };
0182
0183 &mmc2_8bit_pins {
0184 /* Increase drive strength for DDR modes */
0185 drive-strength = <40>;
0186 };
0187
0188 &osc32k {
0189 /* osc32k input is from AC100 */
0190 clocks = <&ac100_rtc 0>;
0191 };
0192
0193 &pio {
0194 vcc-pa-supply = <®_ldo_io1>;
0195 vcc-pb-supply = <®_aldo2>;
0196 vcc-pc-supply = <®_dcdc1>;
0197 vcc-pd-supply = <®_dc1sw>;
0198 vcc-pe-supply = <®_eldo2>;
0199 vcc-pf-supply = <®_dcdc1>;
0200 vcc-pg-supply = <®_ldo_io0>;
0201 vcc-ph-supply = <®_dcdc1>;
0202 };
0203
0204 &r_ir {
0205 status = "okay";
0206 };
0207
0208 &r_pio {
0209 vcc-pl-supply = <®_dldo2>;
0210 vcc-pm-supply = <®_eldo3>;
0211 };
0212
0213 &r_rsb {
0214 status = "okay";
0215
0216 axp809: pmic@3a3 {
0217 reg = <0x3a3>;
0218 interrupt-parent = <&nmi_intc>;
0219 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0220
0221 regulators {
0222 reg_aldo1: aldo1 {
0223 /*
0224 * TODO: This should be handled by the
0225 * USB PHY driver.
0226 */
0227 regulator-always-on;
0228 regulator-min-microvolt = <3000000>;
0229 regulator-max-microvolt = <3000000>;
0230 regulator-name = "vcc33-usbh";
0231 };
0232
0233 reg_aldo2: aldo2 {
0234 regulator-min-microvolt = <1800000>;
0235 regulator-max-microvolt = <1800000>;
0236 regulator-name = "vcc-pb-io-cam";
0237 };
0238
0239 aldo3 {
0240 /* unused */
0241 };
0242
0243 reg_dc1sw: dc1sw {
0244 regulator-name = "vcc-pd";
0245 };
0246
0247 reg_dc5ldo: dc5ldo {
0248 regulator-always-on;
0249 regulator-min-microvolt = <800000>;
0250 regulator-max-microvolt = <1100000>;
0251 regulator-name = "vdd-cpus-09-usbh";
0252 };
0253
0254 reg_dcdc1: dcdc1 {
0255 regulator-always-on;
0256 regulator-min-microvolt = <3000000>;
0257 regulator-max-microvolt = <3000000>;
0258 regulator-name = "vcc-3v";
0259 };
0260
0261 reg_dcdc2: dcdc2 {
0262 regulator-min-microvolt = <800000>;
0263 regulator-max-microvolt = <1100000>;
0264 regulator-name = "vdd-gpu";
0265 };
0266
0267 reg_dcdc3: dcdc3 {
0268 regulator-always-on;
0269 regulator-min-microvolt = <800000>;
0270 regulator-max-microvolt = <1100000>;
0271 regulator-name = "vdd-cpua";
0272 };
0273
0274 reg_dcdc4: dcdc4 {
0275 regulator-always-on;
0276 regulator-min-microvolt = <800000>;
0277 regulator-max-microvolt = <1100000>;
0278 regulator-name = "vdd-sys-usb0-hdmi";
0279 };
0280
0281 reg_dcdc5: dcdc5 {
0282 regulator-always-on;
0283 regulator-min-microvolt = <1425000>;
0284 regulator-max-microvolt = <1575000>;
0285 regulator-name = "vcc-dram";
0286 };
0287
0288 reg_dldo1: dldo1 {
0289 /*
0290 * The WiFi chip supports a wide range
0291 * (3.0 ~ 4.8V) of voltages, and so does
0292 * this regulator (3.0 ~ 4.2V), but
0293 * Allwinner SDK always sets it to 3.3V.
0294 */
0295 regulator-min-microvolt = <3300000>;
0296 regulator-max-microvolt = <3300000>;
0297 regulator-name = "vcc-wifi";
0298 };
0299
0300 reg_dldo2: dldo2 {
0301 regulator-min-microvolt = <3000000>;
0302 regulator-max-microvolt = <3000000>;
0303 regulator-name = "vcc-pl";
0304 };
0305
0306 reg_eldo1: eldo1 {
0307 regulator-min-microvolt = <1200000>;
0308 regulator-max-microvolt = <1200000>;
0309 regulator-name = "vcc-dvdd-cam";
0310 };
0311
0312 reg_eldo2: eldo2 {
0313 regulator-min-microvolt = <1800000>;
0314 regulator-max-microvolt = <1800000>;
0315 regulator-name = "vcc-pe";
0316 };
0317
0318 reg_eldo3: eldo3 {
0319 regulator-min-microvolt = <3000000>;
0320 regulator-max-microvolt = <3000000>;
0321 regulator-name = "vcc-pm-codec-io1";
0322 };
0323
0324 reg_ldo_io0: ldo_io0 {
0325 regulator-min-microvolt = <3000000>;
0326 regulator-max-microvolt = <3000000>;
0327 regulator-name = "vcc-pg";
0328 };
0329
0330 reg_ldo_io1: ldo_io1 {
0331 regulator-min-microvolt = <2500000>;
0332 regulator-max-microvolt = <2500000>;
0333 regulator-name = "vcc-pa-gmac-2v5";
0334 };
0335
0336 reg_rtc_ldo: rtc_ldo {
0337 regulator-name = "vcc-rtc-vdd1v8-io";
0338 };
0339
0340 sw {
0341 /* unused */
0342 };
0343 };
0344 };
0345
0346 axp806: pmic@745 {
0347 compatible = "x-powers,axp806";
0348 reg = <0x745>;
0349 interrupt-parent = <&nmi_intc>;
0350 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0351 interrupt-controller;
0352 #interrupt-cells = <1>;
0353 bldoin-supply = <®_dcdce>;
0354
0355 regulators {
0356 reg_s_aldo1: aldo1 {
0357 regulator-always-on;
0358 regulator-min-microvolt = <3000000>;
0359 regulator-max-microvolt = <3000000>;
0360 regulator-name = "avcc";
0361 };
0362
0363 aldo2 {
0364 /*
0365 * unused, but use a different name to
0366 * avoid name clash with axp809's aldo's
0367 */
0368 regulator-name = "s_aldo2";
0369 };
0370
0371 aldo3 {
0372 /*
0373 * unused, but use a different name to
0374 * avoid name clash with axp809's aldo's
0375 */
0376 regulator-name = "s_aldo3";
0377 };
0378
0379 reg_bldo1: bldo1 {
0380 regulator-always-on;
0381 regulator-min-microvolt = <1700000>;
0382 regulator-max-microvolt = <1900000>;
0383 regulator-name = "vcc18-efuse-adc-display-csi";
0384 };
0385
0386 reg_bldo2: bldo2 {
0387 regulator-always-on;
0388 regulator-min-microvolt = <1700000>;
0389 regulator-max-microvolt = <1900000>;
0390 regulator-name =
0391 "vdd18-drampll-vcc18-pll-cpvdd";
0392 };
0393
0394 bldo3 {
0395 /* unused */
0396 };
0397
0398 reg_bldo4: bldo4 {
0399 regulator-min-microvolt = <1100000>;
0400 regulator-max-microvolt = <1300000>;
0401 regulator-name = "vcc12-hsic";
0402 };
0403
0404 reg_cldo1: cldo1 {
0405 /*
0406 * This was 3V in the original design, but
0407 * 3.3V is the recommended supply voltage
0408 * for the Ethernet PHY.
0409 */
0410 regulator-min-microvolt = <3300000>;
0411 regulator-max-microvolt = <3300000>;
0412 /*
0413 * The PHY requires 20ms after all voltages
0414 * are applied until core logic is ready and
0415 * 30ms after the reset pin is de-asserted.
0416 * Set a 100ms delay to account for PMIC
0417 * ramp time and board traces.
0418 */
0419 regulator-enable-ramp-delay = <100000>;
0420 regulator-name = "vcc-gmac-phy";
0421 };
0422
0423 reg_cldo2: cldo2 {
0424 regulator-min-microvolt = <2800000>;
0425 regulator-max-microvolt = <2800000>;
0426 regulator-name = "afvcc-cam";
0427 };
0428
0429 reg_cldo3: cldo3 {
0430 regulator-min-microvolt = <3000000>;
0431 regulator-max-microvolt = <3000000>;
0432 regulator-name = "vcc-io-wifi-codec-io2";
0433 };
0434
0435 reg_dcdca: dcdca {
0436 regulator-always-on;
0437 regulator-min-microvolt = <800000>;
0438 regulator-max-microvolt = <1100000>;
0439 regulator-name = "vdd-cpub";
0440 };
0441
0442 reg_dcdcd: dcdcd {
0443 regulator-always-on;
0444 regulator-min-microvolt = <800000>;
0445 regulator-max-microvolt = <1100000>;
0446 regulator-name = "vdd-vpu";
0447 };
0448
0449 reg_dcdce: dcdce {
0450 regulator-always-on;
0451 regulator-min-microvolt = <2100000>;
0452 regulator-max-microvolt = <2100000>;
0453 regulator-name = "vcc-bldo-codec-ldoin";
0454 };
0455
0456 sw {
0457 /*
0458 * unused, but use a different name to
0459 * avoid name clash with axp809's sw
0460 */
0461 regulator-name = "s_sw";
0462 };
0463 };
0464 };
0465
0466 ac100: codec@e89 {
0467 compatible = "x-powers,ac100";
0468 reg = <0xe89>;
0469
0470 ac100_codec: codec {
0471 compatible = "x-powers,ac100-codec";
0472 interrupt-parent = <&r_pio>;
0473 interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
0474 #clock-cells = <0>;
0475 clock-output-names = "4M_adda";
0476 };
0477
0478 ac100_rtc: rtc {
0479 compatible = "x-powers,ac100-rtc";
0480 interrupt-parent = <&nmi_intc>;
0481 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0482 clocks = <&ac100_codec>;
0483 #clock-cells = <1>;
0484 clock-output-names = "cko1_rtc",
0485 "cko2_rtc",
0486 "cko3_rtc";
0487 };
0488 };
0489 };
0490
0491 #include "axp809.dtsi"
0492
0493 &tcon0 {
0494 pinctrl-names = "default";
0495 pinctrl-0 = <&lcd0_rgb888_pins>;
0496 };
0497
0498 &tcon0_out {
0499 tcon0_out_vga: endpoint {
0500 remote-endpoint = <&vga_dac_in>;
0501 };
0502 };
0503
0504 &uart0 {
0505 pinctrl-names = "default";
0506 pinctrl-0 = <&uart0_ph_pins>;
0507 status = "okay";
0508 };