153ab4af3SHans de Goede/* 253ab4af3SHans de Goede * Copyright 2014 Maxime Ripard 353ab4af3SHans de Goede * 453ab4af3SHans de Goede * Maxime Ripard <maxime.ripard@free-electrons.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 "sun6i-a31.dtsi" 4753ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi" 4853ab4af3SHans de Goede 4953ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h> 5053ab4af3SHans de Goede 5153ab4af3SHans de Goede/ { 5253ab4af3SHans de Goede model = "Merrii A31 Hummingbird"; 5353ab4af3SHans de Goede compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31"; 5453ab4af3SHans de Goede 5553ab4af3SHans de Goede aliases { 5680e5f83cSHans de Goede rtc0 = &pcf8563; 5780e5f83cSHans de Goede rtc1 = &rtc; 5853ab4af3SHans de Goede serial0 = &uart0; 5953ab4af3SHans de Goede }; 6053ab4af3SHans de Goede 6153ab4af3SHans de Goede chosen { 6253ab4af3SHans de Goede stdout-path = "serial0:115200n8"; 6353ab4af3SHans de Goede }; 6453ab4af3SHans de Goede 65*d1d4295aSJagan Teki hdmi-connector { 66*d1d4295aSJagan Teki compatible = "hdmi-connector"; 67*d1d4295aSJagan Teki type = "a"; 68*d1d4295aSJagan Teki 69*d1d4295aSJagan Teki port { 70*d1d4295aSJagan Teki hdmi_con_in: endpoint { 71*d1d4295aSJagan Teki remote-endpoint = <&hdmi_out_con>; 72*d1d4295aSJagan Teki }; 73*d1d4295aSJagan Teki }; 74*d1d4295aSJagan Teki }; 75*d1d4295aSJagan Teki 76*d1d4295aSJagan Teki vga-connector { 77*d1d4295aSJagan Teki compatible = "vga-connector"; 78*d1d4295aSJagan Teki 79*d1d4295aSJagan Teki port { 80*d1d4295aSJagan Teki vga_con_in: endpoint { 81*d1d4295aSJagan Teki remote-endpoint = <&vga_dac_out>; 82*d1d4295aSJagan Teki }; 83*d1d4295aSJagan Teki }; 84*d1d4295aSJagan Teki }; 85*d1d4295aSJagan Teki 86*d1d4295aSJagan Teki vga-dac { 87*d1d4295aSJagan Teki compatible = "dumb-vga-dac"; 88*d1d4295aSJagan Teki vdd-supply = <®_vga_3v3>; 89*d1d4295aSJagan Teki #address-cells = <1>; 90*d1d4295aSJagan Teki #size-cells = <0>; 91*d1d4295aSJagan Teki 92*d1d4295aSJagan Teki ports { 93*d1d4295aSJagan Teki #address-cells = <1>; 94*d1d4295aSJagan Teki #size-cells = <0>; 95*d1d4295aSJagan Teki 96*d1d4295aSJagan Teki port@0 { 97*d1d4295aSJagan Teki #address-cells = <1>; 98*d1d4295aSJagan Teki #size-cells = <0>; 99*d1d4295aSJagan Teki reg = <0>; 100*d1d4295aSJagan Teki 101*d1d4295aSJagan Teki vga_dac_in: endpoint@0 { 102*d1d4295aSJagan Teki reg = <0>; 103*d1d4295aSJagan Teki remote-endpoint = <&tcon0_out_vga>; 104*d1d4295aSJagan Teki }; 105*d1d4295aSJagan Teki }; 106*d1d4295aSJagan Teki 107*d1d4295aSJagan Teki port@1 { 108*d1d4295aSJagan Teki #address-cells = <1>; 109*d1d4295aSJagan Teki #size-cells = <0>; 110*d1d4295aSJagan Teki reg = <1>; 111*d1d4295aSJagan Teki 112*d1d4295aSJagan Teki vga_dac_out: endpoint@0 { 113*d1d4295aSJagan Teki reg = <0>; 114*d1d4295aSJagan Teki remote-endpoint = <&vga_con_in>; 115*d1d4295aSJagan Teki }; 116*d1d4295aSJagan Teki }; 117*d1d4295aSJagan Teki }; 118*d1d4295aSJagan Teki }; 119*d1d4295aSJagan Teki 120*d1d4295aSJagan Teki reg_vga_3v3: vga_3v3_regulator { 121*d1d4295aSJagan Teki compatible = "regulator-fixed"; 122*d1d4295aSJagan Teki regulator-name = "vga-3v3"; 123*d1d4295aSJagan Teki regulator-min-microvolt = <3300000>; 124*d1d4295aSJagan Teki regulator-max-microvolt = <3300000>; 125*d1d4295aSJagan Teki regulator-boot-on; 126*d1d4295aSJagan Teki enable-active-high; 127*d1d4295aSJagan Teki gpio = <&pio 7 25 GPIO_ACTIVE_HIGH>; /* PH25 */ 128*d1d4295aSJagan Teki }; 129*d1d4295aSJagan Teki 13053ab4af3SHans de Goede wifi_pwrseq: wifi_pwrseq { 13153ab4af3SHans de Goede compatible = "mmc-pwrseq-simple"; 13253ab4af3SHans de Goede reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */ 13353ab4af3SHans de Goede }; 13453ab4af3SHans de Goede}; 13553ab4af3SHans de Goede 136*d1d4295aSJagan Teki&codec { 137*d1d4295aSJagan Teki allwinner,audio-routing = 138*d1d4295aSJagan Teki "Headphone", "HP", 139*d1d4295aSJagan Teki "Speaker", "LINEOUT", 140*d1d4295aSJagan Teki "LINEIN", "Line In", 141*d1d4295aSJagan Teki "MIC1", "Mic", 142*d1d4295aSJagan Teki "MIC2", "Headset Mic", 143*d1d4295aSJagan Teki "Mic", "MBIAS", 144*d1d4295aSJagan Teki "Headset Mic", "HBIAS"; 145*d1d4295aSJagan Teki allwinner,pa-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */ 146*d1d4295aSJagan Teki status = "okay"; 147*d1d4295aSJagan Teki}; 148*d1d4295aSJagan Teki 14980e5f83cSHans de Goede&cpu0 { 15080e5f83cSHans de Goede cpu-supply = <®_dcdc3>; 15180e5f83cSHans de Goede}; 15280e5f83cSHans de Goede 153*d1d4295aSJagan Teki&de { 154*d1d4295aSJagan Teki status = "okay"; 155*d1d4295aSJagan Teki}; 156*d1d4295aSJagan Teki 15753ab4af3SHans de Goede&ehci0 { 15853ab4af3SHans de Goede status = "okay"; 15953ab4af3SHans de Goede}; 16053ab4af3SHans de Goede 16153ab4af3SHans de Goede&gmac { 16253ab4af3SHans de Goede pinctrl-names = "default"; 16380e5f83cSHans de Goede pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>; 16453ab4af3SHans de Goede phy = <&phy1>; 16553ab4af3SHans de Goede phy-mode = "rgmii"; 16653ab4af3SHans de Goede snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; 16753ab4af3SHans de Goede snps,reset-active-low; 16853ab4af3SHans de Goede snps,reset-delays-us = <0 10000 30000>; 16953ab4af3SHans de Goede status = "okay"; 17053ab4af3SHans de Goede 17153ab4af3SHans de Goede phy1: ethernet-phy@1 { 17253ab4af3SHans de Goede reg = <1>; 17353ab4af3SHans de Goede }; 17453ab4af3SHans de Goede}; 17553ab4af3SHans de Goede 176*d1d4295aSJagan Teki&hdmi { 177*d1d4295aSJagan Teki status = "okay"; 178*d1d4295aSJagan Teki}; 179*d1d4295aSJagan Teki 180*d1d4295aSJagan Teki&hdmi_out { 181*d1d4295aSJagan Teki hdmi_out_con: endpoint { 182*d1d4295aSJagan Teki remote-endpoint = <&hdmi_con_in>; 183*d1d4295aSJagan Teki }; 184*d1d4295aSJagan Teki}; 185*d1d4295aSJagan Teki 18653ab4af3SHans de Goede&i2c0 { 18753ab4af3SHans de Goede pinctrl-names = "default"; 18853ab4af3SHans de Goede pinctrl-0 = <&i2c0_pins_a>; 18953ab4af3SHans de Goede /* pull-ups and devices require AXP221 DLDO3 */ 19053ab4af3SHans de Goede status = "failed"; 19153ab4af3SHans de Goede}; 19253ab4af3SHans de Goede 19353ab4af3SHans de Goede&i2c1 { 19453ab4af3SHans de Goede pinctrl-names = "default"; 19553ab4af3SHans de Goede pinctrl-0 = <&i2c1_pins_a>; 19653ab4af3SHans de Goede status = "okay"; 19753ab4af3SHans de Goede}; 19853ab4af3SHans de Goede 19953ab4af3SHans de Goede&i2c2 { 20053ab4af3SHans de Goede pinctrl-names = "default"; 20153ab4af3SHans de Goede pinctrl-0 = <&i2c2_pins_a>; 20253ab4af3SHans de Goede status = "okay"; 20353ab4af3SHans de Goede 20453ab4af3SHans de Goede pcf8563: rtc@51 { 20553ab4af3SHans de Goede compatible = "nxp,pcf8563"; 20653ab4af3SHans de Goede reg = <0x51>; 20753ab4af3SHans de Goede }; 20853ab4af3SHans de Goede}; 20953ab4af3SHans de Goede 21053ab4af3SHans de Goede&ir { 21153ab4af3SHans de Goede pinctrl-names = "default"; 21253ab4af3SHans de Goede pinctrl-0 = <&ir_pins_a>; 21353ab4af3SHans de Goede status = "okay"; 21453ab4af3SHans de Goede}; 21553ab4af3SHans de Goede 21653ab4af3SHans de Goede&mmc0 { 21753ab4af3SHans de Goede pinctrl-names = "default"; 21853ab4af3SHans de Goede pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; 21980e5f83cSHans de Goede vmmc-supply = <®_dcdc1>; 22053ab4af3SHans de Goede bus-width = <4>; 221*d1d4295aSJagan Teki cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ 22253ab4af3SHans de Goede status = "okay"; 22353ab4af3SHans de Goede}; 22453ab4af3SHans de Goede 22553ab4af3SHans de Goede&mmc0_pins_a { 22653ab4af3SHans de Goede /* external pull-ups missing for some pins */ 227*d1d4295aSJagan Teki bias-pull-up; 22853ab4af3SHans de Goede}; 22953ab4af3SHans de Goede 23053ab4af3SHans de Goede&mmc1 { 23153ab4af3SHans de Goede pinctrl-names = "default"; 23253ab4af3SHans de Goede pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>; 23380e5f83cSHans de Goede vmmc-supply = <®_aldo1>; 23453ab4af3SHans de Goede mmc-pwrseq = <&wifi_pwrseq>; 23553ab4af3SHans de Goede bus-width = <4>; 23653ab4af3SHans de Goede non-removable; 23753ab4af3SHans de Goede status = "okay"; 23853ab4af3SHans de Goede}; 23953ab4af3SHans de Goede 24053ab4af3SHans de Goede&ohci0 { 24153ab4af3SHans de Goede status = "okay"; 24253ab4af3SHans de Goede}; 24353ab4af3SHans de Goede 24453ab4af3SHans de Goede&pio { 24580e5f83cSHans de Goede gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 { 246*d1d4295aSJagan Teki pins = "PA21"; 247*d1d4295aSJagan Teki function = "gpio_out"; 24880e5f83cSHans de Goede }; 24980e5f83cSHans de Goede 25053ab4af3SHans de Goede mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 { 251*d1d4295aSJagan Teki pins = "PA8"; 252*d1d4295aSJagan Teki function = "gpio_in"; 253*d1d4295aSJagan Teki bias-pull-up; 25453ab4af3SHans de Goede }; 25553ab4af3SHans de Goede 25653ab4af3SHans de Goede wifi_reset_pin_hummingbird: wifi_reset_pin@0 { 257*d1d4295aSJagan Teki pins = "PG10"; 258*d1d4295aSJagan Teki function = "gpio_out"; 25953ab4af3SHans de Goede }; 26053ab4af3SHans de Goede}; 26153ab4af3SHans de Goede 26253ab4af3SHans de Goede&p2wi { 26353ab4af3SHans de Goede status = "okay"; 26453ab4af3SHans de Goede 26580e5f83cSHans de Goede axp22x: pmic@68 { 26653ab4af3SHans de Goede compatible = "x-powers,axp221"; 26753ab4af3SHans de Goede reg = <0x68>; 26853ab4af3SHans de Goede interrupt-parent = <&nmi_intc>; 26953ab4af3SHans de Goede interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 270*d1d4295aSJagan Teki x-powers,drive-vbus-en; 27180e5f83cSHans de Goede }; 27280e5f83cSHans de Goede}; 27353ab4af3SHans de Goede 27480e5f83cSHans de Goede#include "axp22x.dtsi" 27553ab4af3SHans de Goede 276*d1d4295aSJagan Teki&ac_power_supply { 277*d1d4295aSJagan Teki status = "okay"; 278*d1d4295aSJagan Teki}; 279*d1d4295aSJagan Teki 28080e5f83cSHans de Goede®_aldo1 { 28180e5f83cSHans de Goede regulator-min-microvolt = <3300000>; 28280e5f83cSHans de Goede regulator-max-microvolt = <3300000>; 28380e5f83cSHans de Goede regulator-name = "vcc-wifi"; 28480e5f83cSHans de Goede}; 28580e5f83cSHans de Goede 28680e5f83cSHans de Goede®_aldo3 { 28780e5f83cSHans de Goede regulator-always-on; 28880e5f83cSHans de Goede regulator-min-microvolt = <2700000>; 28980e5f83cSHans de Goede regulator-max-microvolt = <3300000>; 29080e5f83cSHans de Goede regulator-name = "avcc"; 29180e5f83cSHans de Goede}; 29280e5f83cSHans de Goede 29380e5f83cSHans de Goede®_dc5ldo { 29480e5f83cSHans de Goede regulator-min-microvolt = <700000>; 29580e5f83cSHans de Goede regulator-max-microvolt = <1320000>; 29680e5f83cSHans de Goede regulator-name = "vdd-cpus"; 29780e5f83cSHans de Goede}; 29880e5f83cSHans de Goede 29980e5f83cSHans de Goede®_dcdc1 { 30053ab4af3SHans de Goede regulator-always-on; 30153ab4af3SHans de Goede regulator-min-microvolt = <3000000>; 30253ab4af3SHans de Goede regulator-max-microvolt = <3000000>; 30353ab4af3SHans de Goede regulator-name = "vcc-3v0"; 30453ab4af3SHans de Goede}; 30553ab4af3SHans de Goede 30680e5f83cSHans de Goede®_dcdc2 { 30780e5f83cSHans de Goede regulator-min-microvolt = <700000>; 30880e5f83cSHans de Goede regulator-max-microvolt = <1320000>; 30980e5f83cSHans de Goede regulator-name = "vdd-gpu"; 31080e5f83cSHans de Goede}; 31180e5f83cSHans de Goede 31280e5f83cSHans de Goede®_dcdc3 { 31353ab4af3SHans de Goede regulator-always-on; 31453ab4af3SHans de Goede regulator-min-microvolt = <700000>; 31553ab4af3SHans de Goede regulator-max-microvolt = <1320000>; 31653ab4af3SHans de Goede regulator-name = "vdd-cpu"; 31753ab4af3SHans de Goede}; 31853ab4af3SHans de Goede 31980e5f83cSHans de Goede®_dcdc4 { 32053ab4af3SHans de Goede regulator-always-on; 32153ab4af3SHans de Goede regulator-min-microvolt = <700000>; 32253ab4af3SHans de Goede regulator-max-microvolt = <1320000>; 32353ab4af3SHans de Goede regulator-name = "vdd-sys-dll"; 32453ab4af3SHans de Goede}; 32553ab4af3SHans de Goede 32680e5f83cSHans de Goede®_dcdc5 { 32753ab4af3SHans de Goede regulator-always-on; 32853ab4af3SHans de Goede regulator-min-microvolt = <1500000>; 32953ab4af3SHans de Goede regulator-max-microvolt = <1500000>; 33053ab4af3SHans de Goede regulator-name = "vcc-dram"; 33153ab4af3SHans de Goede}; 33253ab4af3SHans de Goede 333*d1d4295aSJagan Teki®_drivevbus { 334*d1d4295aSJagan Teki regulator-name = "usb0-vbus"; 335*d1d4295aSJagan Teki status = "okay"; 336*d1d4295aSJagan Teki}; 337*d1d4295aSJagan Teki 33853ab4af3SHans de Goede®_usb1_vbus { 33953ab4af3SHans de Goede gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */ 34053ab4af3SHans de Goede status = "okay"; 34153ab4af3SHans de Goede}; 34253ab4af3SHans de Goede 343*d1d4295aSJagan Teki&tcon0 { 344*d1d4295aSJagan Teki pinctrl-names = "default"; 345*d1d4295aSJagan Teki pinctrl-0 = <&lcd0_rgb888_pins>; 346*d1d4295aSJagan Teki}; 347*d1d4295aSJagan Teki 348*d1d4295aSJagan Teki&tcon0_out { 349*d1d4295aSJagan Teki tcon0_out_vga: endpoint@0 { 350*d1d4295aSJagan Teki reg = <0>; 351*d1d4295aSJagan Teki remote-endpoint = <&vga_dac_in>; 352*d1d4295aSJagan Teki }; 353*d1d4295aSJagan Teki}; 354*d1d4295aSJagan Teki 35553ab4af3SHans de Goede&uart0 { 35653ab4af3SHans de Goede pinctrl-names = "default"; 35753ab4af3SHans de Goede pinctrl-0 = <&uart0_pins_a>; 35853ab4af3SHans de Goede status = "okay"; 35953ab4af3SHans de Goede}; 36053ab4af3SHans de Goede 361*d1d4295aSJagan Teki&usb_otg { 362*d1d4295aSJagan Teki dr_mode = "otg"; 363*d1d4295aSJagan Teki status = "okay"; 364*d1d4295aSJagan Teki}; 365*d1d4295aSJagan Teki 366*d1d4295aSJagan Teki&usb_power_supply { 367*d1d4295aSJagan Teki status = "okay"; 36853ab4af3SHans de Goede}; 36953ab4af3SHans de Goede 37053ab4af3SHans de Goede&usbphy { 371*d1d4295aSJagan Teki usb0_id_det-gpio = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */ 372*d1d4295aSJagan Teki usb0_vbus_det-gpio = <&pio 0 16 GPIO_ACTIVE_HIGH>; /* PA16 */ 373*d1d4295aSJagan Teki usb0_vbus_power-supply = <&usb_power_supply>; 374*d1d4295aSJagan Teki usb0_vbus-supply = <®_drivevbus>; 37553ab4af3SHans de Goede usb1_vbus-supply = <®_usb1_vbus>; 37653ab4af3SHans de Goede status = "okay"; 37753ab4af3SHans de Goede}; 378