153ab4af3SHans de Goede/* 253ab4af3SHans de Goede * Copyright 2014 Hans de Goede <hdegoede@redhat.com> 353ab4af3SHans de Goede * 453ab4af3SHans de Goede * Hans de Goede <hdegoede@redhat.com> 553ab4af3SHans de Goede * 653ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms 753ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual 853ab4af3SHans de Goede * licensing only applies to this file, and not this project as a 953ab4af3SHans de Goede * whole. 1053ab4af3SHans de Goede * 1153ab4af3SHans de Goede * a) This file is free software; you can redistribute it and/or 1253ab4af3SHans de Goede * modify it under the terms of the GNU General Public License as 1353ab4af3SHans de Goede * published by the Free Software Foundation; either version 2 of the 1453ab4af3SHans de Goede * License, or (at your option) any later version. 1553ab4af3SHans de Goede * 1653ab4af3SHans de Goede * This file is distributed in the hope that it will be useful, 1753ab4af3SHans de Goede * but WITHOUT ANY WARRANTY; without even the implied warranty of 1853ab4af3SHans de Goede * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1953ab4af3SHans de Goede * GNU General Public License for more details. 2053ab4af3SHans de Goede * 2153ab4af3SHans de Goede * Or, alternatively, 2253ab4af3SHans de Goede * 2353ab4af3SHans de Goede * b) Permission is hereby granted, free of charge, to any person 2453ab4af3SHans de Goede * obtaining a copy of this software and associated documentation 2553ab4af3SHans de Goede * files (the "Software"), to deal in the Software without 2653ab4af3SHans de Goede * restriction, including without limitation the rights to use, 2753ab4af3SHans de Goede * copy, modify, merge, publish, distribute, sublicense, and/or 2853ab4af3SHans de Goede * sell copies of the Software, and to permit persons to whom the 2953ab4af3SHans de Goede * Software is furnished to do so, subject to the following 3053ab4af3SHans de Goede * conditions: 3153ab4af3SHans de Goede * 3253ab4af3SHans de Goede * The above copyright notice and this permission notice shall be 3353ab4af3SHans de Goede * included in all copies or substantial portions of the Software. 3453ab4af3SHans de Goede * 3553ab4af3SHans de Goede * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 3653ab4af3SHans de Goede * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 3753ab4af3SHans de Goede * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 3853ab4af3SHans de Goede * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 3953ab4af3SHans de Goede * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 4053ab4af3SHans de Goede * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 4153ab4af3SHans de Goede * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 4253ab4af3SHans de Goede * OTHER DEALINGS IN THE SOFTWARE. 4353ab4af3SHans de Goede */ 4453ab4af3SHans de Goede 4553ab4af3SHans de Goede/dts-v1/; 4653ab4af3SHans de Goede#include "sun7i-a20.dtsi" 4753ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi" 4853ab4af3SHans de Goede 4953ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h> 5053ab4af3SHans de Goede#include <dt-bindings/interrupt-controller/irq.h> 5153ab4af3SHans de Goede 5253ab4af3SHans de Goede/ { 5353ab4af3SHans de Goede model = "LeMaker Banana Pi"; 5453ab4af3SHans de Goede compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; 5553ab4af3SHans de Goede 5653ab4af3SHans de Goede aliases { 5753ab4af3SHans de Goede serial0 = &uart0; 5853ab4af3SHans de Goede serial1 = &uart3; 5953ab4af3SHans de Goede serial2 = &uart7; 6053ab4af3SHans de Goede }; 6153ab4af3SHans de Goede 6253ab4af3SHans de Goede chosen { 6353ab4af3SHans de Goede stdout-path = "serial0:115200n8"; 6453ab4af3SHans de Goede }; 6553ab4af3SHans de Goede 66*b9d59d08SJagan Teki hdmi-connector { 67*b9d59d08SJagan Teki compatible = "hdmi-connector"; 68*b9d59d08SJagan Teki type = "a"; 69*b9d59d08SJagan Teki 70*b9d59d08SJagan Teki port { 71*b9d59d08SJagan Teki hdmi_con_in: endpoint { 72*b9d59d08SJagan Teki remote-endpoint = <&hdmi_out_con>; 73*b9d59d08SJagan Teki }; 74*b9d59d08SJagan Teki }; 75*b9d59d08SJagan Teki }; 76*b9d59d08SJagan Teki 7753ab4af3SHans de Goede leds { 7853ab4af3SHans de Goede compatible = "gpio-leds"; 7953ab4af3SHans de Goede pinctrl-names = "default"; 8053ab4af3SHans de Goede pinctrl-0 = <&led_pins_bananapi>; 8153ab4af3SHans de Goede 8253ab4af3SHans de Goede green { 8353ab4af3SHans de Goede label = "bananapi:green:usr"; 8453ab4af3SHans de Goede gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; 8553ab4af3SHans de Goede }; 8653ab4af3SHans de Goede }; 8753ab4af3SHans de Goede 8853ab4af3SHans de Goede reg_gmac_3v3: gmac-3v3 { 8953ab4af3SHans de Goede compatible = "regulator-fixed"; 9053ab4af3SHans de Goede pinctrl-names = "default"; 9153ab4af3SHans de Goede pinctrl-0 = <&gmac_power_pin_bananapi>; 9253ab4af3SHans de Goede regulator-name = "gmac-3v3"; 9353ab4af3SHans de Goede regulator-min-microvolt = <3300000>; 9453ab4af3SHans de Goede regulator-max-microvolt = <3300000>; 9553ab4af3SHans de Goede startup-delay-us = <100000>; 9653ab4af3SHans de Goede enable-active-high; 9753ab4af3SHans de Goede gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; 9853ab4af3SHans de Goede }; 9953ab4af3SHans de Goede}; 10053ab4af3SHans de Goede 10153ab4af3SHans de Goede&ahci { 10253ab4af3SHans de Goede status = "okay"; 10353ab4af3SHans de Goede}; 10453ab4af3SHans de Goede 10580e5f83cSHans de Goede&codec { 10680e5f83cSHans de Goede status = "okay"; 10780e5f83cSHans de Goede}; 10880e5f83cSHans de Goede 10980e5f83cSHans de Goede&cpu0 { 11080e5f83cSHans de Goede cpu-supply = <®_dcdc2>; 11180e5f83cSHans de Goede operating-points = < 11280e5f83cSHans de Goede /* kHz uV */ 11380e5f83cSHans de Goede 960000 1400000 11480e5f83cSHans de Goede 912000 1400000 11580e5f83cSHans de Goede 864000 1350000 11680e5f83cSHans de Goede 720000 1250000 11780e5f83cSHans de Goede 528000 1150000 11880e5f83cSHans de Goede 312000 1100000 11980e5f83cSHans de Goede 144000 1050000 12080e5f83cSHans de Goede >; 12180e5f83cSHans de Goede}; 12280e5f83cSHans de Goede 123*b9d59d08SJagan Teki&de { 124*b9d59d08SJagan Teki status = "okay"; 125*b9d59d08SJagan Teki}; 126*b9d59d08SJagan Teki 12753ab4af3SHans de Goede&ehci0 { 12853ab4af3SHans de Goede status = "okay"; 12953ab4af3SHans de Goede}; 13053ab4af3SHans de Goede 13153ab4af3SHans de Goede&ehci1 { 13253ab4af3SHans de Goede status = "okay"; 13353ab4af3SHans de Goede}; 13453ab4af3SHans de Goede 13553ab4af3SHans de Goede&gmac { 13653ab4af3SHans de Goede pinctrl-names = "default"; 13753ab4af3SHans de Goede pinctrl-0 = <&gmac_pins_rgmii_a>; 13853ab4af3SHans de Goede phy = <&phy1>; 13953ab4af3SHans de Goede phy-mode = "rgmii"; 14053ab4af3SHans de Goede phy-supply = <®_gmac_3v3>; 14153ab4af3SHans de Goede status = "okay"; 14253ab4af3SHans de Goede 14353ab4af3SHans de Goede phy1: ethernet-phy@1 { 14453ab4af3SHans de Goede reg = <1>; 14553ab4af3SHans de Goede }; 14653ab4af3SHans de Goede}; 14753ab4af3SHans de Goede 148*b9d59d08SJagan Teki&hdmi { 149*b9d59d08SJagan Teki status = "okay"; 150*b9d59d08SJagan Teki}; 151*b9d59d08SJagan Teki 152*b9d59d08SJagan Teki&hdmi_out { 153*b9d59d08SJagan Teki hdmi_out_con: endpoint { 154*b9d59d08SJagan Teki remote-endpoint = <&hdmi_con_in>; 155*b9d59d08SJagan Teki }; 156*b9d59d08SJagan Teki}; 157*b9d59d08SJagan Teki 15853ab4af3SHans de Goede&i2c0 { 15953ab4af3SHans de Goede pinctrl-names = "default"; 16053ab4af3SHans de Goede pinctrl-0 = <&i2c0_pins_a>; 16153ab4af3SHans de Goede status = "okay"; 16253ab4af3SHans de Goede 16353ab4af3SHans de Goede axp209: pmic@34 { 16453ab4af3SHans de Goede reg = <0x34>; 16553ab4af3SHans de Goede interrupt-parent = <&nmi_intc>; 16653ab4af3SHans de Goede interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 16753ab4af3SHans de Goede }; 16853ab4af3SHans de Goede}; 16953ab4af3SHans de Goede 17053ab4af3SHans de Goede&i2c2 { 17153ab4af3SHans de Goede pinctrl-names = "default"; 17253ab4af3SHans de Goede pinctrl-0 = <&i2c2_pins_a>; 17353ab4af3SHans de Goede status = "okay"; 17453ab4af3SHans de Goede}; 17553ab4af3SHans de Goede 17653ab4af3SHans de Goede&ir0 { 17753ab4af3SHans de Goede pinctrl-names = "default"; 1788b1ba941SHans de Goede pinctrl-0 = <&ir0_rx_pins_a>; 17953ab4af3SHans de Goede status = "okay"; 18053ab4af3SHans de Goede}; 18153ab4af3SHans de Goede 18253ab4af3SHans de Goede&mmc0 { 18353ab4af3SHans de Goede pinctrl-names = "default"; 18453ab4af3SHans de Goede pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>; 18553ab4af3SHans de Goede vmmc-supply = <®_vcc3v3>; 18653ab4af3SHans de Goede bus-width = <4>; 187*b9d59d08SJagan Teki cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */ 18853ab4af3SHans de Goede status = "okay"; 18953ab4af3SHans de Goede}; 19053ab4af3SHans de Goede 19153ab4af3SHans de Goede&ohci0 { 19253ab4af3SHans de Goede status = "okay"; 19353ab4af3SHans de Goede}; 19453ab4af3SHans de Goede 19553ab4af3SHans de Goede&ohci1 { 19653ab4af3SHans de Goede status = "okay"; 19753ab4af3SHans de Goede}; 19853ab4af3SHans de Goede 19980e5f83cSHans de Goede&otg_sram { 20080e5f83cSHans de Goede status = "okay"; 20180e5f83cSHans de Goede}; 20280e5f83cSHans de Goede 20353ab4af3SHans de Goede&pio { 204*b9d59d08SJagan Teki gpio-line-names = 205*b9d59d08SJagan Teki /* PA */ 206*b9d59d08SJagan Teki "ERXD3", "ERXD2", "ERXD1", "ERXD0", "ETXD3", 207*b9d59d08SJagan Teki "ETXD2", "ETXD1", "ETXD0", 208*b9d59d08SJagan Teki "ERXCK", "ERXERR", "ERXDV", "EMDC", "EMDIO", 209*b9d59d08SJagan Teki "ETXEN", "ETXCK", "ECRS", 210*b9d59d08SJagan Teki "ECOL", "ETXERR", "", "", "", "", "", "", 211*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 212*b9d59d08SJagan Teki /* PB */ 213*b9d59d08SJagan Teki "PMU-SCK", "PMU-SDA", "", "", "", "", "", "", 214*b9d59d08SJagan Teki "", "USB0-DRV", "", "", "", "", "", "", 215*b9d59d08SJagan Teki "", "", "", "", "SCL", "SDA", "", "", 216*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 217*b9d59d08SJagan Teki /* PC */ 218*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 219*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 220*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 221*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 222*b9d59d08SJagan Teki /* PD */ 223*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 224*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 225*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 226*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 227*b9d59d08SJagan Teki /* PE */ 228*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 229*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 230*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 231*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 232*b9d59d08SJagan Teki /* PF */ 233*b9d59d08SJagan Teki "SD0-D1", "SD0-D0", "SD0-CLK", "SD0-CMD", "SD0-D3", 234*b9d59d08SJagan Teki "SD0-D2", "", "", 235*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 236*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 237*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 238*b9d59d08SJagan Teki /* PG */ 239*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 240*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 241*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 242*b9d59d08SJagan Teki "", "", "", "", "", "", "", "", 243*b9d59d08SJagan Teki /* PH */ 244*b9d59d08SJagan Teki "TXD0", "RXD0", "IO-1", "PH3", "USB0-IDDET", "PH5", "", "", 245*b9d59d08SJagan Teki "", "", "SD0-DET", "", "", "", "", "", 246*b9d59d08SJagan Teki "", "", "", "", "IO-4", "IO-5", "", "EMAC-PWR-EN", 247*b9d59d08SJagan Teki "LED1", "", "", "", "", "", "", "", 248*b9d59d08SJagan Teki /* PI */ 249*b9d59d08SJagan Teki "", "", "", "IO-GCLK", "", "", "", "", 250*b9d59d08SJagan Teki "", "", "SPI-CE0", "SPI-CLK", "SPI-MOSI", 251*b9d59d08SJagan Teki "SPI-MISO", "SPI-CE1", "", 252*b9d59d08SJagan Teki "IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "", 253*b9d59d08SJagan Teki "", "", "", "", "", "", "", ""; 254*b9d59d08SJagan Teki 25580e5f83cSHans de Goede usb0_id_detect_pin: usb0_id_detect_pin@0 { 256*b9d59d08SJagan Teki pins = "PH4"; 257*b9d59d08SJagan Teki function = "gpio_in"; 258*b9d59d08SJagan Teki bias-pull-up; 25980e5f83cSHans de Goede }; 26080e5f83cSHans de Goede 26153ab4af3SHans de Goede mmc0_cd_pin_bananapi: mmc0_cd_pin@0 { 262*b9d59d08SJagan Teki pins = "PH10"; 263*b9d59d08SJagan Teki function = "gpio_in"; 264*b9d59d08SJagan Teki bias-pull-up; 26553ab4af3SHans de Goede }; 26653ab4af3SHans de Goede 26753ab4af3SHans de Goede gmac_power_pin_bananapi: gmac_power_pin@0 { 268*b9d59d08SJagan Teki pins = "PH23"; 269*b9d59d08SJagan Teki function = "gpio_out"; 27053ab4af3SHans de Goede }; 27153ab4af3SHans de Goede 27253ab4af3SHans de Goede led_pins_bananapi: led_pins@0 { 273*b9d59d08SJagan Teki pins = "PH24"; 274*b9d59d08SJagan Teki function = "gpio_out"; 27553ab4af3SHans de Goede }; 27653ab4af3SHans de Goede}; 27753ab4af3SHans de Goede 27880e5f83cSHans de Goede#include "axp209.dtsi" 27980e5f83cSHans de Goede 28080e5f83cSHans de Goede®_dcdc2 { 28180e5f83cSHans de Goede regulator-always-on; 28280e5f83cSHans de Goede regulator-min-microvolt = <1000000>; 28380e5f83cSHans de Goede regulator-max-microvolt = <1400000>; 28480e5f83cSHans de Goede regulator-name = "vdd-cpu"; 28580e5f83cSHans de Goede}; 28680e5f83cSHans de Goede 28780e5f83cSHans de Goede®_dcdc3 { 28880e5f83cSHans de Goede regulator-always-on; 28980e5f83cSHans de Goede regulator-min-microvolt = <1000000>; 29080e5f83cSHans de Goede regulator-max-microvolt = <1400000>; 29180e5f83cSHans de Goede regulator-name = "vdd-int-dll"; 29280e5f83cSHans de Goede}; 29380e5f83cSHans de Goede 29480e5f83cSHans de Goede®_ldo1 { 29580e5f83cSHans de Goede regulator-name = "vdd-rtc"; 29680e5f83cSHans de Goede}; 29780e5f83cSHans de Goede 29880e5f83cSHans de Goede®_ldo2 { 29980e5f83cSHans de Goede regulator-always-on; 30080e5f83cSHans de Goede regulator-min-microvolt = <3000000>; 30180e5f83cSHans de Goede regulator-max-microvolt = <3000000>; 30280e5f83cSHans de Goede regulator-name = "avcc"; 30380e5f83cSHans de Goede}; 30480e5f83cSHans de Goede 30580e5f83cSHans de Goede®_usb0_vbus { 30680e5f83cSHans de Goede status = "okay"; 30780e5f83cSHans de Goede}; 30880e5f83cSHans de Goede 30953ab4af3SHans de Goede®_usb1_vbus { 31053ab4af3SHans de Goede status = "okay"; 31153ab4af3SHans de Goede}; 31253ab4af3SHans de Goede 31353ab4af3SHans de Goede®_usb2_vbus { 31453ab4af3SHans de Goede status = "okay"; 31553ab4af3SHans de Goede}; 31653ab4af3SHans de Goede 31753ab4af3SHans de Goede&spi0 { 31853ab4af3SHans de Goede pinctrl-names = "default"; 3198b1ba941SHans de Goede pinctrl-0 = <&spi0_pins_a>, 3208b1ba941SHans de Goede <&spi0_cs0_pins_a>, 3218b1ba941SHans de Goede <&spi0_cs1_pins_a>; 32253ab4af3SHans de Goede status = "okay"; 32353ab4af3SHans de Goede}; 32453ab4af3SHans de Goede 32553ab4af3SHans de Goede&uart0 { 32653ab4af3SHans de Goede pinctrl-names = "default"; 32753ab4af3SHans de Goede pinctrl-0 = <&uart0_pins_a>; 32853ab4af3SHans de Goede status = "okay"; 32953ab4af3SHans de Goede}; 33053ab4af3SHans de Goede 33153ab4af3SHans de Goede&uart3 { 33253ab4af3SHans de Goede pinctrl-names = "default"; 33353ab4af3SHans de Goede pinctrl-0 = <&uart3_pins_b>; 33453ab4af3SHans de Goede status = "okay"; 33553ab4af3SHans de Goede}; 33653ab4af3SHans de Goede 33753ab4af3SHans de Goede&uart7 { 33853ab4af3SHans de Goede pinctrl-names = "default"; 33953ab4af3SHans de Goede pinctrl-0 = <&uart7_pins_a>; 34053ab4af3SHans de Goede status = "okay"; 34153ab4af3SHans de Goede}; 34253ab4af3SHans de Goede 34380e5f83cSHans de Goede&usb_otg { 34480e5f83cSHans de Goede dr_mode = "otg"; 34580e5f83cSHans de Goede status = "okay"; 34680e5f83cSHans de Goede}; 34780e5f83cSHans de Goede 34880e5f83cSHans de Goede&usb_power_supply { 34980e5f83cSHans de Goede status = "okay"; 35080e5f83cSHans de Goede}; 35180e5f83cSHans de Goede 35253ab4af3SHans de Goede&usbphy { 35380e5f83cSHans de Goede pinctrl-names = "default"; 35480e5f83cSHans de Goede pinctrl-0 = <&usb0_id_detect_pin>; 35580e5f83cSHans de Goede usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ 35680e5f83cSHans de Goede usb0_vbus_power-supply = <&usb_power_supply>; 35780e5f83cSHans de Goede usb0_vbus-supply = <®_usb0_vbus>; 35853ab4af3SHans de Goede usb1_vbus-supply = <®_usb1_vbus>; 35953ab4af3SHans de Goede usb2_vbus-supply = <®_usb2_vbus>; 36053ab4af3SHans de Goede status = "okay"; 36153ab4af3SHans de Goede}; 362