0001 /*
0002 * Copyright 2013 Oliver Schinagl
0003 *
0004 * Oliver Schinagl <oliver@schinagl.nl>
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 "sun7i-a20.dtsi"
0047 #include "sunxi-common-regulators.dtsi"
0048
0049 #include <dt-bindings/gpio/gpio.h>
0050 #include <dt-bindings/interrupt-controller/irq.h>
0051
0052 / {
0053 model = "Cubietech Cubietruck";
0054 compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
0055
0056 aliases {
0057 serial0 = &uart0;
0058 };
0059
0060 chosen {
0061 stdout-path = "serial0:115200n8";
0062 };
0063
0064 hdmi-connector {
0065 compatible = "hdmi-connector";
0066 type = "a";
0067
0068 port {
0069 hdmi_con_in: endpoint {
0070 remote-endpoint = <&hdmi_out_con>;
0071 };
0072 };
0073 };
0074
0075 leds {
0076 compatible = "gpio-leds";
0077
0078 led-0 {
0079 label = "cubietruck:blue:usr";
0080 gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
0081 };
0082
0083 led-1 {
0084 label = "cubietruck:orange:usr";
0085 gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
0086 };
0087
0088 led-2 {
0089 label = "cubietruck:white:usr";
0090 gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>;
0091 };
0092
0093 led-3 {
0094 label = "cubietruck:green:usr";
0095 gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;
0096 };
0097 };
0098
0099 mmc3_pwrseq: mmc3_pwrseq {
0100 compatible = "mmc-pwrseq-simple";
0101 reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
0102 clocks = <&ccu CLK_OUT_A>;
0103 clock-names = "ext_clock";
0104 };
0105
0106 sound {
0107 compatible = "simple-audio-card";
0108 simple-audio-card,name = "On-board SPDIF";
0109
0110 simple-audio-card,cpu {
0111 sound-dai = <&spdif>;
0112 };
0113
0114 simple-audio-card,codec {
0115 sound-dai = <&spdif_out>;
0116 };
0117 };
0118
0119 spdif_out: spdif-out {
0120 #sound-dai-cells = <0>;
0121 compatible = "linux,spdif-dit";
0122 };
0123 };
0124
0125 &ahci {
0126 target-supply = <®_ahci_5v>;
0127 status = "okay";
0128 };
0129
0130 &codec {
0131 status = "okay";
0132 };
0133
0134 &cpu0 {
0135 cpu-supply = <®_dcdc2>;
0136 };
0137
0138 &de {
0139 status = "okay";
0140 };
0141
0142 &ehci0 {
0143 status = "okay";
0144 };
0145
0146 &ehci1 {
0147 status = "okay";
0148 };
0149
0150 &gmac {
0151 pinctrl-names = "default";
0152 pinctrl-0 = <&gmac_rgmii_pins>;
0153 phy-handle = <&phy1>;
0154 phy-mode = "rgmii-id";
0155 status = "okay";
0156 };
0157
0158 &hdmi {
0159 status = "okay";
0160 };
0161
0162 &hdmi_out {
0163 hdmi_out_con: endpoint {
0164 remote-endpoint = <&hdmi_con_in>;
0165 };
0166 };
0167
0168 &i2c0 {
0169 status = "okay";
0170
0171 axp209: pmic@34 {
0172 reg = <0x34>;
0173 interrupt-parent = <&nmi_intc>;
0174 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0175 };
0176 };
0177
0178 &i2c1 {
0179 pinctrl-names = "default";
0180 status = "okay";
0181 };
0182
0183 &i2c2 {
0184 status = "okay";
0185 };
0186
0187 &ir0 {
0188 pinctrl-names = "default";
0189 pinctrl-0 = <&ir0_rx_pin>;
0190 status = "okay";
0191 };
0192
0193 &gmac_mdio {
0194 phy1: ethernet-phy@1 {
0195 reg = <1>;
0196 };
0197 };
0198
0199 &mmc0 {
0200 vmmc-supply = <®_vcc3v3>;
0201 bus-width = <4>;
0202 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
0203 status = "okay";
0204 };
0205
0206 &mmc3 {
0207 vmmc-supply = <®_vcc3v3>;
0208 mmc-pwrseq = <&mmc3_pwrseq>;
0209 bus-width = <4>;
0210 non-removable;
0211 status = "okay";
0212
0213 brcmf: wifi@1 {
0214 reg = <1>;
0215 compatible = "brcm,bcm4329-fmac";
0216 interrupt-parent = <&pio>;
0217 interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
0218 interrupt-names = "host-wake";
0219 };
0220 };
0221
0222 &ohci0 {
0223 status = "okay";
0224 };
0225
0226 &ohci1 {
0227 status = "okay";
0228 };
0229
0230 &otg_sram {
0231 status = "okay";
0232 };
0233
0234 &pio {
0235 /* Pin outputs low power clock for WiFi and BT */
0236 pinctrl-0 = <&clk_out_a_pin>;
0237 pinctrl-names = "default";
0238 };
0239
0240 &pwm {
0241 pinctrl-names = "default";
0242 pinctrl-0 = <&pwm0_pin>, <&pwm1_pin>;
0243 status = "okay";
0244 };
0245
0246 ®_ahci_5v {
0247 gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
0248 status = "okay";
0249 };
0250
0251 #include "axp209.dtsi"
0252
0253 &ac_power_supply {
0254 status = "okay";
0255 };
0256
0257 &battery_power_supply {
0258 status = "okay";
0259 };
0260
0261 ®_dcdc2 {
0262 regulator-always-on;
0263 regulator-min-microvolt = <1000000>;
0264 regulator-max-microvolt = <1450000>;
0265 regulator-name = "vdd-cpu";
0266 };
0267
0268 ®_dcdc3 {
0269 regulator-always-on;
0270 regulator-min-microvolt = <1000000>;
0271 regulator-max-microvolt = <1400000>;
0272 regulator-name = "vdd-int-dll";
0273 };
0274
0275 ®_ldo1 {
0276 regulator-name = "vdd-rtc";
0277 };
0278
0279 ®_ldo2 {
0280 regulator-always-on;
0281 regulator-min-microvolt = <3000000>;
0282 regulator-max-microvolt = <3000000>;
0283 regulator-name = "avcc";
0284 };
0285
0286 ®_usb0_vbus {
0287 gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
0288 status = "okay";
0289 };
0290
0291 ®_usb1_vbus {
0292 status = "okay";
0293 };
0294
0295 ®_usb2_vbus {
0296 status = "okay";
0297 };
0298
0299 &spdif {
0300 pinctrl-names = "default";
0301 pinctrl-0 = <&spdif_tx_pin>;
0302 status = "okay";
0303 };
0304
0305 &uart0 {
0306 pinctrl-names = "default";
0307 pinctrl-0 = <&uart0_pb_pins>;
0308 status = "okay";
0309 };
0310
0311 &uart2 {
0312 pinctrl-names = "default";
0313 pinctrl-0 = <&uart2_pi_pins>, <&uart2_cts_rts_pi_pins>;
0314 uart-has-rtscts;
0315 status = "okay";
0316
0317 bluetooth {
0318 compatible = "brcm,bcm20702a1";
0319 clocks = <&ccu CLK_OUT_A>;
0320 clock-names = "lpo";
0321 device-wakeup-gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
0322 host-wakeup-gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
0323 shutdown-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
0324 max-speed = <1500000>;
0325 };
0326 };
0327
0328 &usb_otg {
0329 dr_mode = "otg";
0330 status = "okay";
0331 };
0332
0333 &usb_power_supply {
0334 status = "okay";
0335 };
0336
0337 &usbphy {
0338 usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
0339 usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
0340 usb0_vbus_power-supply = <&usb_power_supply>;
0341 usb0_vbus-supply = <®_usb0_vbus>;
0342 usb1_vbus-supply = <®_usb1_vbus>;
0343 usb2_vbus-supply = <®_usb2_vbus>;
0344 status = "okay";
0345 };