0001 /*
0002 * Copyright 2015 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 "sun8i-a83t.dtsi"
0047
0048 #include <dt-bindings/gpio/gpio.h>
0049
0050 / {
0051 model = "Cubietech Cubietruck Plus";
0052 compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
0053
0054 aliases {
0055 ethernet0 = &emac;
0056 serial0 = &uart0;
0057 };
0058
0059 chosen {
0060 stdout-path = "serial0:115200n8";
0061 };
0062
0063 hdmi-connector {
0064 compatible = "hdmi-connector";
0065 type = "a";
0066
0067 port {
0068 hdmi_con_in: endpoint {
0069 remote-endpoint = <&hdmi_out_con>;
0070 };
0071 };
0072 };
0073
0074 leds {
0075 compatible = "gpio-leds";
0076
0077 led-0 {
0078 label = "cubietruck-plus:blue:usr";
0079 gpios = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */
0080 };
0081
0082 led-1 {
0083 label = "cubietruck-plus:orange:usr";
0084 gpios = <&pio 3 26 GPIO_ACTIVE_HIGH>; /* PD26 */
0085 };
0086
0087 led-2 {
0088 label = "cubietruck-plus:white:usr";
0089 gpios = <&pio 3 27 GPIO_ACTIVE_HIGH>; /* PD27 */
0090 };
0091
0092 led-3 {
0093 label = "cubietruck-plus:green:usr";
0094 gpios = <&pio 4 4 GPIO_ACTIVE_HIGH>; /* PE4 */
0095 };
0096 };
0097
0098 usb-hub {
0099 /* I2C is not connected */
0100 compatible = "smsc,usb3503";
0101 initial-mode = <1>; /* initialize in HUB mode */
0102 disabled-ports = <1>;
0103 intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
0104 reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
0105 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
0106 refclk-frequency = <19200000>;
0107 };
0108
0109 reg_usb1_vbus: reg-usb1-vbus {
0110 compatible = "regulator-fixed";
0111 regulator-name = "usb1-vbus";
0112 regulator-min-microvolt = <5000000>;
0113 regulator-max-microvolt = <5000000>;
0114 regulator-boot-on;
0115 enable-active-high;
0116 gpio = <&pio 3 29 GPIO_ACTIVE_HIGH>; /* PD29 */
0117 };
0118
0119 reg_usb2_vbus: reg-usb2-vbus {
0120 compatible = "regulator-fixed";
0121 regulator-name = "usb2-vbus";
0122 regulator-min-microvolt = <5000000>;
0123 regulator-max-microvolt = <5000000>;
0124 regulator-boot-on;
0125 enable-active-high;
0126 gpio = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0127 };
0128
0129 sound {
0130 compatible = "simple-audio-card";
0131 simple-audio-card,name = "On-board SPDIF";
0132
0133 simple-audio-card,cpu {
0134 sound-dai = <&spdif>;
0135 };
0136
0137 simple-audio-card,codec {
0138 sound-dai = <&spdif_out>;
0139 };
0140 };
0141
0142 spdif_out: spdif-out {
0143 #sound-dai-cells = <0>;
0144 compatible = "linux,spdif-dit";
0145 };
0146
0147 wifi_pwrseq: wifi_pwrseq {
0148 compatible = "mmc-pwrseq-simple";
0149 clocks = <&ac100_rtc 1>;
0150 clock-names = "ext_clock";
0151 /* The WiFi low power clock must be 32768 Hz */
0152 assigned-clocks = <&ac100_rtc 1>;
0153 assigned-clock-rates = <32768>;
0154 /* enables internal regulator and de-asserts reset */
0155 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
0156 };
0157 };
0158
0159 &cpu0 {
0160 cpu-supply = <®_dcdc2>;
0161 };
0162
0163 &cpu100 {
0164 cpu-supply = <®_dcdc3>;
0165 };
0166
0167 &de {
0168 status = "okay";
0169 };
0170
0171 &ehci0 {
0172 /* GL830 USB-to-SATA bridge here */
0173 status = "okay";
0174 };
0175
0176 &ehci1 {
0177 /* USB3503 HSIC USB 2.0 hub here */
0178 status = "okay";
0179 };
0180
0181 &emac {
0182 pinctrl-names = "default";
0183 pinctrl-0 = <&emac_rgmii_pins>;
0184 phy-supply = <®_dldo4>;
0185 phy-handle = <&rgmii_phy>;
0186 phy-mode = "rgmii-id";
0187 status = "okay";
0188 };
0189
0190 &hdmi {
0191 status = "okay";
0192 };
0193
0194 &hdmi_out {
0195 hdmi_out_con: endpoint {
0196 remote-endpoint = <&hdmi_con_in>;
0197 };
0198 };
0199
0200 &mdio {
0201 rgmii_phy: ethernet-phy@1 {
0202 compatible = "ethernet-phy-ieee802.3-c22";
0203 reg = <1>;
0204 };
0205 };
0206
0207 &mmc0 {
0208 pinctrl-names = "default";
0209 pinctrl-0 = <&mmc0_pins>;
0210 vmmc-supply = <®_dcdc1>;
0211 bus-width = <4>;
0212 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0213 status = "okay";
0214 };
0215
0216 &mmc1 {
0217 vmmc-supply = <®_dcdc1>;
0218 vqmmc-supply = <®_sw>;
0219 mmc-pwrseq = <&wifi_pwrseq>;
0220 bus-width = <4>;
0221 non-removable;
0222 status = "okay";
0223 };
0224
0225 &mmc2 {
0226 pinctrl-names = "default";
0227 pinctrl-0 = <&mmc2_8bit_emmc_pins>;
0228 vmmc-supply = <®_dcdc1>;
0229 bus-width = <8>;
0230 non-removable;
0231 cap-mmc-hw-reset;
0232 status = "okay";
0233 };
0234
0235 &r_rsb {
0236 status = "okay";
0237
0238 axp81x: pmic@3a3 {
0239 compatible = "x-powers,axp818", "x-powers,axp813";
0240 reg = <0x3a3>;
0241 interrupt-parent = <&r_intc>;
0242 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0243 eldoin-supply = <®_dcdc1>;
0244 swin-supply = <®_dcdc1>;
0245 x-powers,drive-vbus-en;
0246 };
0247
0248 ac100: codec@e89 {
0249 compatible = "x-powers,ac100";
0250 reg = <0xe89>;
0251
0252 ac100_codec: codec {
0253 compatible = "x-powers,ac100-codec";
0254 interrupt-parent = <&r_pio>;
0255 interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
0256 #clock-cells = <0>;
0257 clock-output-names = "4M_adda";
0258 };
0259
0260 ac100_rtc: rtc {
0261 compatible = "x-powers,ac100-rtc";
0262 interrupt-parent = <&r_intc>;
0263 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0264 clocks = <&ac100_codec>;
0265 #clock-cells = <1>;
0266 clock-output-names = "cko1_rtc",
0267 "cko2_rtc",
0268 "cko3_rtc";
0269 };
0270 };
0271 };
0272
0273 #include "axp81x.dtsi"
0274
0275 &ac_power_supply {
0276 status = "okay";
0277 };
0278
0279 &battery_power_supply {
0280 status = "okay";
0281 };
0282
0283 ®_aldo1 {
0284 regulator-always-on;
0285 regulator-min-microvolt = <1800000>;
0286 regulator-max-microvolt = <1800000>;
0287 regulator-name = "vcc-1v8";
0288 };
0289
0290 ®_aldo2 {
0291 regulator-always-on;
0292 regulator-min-microvolt = <1800000>;
0293 regulator-max-microvolt = <1800000>;
0294 regulator-name = "dram-pll";
0295 };
0296
0297 ®_aldo3 {
0298 regulator-always-on;
0299 regulator-min-microvolt = <3000000>;
0300 regulator-max-microvolt = <3000000>;
0301 regulator-name = "avcc";
0302 };
0303
0304 ®_dcdc1 {
0305 /*
0306 * The schematics say this should be 3.3V, but the FEX file says
0307 * it should be 3V. The latter makes sense, as the WiFi module's
0308 * I/O is indirectly powered from DCDC1, through SW. It is rated
0309 * at 2.98V maximum.
0310 */
0311 regulator-always-on;
0312 regulator-min-microvolt = <3000000>;
0313 regulator-max-microvolt = <3000000>;
0314 regulator-name = "vcc-3v";
0315 };
0316
0317 ®_dcdc2 {
0318 regulator-always-on;
0319 regulator-min-microvolt = <700000>;
0320 regulator-max-microvolt = <1100000>;
0321 regulator-name = "vdd-cpua";
0322 };
0323
0324 ®_dcdc3 {
0325 regulator-always-on;
0326 regulator-min-microvolt = <700000>;
0327 regulator-max-microvolt = <1100000>;
0328 regulator-name = "vdd-cpub";
0329 };
0330
0331 ®_dcdc4 {
0332 regulator-min-microvolt = <700000>;
0333 regulator-max-microvolt = <1100000>;
0334 regulator-name = "vdd-gpu";
0335 };
0336
0337 ®_dcdc5 {
0338 regulator-always-on;
0339 regulator-min-microvolt = <1500000>;
0340 regulator-max-microvolt = <1500000>;
0341 regulator-name = "vcc-dram";
0342 };
0343
0344 ®_dcdc6 {
0345 regulator-always-on;
0346 regulator-min-microvolt = <900000>;
0347 regulator-max-microvolt = <900000>;
0348 regulator-name = "vdd-sys";
0349 };
0350
0351 ®_dldo2 {
0352 regulator-min-microvolt = <3300000>;
0353 regulator-max-microvolt = <3300000>;
0354 regulator-name = "dp-pwr";
0355 };
0356
0357 ®_dldo3 {
0358 regulator-always-on;
0359 regulator-min-microvolt = <2500000>;
0360 regulator-max-microvolt = <2500000>;
0361 regulator-name = "ephy-io";
0362 };
0363
0364 ®_dldo4 {
0365 /*
0366 * The PHY requires 20ms after all voltages are applied until core
0367 * logic is ready and 30ms after the reset pin is de-asserted.
0368 * Set a 100ms delay to account for PMIC ramp time and board traces.
0369 */
0370 regulator-enable-ramp-delay = <100000>;
0371 regulator-min-microvolt = <3300000>;
0372 regulator-max-microvolt = <3300000>;
0373 regulator-name = "ephy";
0374 };
0375
0376 ®_drivevbus {
0377 regulator-name = "usb0-vbus";
0378 status = "okay";
0379 };
0380
0381 ®_eldo1 {
0382 regulator-min-microvolt = <1200000>;
0383 regulator-max-microvolt = <1200000>;
0384 regulator-name = "dp-bridge-1";
0385 };
0386
0387 ®_eldo2 {
0388 regulator-min-microvolt = <1200000>;
0389 regulator-max-microvolt = <1200000>;
0390 regulator-name = "dp-bridge-2";
0391 };
0392
0393 ®_fldo1 {
0394 /* TODO should be handled by USB PHY */
0395 regulator-always-on;
0396 regulator-min-microvolt = <1080000>;
0397 regulator-max-microvolt = <1320000>;
0398 regulator-name = "vdd12-hsic";
0399 };
0400
0401 ®_fldo2 {
0402 /*
0403 * Despite the embedded CPUs core not being used in any way,
0404 * this must remain on or the system will hang.
0405 */
0406 regulator-always-on;
0407 regulator-min-microvolt = <700000>;
0408 regulator-max-microvolt = <1100000>;
0409 regulator-name = "vdd-cpus";
0410 };
0411
0412 ®_rtc_ldo {
0413 regulator-name = "vcc-rtc";
0414 };
0415
0416 ®_sw {
0417 regulator-name = "vcc-wifi-io";
0418 };
0419
0420 &spdif {
0421 status = "okay";
0422 };
0423
0424 &uart0 {
0425 pinctrl-names = "default";
0426 pinctrl-0 = <&uart0_pb_pins>;
0427 status = "okay";
0428 };
0429
0430 &uart1 {
0431 pinctrl-names = "default";
0432 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
0433 uart-has-rtscts;
0434 status = "okay";
0435
0436 bluetooth {
0437 compatible = "brcm,bcm4330-bt";
0438 clocks = <&ac100_rtc 1>;
0439 clock-names = "lpo";
0440 vbat-supply = <®_dcdc1>;
0441 vddio-supply = <®_sw>;
0442 device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
0443 host-wakeup-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
0444 shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
0445 };
0446 };
0447
0448 &usb_otg {
0449 dr_mode = "otg";
0450 status = "okay";
0451 };
0452
0453 &usb_power_supply {
0454 status = "okay";
0455 };
0456
0457 &usbphy {
0458 usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
0459 usb0_vbus_power-supply = <&usb_power_supply>;
0460 usb0_vbus-supply = <®_drivevbus>;
0461 usb1_vbus-supply = <®_usb1_vbus>;
0462 usb2_vbus-supply = <®_usb2_vbus>;
0463 status = "okay";
0464 };