1*53ab4af3SHans de Goede/* 2*53ab4af3SHans de Goede * Copyright 2013 Oliver Schinagl 3*53ab4af3SHans de Goede * 4*53ab4af3SHans de Goede * Oliver Schinagl <oliver@schinagl.nl> 5*53ab4af3SHans de Goede * 6*53ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms 7*53ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual 8*53ab4af3SHans de Goede * licensing only applies to this file, and not this project as a 9*53ab4af3SHans de Goede * whole. 10*53ab4af3SHans de Goede * 11*53ab4af3SHans de Goede * a) This file is free software; you can redistribute it and/or 12*53ab4af3SHans de Goede * modify it under the terms of the GNU General Public License as 13*53ab4af3SHans de Goede * published by the Free Software Foundation; either version 2 of the 14*53ab4af3SHans de Goede * License, or (at your option) any later version. 15*53ab4af3SHans de Goede * 16*53ab4af3SHans de Goede * This file is distributed in the hope that it will be useful, 17*53ab4af3SHans de Goede * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*53ab4af3SHans de Goede * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19*53ab4af3SHans de Goede * GNU General Public License for more details. 20*53ab4af3SHans de Goede * 21*53ab4af3SHans de Goede * You should have received a copy of the GNU General Public 22*53ab4af3SHans de Goede * License along with this file; if not, write to the Free 23*53ab4af3SHans de Goede * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 24*53ab4af3SHans de Goede * MA 02110-1301 USA 25*53ab4af3SHans de Goede * 26*53ab4af3SHans de Goede * Or, alternatively, 27*53ab4af3SHans de Goede * 28*53ab4af3SHans de Goede * b) Permission is hereby granted, free of charge, to any person 29*53ab4af3SHans de Goede * obtaining a copy of this software and associated documentation 30*53ab4af3SHans de Goede * files (the "Software"), to deal in the Software without 31*53ab4af3SHans de Goede * restriction, including without limitation the rights to use, 32*53ab4af3SHans de Goede * copy, modify, merge, publish, distribute, sublicense, and/or 33*53ab4af3SHans de Goede * sell copies of the Software, and to permit persons to whom the 34*53ab4af3SHans de Goede * Software is furnished to do so, subject to the following 35*53ab4af3SHans de Goede * conditions: 36*53ab4af3SHans de Goede * 37*53ab4af3SHans de Goede * The above copyright notice and this permission notice shall be 38*53ab4af3SHans de Goede * included in all copies or substantial portions of the Software. 39*53ab4af3SHans de Goede * 40*53ab4af3SHans de Goede * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 41*53ab4af3SHans de Goede * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 42*53ab4af3SHans de Goede * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 43*53ab4af3SHans de Goede * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 44*53ab4af3SHans de Goede * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 45*53ab4af3SHans de Goede * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 46*53ab4af3SHans de Goede * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 47*53ab4af3SHans de Goede * OTHER DEALINGS IN THE SOFTWARE. 48*53ab4af3SHans de Goede */ 49*53ab4af3SHans de Goede 50*53ab4af3SHans de Goede/dts-v1/; 51*53ab4af3SHans de Goede#include "sun7i-a20.dtsi" 52*53ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi" 53*53ab4af3SHans de Goede 54*53ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h> 55*53ab4af3SHans de Goede#include <dt-bindings/interrupt-controller/irq.h> 56*53ab4af3SHans de Goede#include <dt-bindings/pinctrl/sun4i-a10.h> 57*53ab4af3SHans de Goede 58*53ab4af3SHans de Goede/ { 59*53ab4af3SHans de Goede model = "Cubietech Cubietruck"; 60*53ab4af3SHans de Goede compatible = "cubietech,cubietruck", "allwinner,sun7i-a20"; 61*53ab4af3SHans de Goede 62*53ab4af3SHans de Goede aliases { 63*53ab4af3SHans de Goede serial0 = &uart0; 64*53ab4af3SHans de Goede }; 65*53ab4af3SHans de Goede 66*53ab4af3SHans de Goede chosen { 67*53ab4af3SHans de Goede stdout-path = "serial0:115200n8"; 68*53ab4af3SHans de Goede }; 69*53ab4af3SHans de Goede 70*53ab4af3SHans de Goede leds { 71*53ab4af3SHans de Goede compatible = "gpio-leds"; 72*53ab4af3SHans de Goede pinctrl-names = "default"; 73*53ab4af3SHans de Goede pinctrl-0 = <&led_pins_cubietruck>; 74*53ab4af3SHans de Goede 75*53ab4af3SHans de Goede blue { 76*53ab4af3SHans de Goede label = "cubietruck:blue:usr"; 77*53ab4af3SHans de Goede gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; 78*53ab4af3SHans de Goede }; 79*53ab4af3SHans de Goede 80*53ab4af3SHans de Goede orange { 81*53ab4af3SHans de Goede label = "cubietruck:orange:usr"; 82*53ab4af3SHans de Goede gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; 83*53ab4af3SHans de Goede }; 84*53ab4af3SHans de Goede 85*53ab4af3SHans de Goede white { 86*53ab4af3SHans de Goede label = "cubietruck:white:usr"; 87*53ab4af3SHans de Goede gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; 88*53ab4af3SHans de Goede }; 89*53ab4af3SHans de Goede 90*53ab4af3SHans de Goede green { 91*53ab4af3SHans de Goede label = "cubietruck:green:usr"; 92*53ab4af3SHans de Goede gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; 93*53ab4af3SHans de Goede }; 94*53ab4af3SHans de Goede }; 95*53ab4af3SHans de Goede 96*53ab4af3SHans de Goede reg_vmmc3: vmmc3 { 97*53ab4af3SHans de Goede compatible = "regulator-fixed"; 98*53ab4af3SHans de Goede pinctrl-names = "default"; 99*53ab4af3SHans de Goede pinctrl-0 = <&vmmc3_pin_cubietruck>; 100*53ab4af3SHans de Goede regulator-name = "vmmc3"; 101*53ab4af3SHans de Goede regulator-min-microvolt = <3300000>; 102*53ab4af3SHans de Goede regulator-max-microvolt = <3300000>; 103*53ab4af3SHans de Goede enable-active-high; 104*53ab4af3SHans de Goede gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>; 105*53ab4af3SHans de Goede }; 106*53ab4af3SHans de Goede}; 107*53ab4af3SHans de Goede 108*53ab4af3SHans de Goede&ahci { 109*53ab4af3SHans de Goede target-supply = <®_ahci_5v>; 110*53ab4af3SHans de Goede status = "okay"; 111*53ab4af3SHans de Goede}; 112*53ab4af3SHans de Goede 113*53ab4af3SHans de Goede&cpu0 { 114*53ab4af3SHans de Goede cpu-supply = <®_dcdc2>; 115*53ab4af3SHans de Goede}; 116*53ab4af3SHans de Goede 117*53ab4af3SHans de Goede&ehci0 { 118*53ab4af3SHans de Goede status = "okay"; 119*53ab4af3SHans de Goede}; 120*53ab4af3SHans de Goede 121*53ab4af3SHans de Goede&ehci1 { 122*53ab4af3SHans de Goede status = "okay"; 123*53ab4af3SHans de Goede}; 124*53ab4af3SHans de Goede 125*53ab4af3SHans de Goede&gmac { 126*53ab4af3SHans de Goede pinctrl-names = "default"; 127*53ab4af3SHans de Goede pinctrl-0 = <&gmac_pins_rgmii_a>; 128*53ab4af3SHans de Goede phy = <&phy1>; 129*53ab4af3SHans de Goede phy-mode = "rgmii"; 130*53ab4af3SHans de Goede status = "okay"; 131*53ab4af3SHans de Goede 132*53ab4af3SHans de Goede phy1: ethernet-phy@1 { 133*53ab4af3SHans de Goede reg = <1>; 134*53ab4af3SHans de Goede }; 135*53ab4af3SHans de Goede}; 136*53ab4af3SHans de Goede 137*53ab4af3SHans de Goede&i2c0 { 138*53ab4af3SHans de Goede pinctrl-names = "default"; 139*53ab4af3SHans de Goede pinctrl-0 = <&i2c0_pins_a>; 140*53ab4af3SHans de Goede status = "okay"; 141*53ab4af3SHans de Goede 142*53ab4af3SHans de Goede axp209: pmic@34 { 143*53ab4af3SHans de Goede reg = <0x34>; 144*53ab4af3SHans de Goede interrupt-parent = <&nmi_intc>; 145*53ab4af3SHans de Goede interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 146*53ab4af3SHans de Goede }; 147*53ab4af3SHans de Goede}; 148*53ab4af3SHans de Goede 149*53ab4af3SHans de Goede&i2c1 { 150*53ab4af3SHans de Goede pinctrl-names = "default"; 151*53ab4af3SHans de Goede pinctrl-0 = <&i2c1_pins_a>; 152*53ab4af3SHans de Goede status = "okay"; 153*53ab4af3SHans de Goede}; 154*53ab4af3SHans de Goede 155*53ab4af3SHans de Goede&i2c2 { 156*53ab4af3SHans de Goede pinctrl-names = "default"; 157*53ab4af3SHans de Goede pinctrl-0 = <&i2c2_pins_a>; 158*53ab4af3SHans de Goede status = "okay"; 159*53ab4af3SHans de Goede}; 160*53ab4af3SHans de Goede 161*53ab4af3SHans de Goede&ir0 { 162*53ab4af3SHans de Goede pinctrl-names = "default"; 163*53ab4af3SHans de Goede pinctrl-0 = <&ir0_pins_a>; 164*53ab4af3SHans de Goede status = "okay"; 165*53ab4af3SHans de Goede}; 166*53ab4af3SHans de Goede 167*53ab4af3SHans de Goede&mmc0 { 168*53ab4af3SHans de Goede pinctrl-names = "default"; 169*53ab4af3SHans de Goede pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; 170*53ab4af3SHans de Goede vmmc-supply = <®_vcc3v3>; 171*53ab4af3SHans de Goede bus-width = <4>; 172*53ab4af3SHans de Goede cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 173*53ab4af3SHans de Goede cd-inverted; 174*53ab4af3SHans de Goede status = "okay"; 175*53ab4af3SHans de Goede}; 176*53ab4af3SHans de Goede 177*53ab4af3SHans de Goede&mmc3 { 178*53ab4af3SHans de Goede pinctrl-names = "default"; 179*53ab4af3SHans de Goede pinctrl-0 = <&mmc3_pins_a>; 180*53ab4af3SHans de Goede vmmc-supply = <®_vmmc3>; 181*53ab4af3SHans de Goede bus-width = <4>; 182*53ab4af3SHans de Goede non-removable; 183*53ab4af3SHans de Goede status = "okay"; 184*53ab4af3SHans de Goede 185*53ab4af3SHans de Goede brcmf: bcrmf@1 { 186*53ab4af3SHans de Goede reg = <1>; 187*53ab4af3SHans de Goede compatible = "brcm,bcm4329-fmac"; 188*53ab4af3SHans de Goede interrupt-parent = <&pio>; 189*53ab4af3SHans de Goede interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */ 190*53ab4af3SHans de Goede interrupt-names = "host-wake"; 191*53ab4af3SHans de Goede }; 192*53ab4af3SHans de Goede}; 193*53ab4af3SHans de Goede 194*53ab4af3SHans de Goede&mmc3_pins_a { 195*53ab4af3SHans de Goede /* AP6210 requires pull-up */ 196*53ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; 197*53ab4af3SHans de Goede}; 198*53ab4af3SHans de Goede 199*53ab4af3SHans de Goede&ohci0 { 200*53ab4af3SHans de Goede status = "okay"; 201*53ab4af3SHans de Goede}; 202*53ab4af3SHans de Goede 203*53ab4af3SHans de Goede&ohci1 { 204*53ab4af3SHans de Goede status = "okay"; 205*53ab4af3SHans de Goede}; 206*53ab4af3SHans de Goede 207*53ab4af3SHans de Goede&pio { 208*53ab4af3SHans de Goede vmmc3_pin_cubietruck: vmmc3_pin@0 { 209*53ab4af3SHans de Goede allwinner,pins = "PH9"; 210*53ab4af3SHans de Goede allwinner,function = "gpio_out"; 211*53ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 212*53ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 213*53ab4af3SHans de Goede }; 214*53ab4af3SHans de Goede 215*53ab4af3SHans de Goede ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 { 216*53ab4af3SHans de Goede allwinner,pins = "PH12"; 217*53ab4af3SHans de Goede allwinner,function = "gpio_out"; 218*53ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 219*53ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 220*53ab4af3SHans de Goede }; 221*53ab4af3SHans de Goede 222*53ab4af3SHans de Goede led_pins_cubietruck: led_pins@0 { 223*53ab4af3SHans de Goede allwinner,pins = "PH7", "PH11", "PH20", "PH21"; 224*53ab4af3SHans de Goede allwinner,function = "gpio_out"; 225*53ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 226*53ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 227*53ab4af3SHans de Goede }; 228*53ab4af3SHans de Goede 229*53ab4af3SHans de Goede usb0_vbus_pin_a: usb0_vbus_pin@0 { 230*53ab4af3SHans de Goede allwinner,pins = "PH17"; 231*53ab4af3SHans de Goede allwinner,function = "gpio_out"; 232*53ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 233*53ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 234*53ab4af3SHans de Goede }; 235*53ab4af3SHans de Goede}; 236*53ab4af3SHans de Goede 237*53ab4af3SHans de Goede&pwm { 238*53ab4af3SHans de Goede pinctrl-names = "default"; 239*53ab4af3SHans de Goede pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>; 240*53ab4af3SHans de Goede status = "okay"; 241*53ab4af3SHans de Goede}; 242*53ab4af3SHans de Goede 243*53ab4af3SHans de Goede®_ahci_5v { 244*53ab4af3SHans de Goede pinctrl-0 = <&ahci_pwr_pin_cubietruck>; 245*53ab4af3SHans de Goede gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; 246*53ab4af3SHans de Goede status = "okay"; 247*53ab4af3SHans de Goede}; 248*53ab4af3SHans de Goede 249*53ab4af3SHans de Goede#include "axp209.dtsi" 250*53ab4af3SHans de Goede 251*53ab4af3SHans de Goede®_dcdc2 { 252*53ab4af3SHans de Goede regulator-always-on; 253*53ab4af3SHans de Goede regulator-min-microvolt = <1000000>; 254*53ab4af3SHans de Goede regulator-max-microvolt = <1450000>; 255*53ab4af3SHans de Goede regulator-name = "vdd-cpu"; 256*53ab4af3SHans de Goede}; 257*53ab4af3SHans de Goede 258*53ab4af3SHans de Goede®_dcdc3 { 259*53ab4af3SHans de Goede regulator-always-on; 260*53ab4af3SHans de Goede regulator-min-microvolt = <1000000>; 261*53ab4af3SHans de Goede regulator-max-microvolt = <1400000>; 262*53ab4af3SHans de Goede regulator-name = "vdd-int-dll"; 263*53ab4af3SHans de Goede}; 264*53ab4af3SHans de Goede 265*53ab4af3SHans de Goede®_ldo1 { 266*53ab4af3SHans de Goede regulator-name = "vdd-rtc"; 267*53ab4af3SHans de Goede}; 268*53ab4af3SHans de Goede 269*53ab4af3SHans de Goede®_ldo2 { 270*53ab4af3SHans de Goede regulator-always-on; 271*53ab4af3SHans de Goede regulator-min-microvolt = <3000000>; 272*53ab4af3SHans de Goede regulator-max-microvolt = <3000000>; 273*53ab4af3SHans de Goede regulator-name = "avcc"; 274*53ab4af3SHans de Goede}; 275*53ab4af3SHans de Goede 276*53ab4af3SHans de Goede®_usb0_vbus { 277*53ab4af3SHans de Goede pinctrl-0 = <&usb0_vbus_pin_a>; 278*53ab4af3SHans de Goede gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>; 279*53ab4af3SHans de Goede status = "okay"; 280*53ab4af3SHans de Goede}; 281*53ab4af3SHans de Goede 282*53ab4af3SHans de Goede®_usb1_vbus { 283*53ab4af3SHans de Goede status = "okay"; 284*53ab4af3SHans de Goede}; 285*53ab4af3SHans de Goede 286*53ab4af3SHans de Goede®_usb2_vbus { 287*53ab4af3SHans de Goede status = "okay"; 288*53ab4af3SHans de Goede}; 289*53ab4af3SHans de Goede 290*53ab4af3SHans de Goede&uart0 { 291*53ab4af3SHans de Goede pinctrl-names = "default"; 292*53ab4af3SHans de Goede pinctrl-0 = <&uart0_pins_a>; 293*53ab4af3SHans de Goede status = "okay"; 294*53ab4af3SHans de Goede}; 295*53ab4af3SHans de Goede 296*53ab4af3SHans de Goede&usbphy { 297*53ab4af3SHans de Goede usb0_vbus-supply = <®_usb0_vbus>; 298*53ab4af3SHans de Goede usb1_vbus-supply = <®_usb1_vbus>; 299*53ab4af3SHans de Goede usb2_vbus-supply = <®_usb2_vbus>; 300*53ab4af3SHans de Goede status = "okay"; 301*53ab4af3SHans de Goede}; 302