1*f126890aSEmmanuel Vadot/* 2*f126890aSEmmanuel Vadot * Copyright 2016 Free Electrons 3*f126890aSEmmanuel Vadot * Copyright 2016 NextThing Co 4*f126890aSEmmanuel Vadot * 5*f126890aSEmmanuel Vadot * Mylène Josserand <mylene.josserand@free-electrons.com> 6*f126890aSEmmanuel Vadot * 7*f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms 8*f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual 9*f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a 10*f126890aSEmmanuel Vadot * whole. 11*f126890aSEmmanuel Vadot * 12*f126890aSEmmanuel Vadot * a) This file is free software; you can redistribute it and/or 13*f126890aSEmmanuel Vadot * modify it under the terms of the GNU General Public License as 14*f126890aSEmmanuel Vadot * published by the Free Software Foundation; either version 2 of the 15*f126890aSEmmanuel Vadot * License, or (at your option) any later version. 16*f126890aSEmmanuel Vadot * 17*f126890aSEmmanuel Vadot * This file is distributed in the hope that it will be useful, 18*f126890aSEmmanuel Vadot * but WITHOUT ANY WARRANTY; without even the implied warranty of 19*f126890aSEmmanuel Vadot * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20*f126890aSEmmanuel Vadot * GNU General Public License for more details. 21*f126890aSEmmanuel Vadot * 22*f126890aSEmmanuel Vadot * Or, alternatively, 23*f126890aSEmmanuel Vadot * 24*f126890aSEmmanuel Vadot * b) Permission is hereby granted, free of charge, to any person 25*f126890aSEmmanuel Vadot * obtaining a copy of this software and associated documentation 26*f126890aSEmmanuel Vadot * files (the "Software"), to deal in the Software without 27*f126890aSEmmanuel Vadot * restriction, including without limitation the rights to use, 28*f126890aSEmmanuel Vadot * copy, modify, merge, publish, distribute, sublicense, and/or 29*f126890aSEmmanuel Vadot * sell copies of the Software, and to permit persons to whom the 30*f126890aSEmmanuel Vadot * Software is furnished to do so, subject to the following 31*f126890aSEmmanuel Vadot * conditions: 32*f126890aSEmmanuel Vadot * 33*f126890aSEmmanuel Vadot * The above copyright notice and this permission notice shall be 34*f126890aSEmmanuel Vadot * included in all copies or substantial portions of the Software. 35*f126890aSEmmanuel Vadot * 36*f126890aSEmmanuel Vadot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37*f126890aSEmmanuel Vadot * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38*f126890aSEmmanuel Vadot * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39*f126890aSEmmanuel Vadot * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40*f126890aSEmmanuel Vadot * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 41*f126890aSEmmanuel Vadot * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42*f126890aSEmmanuel Vadot * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43*f126890aSEmmanuel Vadot * OTHER DEALINGS IN THE SOFTWARE. 44*f126890aSEmmanuel Vadot */ 45*f126890aSEmmanuel Vadot 46*f126890aSEmmanuel Vadot/dts-v1/; 47*f126890aSEmmanuel Vadot#include "sun5i-gr8.dtsi" 48*f126890aSEmmanuel Vadot#include "sunxi-common-regulators.dtsi" 49*f126890aSEmmanuel Vadot 50*f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 51*f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h> 52*f126890aSEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h> 53*f126890aSEmmanuel Vadot 54*f126890aSEmmanuel Vadot/ { 55*f126890aSEmmanuel Vadot model = "NextThing GR8-EVB"; 56*f126890aSEmmanuel Vadot compatible = "nextthing,gr8-evb", "nextthing,gr8"; 57*f126890aSEmmanuel Vadot 58*f126890aSEmmanuel Vadot aliases { 59*f126890aSEmmanuel Vadot i2c0 = &i2c0; 60*f126890aSEmmanuel Vadot i2c1 = &i2c1; 61*f126890aSEmmanuel Vadot i2c2 = &i2c2; 62*f126890aSEmmanuel Vadot serial0 = &uart1; 63*f126890aSEmmanuel Vadot serial1 = &uart2; 64*f126890aSEmmanuel Vadot }; 65*f126890aSEmmanuel Vadot 66*f126890aSEmmanuel Vadot chosen { 67*f126890aSEmmanuel Vadot stdout-path = "serial0:115200n8"; 68*f126890aSEmmanuel Vadot }; 69*f126890aSEmmanuel Vadot 70*f126890aSEmmanuel Vadot backlight: backlight { 71*f126890aSEmmanuel Vadot compatible = "pwm-backlight"; 72*f126890aSEmmanuel Vadot pwms = <&pwm 0 10000 0>; 73*f126890aSEmmanuel Vadot enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>; 74*f126890aSEmmanuel Vadot power-supply = <®_vcc3v3>; 75*f126890aSEmmanuel Vadot brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; 76*f126890aSEmmanuel Vadot default-brightness-level = <8>; 77*f126890aSEmmanuel Vadot }; 78*f126890aSEmmanuel Vadot 79*f126890aSEmmanuel Vadot sound-analog { 80*f126890aSEmmanuel Vadot compatible = "simple-audio-card"; 81*f126890aSEmmanuel Vadot simple-audio-card,name = "gr8-evb-wm8978"; 82*f126890aSEmmanuel Vadot simple-audio-card,format = "i2s"; 83*f126890aSEmmanuel Vadot simple-audio-card,mclk-fs = <512>; 84*f126890aSEmmanuel Vadot 85*f126890aSEmmanuel Vadot simple-audio-card,cpu { 86*f126890aSEmmanuel Vadot sound-dai = <&i2s0>; 87*f126890aSEmmanuel Vadot }; 88*f126890aSEmmanuel Vadot 89*f126890aSEmmanuel Vadot simple-audio-card,codec { 90*f126890aSEmmanuel Vadot sound-dai = <&wm8978>; 91*f126890aSEmmanuel Vadot }; 92*f126890aSEmmanuel Vadot }; 93*f126890aSEmmanuel Vadot 94*f126890aSEmmanuel Vadot sound-spdif { 95*f126890aSEmmanuel Vadot compatible = "simple-audio-card"; 96*f126890aSEmmanuel Vadot simple-audio-card,name = "On-board SPDIF"; 97*f126890aSEmmanuel Vadot 98*f126890aSEmmanuel Vadot simple-audio-card,cpu { 99*f126890aSEmmanuel Vadot sound-dai = <&spdif>; 100*f126890aSEmmanuel Vadot }; 101*f126890aSEmmanuel Vadot 102*f126890aSEmmanuel Vadot simple-audio-card,codec { 103*f126890aSEmmanuel Vadot sound-dai = <&spdif_out>; 104*f126890aSEmmanuel Vadot }; 105*f126890aSEmmanuel Vadot }; 106*f126890aSEmmanuel Vadot 107*f126890aSEmmanuel Vadot spdif_out: spdif-out { 108*f126890aSEmmanuel Vadot #sound-dai-cells = <0>; 109*f126890aSEmmanuel Vadot compatible = "linux,spdif-dit"; 110*f126890aSEmmanuel Vadot }; 111*f126890aSEmmanuel Vadot}; 112*f126890aSEmmanuel Vadot 113*f126890aSEmmanuel Vadot&be0 { 114*f126890aSEmmanuel Vadot status = "okay"; 115*f126890aSEmmanuel Vadot}; 116*f126890aSEmmanuel Vadot 117*f126890aSEmmanuel Vadot&codec { 118*f126890aSEmmanuel Vadot status = "okay"; 119*f126890aSEmmanuel Vadot}; 120*f126890aSEmmanuel Vadot 121*f126890aSEmmanuel Vadot&ehci0 { 122*f126890aSEmmanuel Vadot status = "okay"; 123*f126890aSEmmanuel Vadot}; 124*f126890aSEmmanuel Vadot 125*f126890aSEmmanuel Vadot&i2c0 { 126*f126890aSEmmanuel Vadot status = "okay"; 127*f126890aSEmmanuel Vadot 128*f126890aSEmmanuel Vadot axp209: pmic@34 { 129*f126890aSEmmanuel Vadot reg = <0x34>; 130*f126890aSEmmanuel Vadot 131*f126890aSEmmanuel Vadot /* 132*f126890aSEmmanuel Vadot * The interrupt is routed through the "External Fast 133*f126890aSEmmanuel Vadot * Interrupt Request" pin (ball G13 of the module) 134*f126890aSEmmanuel Vadot * directly to the main interrupt controller, without 135*f126890aSEmmanuel Vadot * any other controller interfering. 136*f126890aSEmmanuel Vadot */ 137*f126890aSEmmanuel Vadot interrupts = <0>; 138*f126890aSEmmanuel Vadot }; 139*f126890aSEmmanuel Vadot}; 140*f126890aSEmmanuel Vadot 141*f126890aSEmmanuel Vadot#include "axp209.dtsi" 142*f126890aSEmmanuel Vadot 143*f126890aSEmmanuel Vadot&i2c1 { 144*f126890aSEmmanuel Vadot status = "okay"; 145*f126890aSEmmanuel Vadot 146*f126890aSEmmanuel Vadot wm8978: codec@1a { 147*f126890aSEmmanuel Vadot #sound-dai-cells = <0>; 148*f126890aSEmmanuel Vadot compatible = "wlf,wm8978"; 149*f126890aSEmmanuel Vadot reg = <0x1a>; 150*f126890aSEmmanuel Vadot }; 151*f126890aSEmmanuel Vadot 152*f126890aSEmmanuel Vadot pcf8563: rtc@51 { 153*f126890aSEmmanuel Vadot compatible = "nxp,pcf8563"; 154*f126890aSEmmanuel Vadot reg = <0x51>; 155*f126890aSEmmanuel Vadot }; 156*f126890aSEmmanuel Vadot}; 157*f126890aSEmmanuel Vadot 158*f126890aSEmmanuel Vadot&i2c2 { 159*f126890aSEmmanuel Vadot status = "okay"; 160*f126890aSEmmanuel Vadot}; 161*f126890aSEmmanuel Vadot 162*f126890aSEmmanuel Vadot&i2s0 { 163*f126890aSEmmanuel Vadot pinctrl-names = "default"; 164*f126890aSEmmanuel Vadot pinctrl-0 = <&i2s0_mclk_pin>, <&i2s0_data_pins>; 165*f126890aSEmmanuel Vadot status = "okay"; 166*f126890aSEmmanuel Vadot}; 167*f126890aSEmmanuel Vadot 168*f126890aSEmmanuel Vadot&ir0 { 169*f126890aSEmmanuel Vadot pinctrl-names = "default"; 170*f126890aSEmmanuel Vadot pinctrl-0 = <&ir0_rx_pin>; 171*f126890aSEmmanuel Vadot status = "okay"; 172*f126890aSEmmanuel Vadot}; 173*f126890aSEmmanuel Vadot 174*f126890aSEmmanuel Vadot&lradc { 175*f126890aSEmmanuel Vadot vref-supply = <®_ldo2>; 176*f126890aSEmmanuel Vadot status = "okay"; 177*f126890aSEmmanuel Vadot 178*f126890aSEmmanuel Vadot button-190 { 179*f126890aSEmmanuel Vadot label = "Volume Up"; 180*f126890aSEmmanuel Vadot linux,code = <KEY_VOLUMEUP>; 181*f126890aSEmmanuel Vadot channel = <0>; 182*f126890aSEmmanuel Vadot voltage = <190000>; 183*f126890aSEmmanuel Vadot }; 184*f126890aSEmmanuel Vadot 185*f126890aSEmmanuel Vadot button-390 { 186*f126890aSEmmanuel Vadot label = "Volume Down"; 187*f126890aSEmmanuel Vadot linux,code = <KEY_VOLUMEDOWN>; 188*f126890aSEmmanuel Vadot channel = <0>; 189*f126890aSEmmanuel Vadot voltage = <390000>; 190*f126890aSEmmanuel Vadot }; 191*f126890aSEmmanuel Vadot 192*f126890aSEmmanuel Vadot button-600 { 193*f126890aSEmmanuel Vadot label = "Menu"; 194*f126890aSEmmanuel Vadot linux,code = <KEY_MENU>; 195*f126890aSEmmanuel Vadot channel = <0>; 196*f126890aSEmmanuel Vadot voltage = <600000>; 197*f126890aSEmmanuel Vadot }; 198*f126890aSEmmanuel Vadot 199*f126890aSEmmanuel Vadot button-800 { 200*f126890aSEmmanuel Vadot label = "Search"; 201*f126890aSEmmanuel Vadot linux,code = <KEY_SEARCH>; 202*f126890aSEmmanuel Vadot channel = <0>; 203*f126890aSEmmanuel Vadot voltage = <800000>; 204*f126890aSEmmanuel Vadot }; 205*f126890aSEmmanuel Vadot 206*f126890aSEmmanuel Vadot button-980 { 207*f126890aSEmmanuel Vadot label = "Home"; 208*f126890aSEmmanuel Vadot linux,code = <KEY_HOMEPAGE>; 209*f126890aSEmmanuel Vadot channel = <0>; 210*f126890aSEmmanuel Vadot voltage = <980000>; 211*f126890aSEmmanuel Vadot }; 212*f126890aSEmmanuel Vadot 213*f126890aSEmmanuel Vadot button-1180 { 214*f126890aSEmmanuel Vadot label = "Esc"; 215*f126890aSEmmanuel Vadot linux,code = <KEY_ESC>; 216*f126890aSEmmanuel Vadot channel = <0>; 217*f126890aSEmmanuel Vadot voltage = <1180000>; 218*f126890aSEmmanuel Vadot }; 219*f126890aSEmmanuel Vadot 220*f126890aSEmmanuel Vadot button-1400 { 221*f126890aSEmmanuel Vadot label = "Enter"; 222*f126890aSEmmanuel Vadot linux,code = <KEY_ENTER>; 223*f126890aSEmmanuel Vadot channel = <0>; 224*f126890aSEmmanuel Vadot voltage = <1400000>; 225*f126890aSEmmanuel Vadot }; 226*f126890aSEmmanuel Vadot}; 227*f126890aSEmmanuel Vadot 228*f126890aSEmmanuel Vadot&mmc0 { 229*f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 230*f126890aSEmmanuel Vadot bus-width = <4>; 231*f126890aSEmmanuel Vadot cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */ 232*f126890aSEmmanuel Vadot status = "okay"; 233*f126890aSEmmanuel Vadot}; 234*f126890aSEmmanuel Vadot 235*f126890aSEmmanuel Vadot&nfc { 236*f126890aSEmmanuel Vadot pinctrl-names = "default"; 237*f126890aSEmmanuel Vadot pinctrl-0 = <&nand_pins &nand_cs0_pin &nand_rb0_pin>; 238*f126890aSEmmanuel Vadot 239*f126890aSEmmanuel Vadot /* MLC Support sucks for now */ 240*f126890aSEmmanuel Vadot status = "disabled"; 241*f126890aSEmmanuel Vadot}; 242*f126890aSEmmanuel Vadot 243*f126890aSEmmanuel Vadot&ohci0 { 244*f126890aSEmmanuel Vadot status = "okay"; 245*f126890aSEmmanuel Vadot}; 246*f126890aSEmmanuel Vadot 247*f126890aSEmmanuel Vadot&otg_sram { 248*f126890aSEmmanuel Vadot status = "okay"; 249*f126890aSEmmanuel Vadot}; 250*f126890aSEmmanuel Vadot 251*f126890aSEmmanuel Vadot&pwm { 252*f126890aSEmmanuel Vadot pinctrl-names = "default"; 253*f126890aSEmmanuel Vadot pinctrl-0 = <&pwm0_pin>; 254*f126890aSEmmanuel Vadot status = "okay"; 255*f126890aSEmmanuel Vadot}; 256*f126890aSEmmanuel Vadot 257*f126890aSEmmanuel Vadot®_dcdc2 { 258*f126890aSEmmanuel Vadot regulator-min-microvolt = <1000000>; 259*f126890aSEmmanuel Vadot regulator-max-microvolt = <1400000>; 260*f126890aSEmmanuel Vadot regulator-name = "vdd-cpu"; 261*f126890aSEmmanuel Vadot regulator-always-on; 262*f126890aSEmmanuel Vadot}; 263*f126890aSEmmanuel Vadot 264*f126890aSEmmanuel Vadot®_dcdc3 { 265*f126890aSEmmanuel Vadot regulator-min-microvolt = <1000000>; 266*f126890aSEmmanuel Vadot regulator-max-microvolt = <1300000>; 267*f126890aSEmmanuel Vadot regulator-name = "vdd-sys"; 268*f126890aSEmmanuel Vadot regulator-always-on; 269*f126890aSEmmanuel Vadot}; 270*f126890aSEmmanuel Vadot 271*f126890aSEmmanuel Vadot®_ldo1 { 272*f126890aSEmmanuel Vadot regulator-name = "vdd-rtc"; 273*f126890aSEmmanuel Vadot}; 274*f126890aSEmmanuel Vadot 275*f126890aSEmmanuel Vadot®_ldo2 { 276*f126890aSEmmanuel Vadot regulator-min-microvolt = <2700000>; 277*f126890aSEmmanuel Vadot regulator-max-microvolt = <3300000>; 278*f126890aSEmmanuel Vadot regulator-name = "avcc"; 279*f126890aSEmmanuel Vadot regulator-always-on; 280*f126890aSEmmanuel Vadot}; 281*f126890aSEmmanuel Vadot 282*f126890aSEmmanuel Vadot®_usb1_vbus { 283*f126890aSEmmanuel Vadot gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; 284*f126890aSEmmanuel Vadot status = "okay"; 285*f126890aSEmmanuel Vadot}; 286*f126890aSEmmanuel Vadot 287*f126890aSEmmanuel Vadot&rtp { 288*f126890aSEmmanuel Vadot allwinner,ts-attached; 289*f126890aSEmmanuel Vadot}; 290*f126890aSEmmanuel Vadot 291*f126890aSEmmanuel Vadot&spdif { 292*f126890aSEmmanuel Vadot pinctrl-names = "default"; 293*f126890aSEmmanuel Vadot pinctrl-0 = <&spdif_tx_pin>; 294*f126890aSEmmanuel Vadot status = "okay"; 295*f126890aSEmmanuel Vadot}; 296*f126890aSEmmanuel Vadot 297*f126890aSEmmanuel Vadot&tve0 { 298*f126890aSEmmanuel Vadot status = "okay"; 299*f126890aSEmmanuel Vadot}; 300*f126890aSEmmanuel Vadot 301*f126890aSEmmanuel Vadot&uart1 { 302*f126890aSEmmanuel Vadot pinctrl-names = "default"; 303*f126890aSEmmanuel Vadot pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pins>; 304*f126890aSEmmanuel Vadot status = "okay"; 305*f126890aSEmmanuel Vadot}; 306*f126890aSEmmanuel Vadot 307*f126890aSEmmanuel Vadot&usb_otg { 308*f126890aSEmmanuel Vadot /* 309*f126890aSEmmanuel Vadot * The GR8-EVB has a somewhat interesting design. There's a 310*f126890aSEmmanuel Vadot * pin supposed to control VBUS, an ID pin, a VBUS detect pin, 311*f126890aSEmmanuel Vadot * so everything should work just fine. 312*f126890aSEmmanuel Vadot * 313*f126890aSEmmanuel Vadot * Except that the pin supposed to control VBUS is not 314*f126890aSEmmanuel Vadot * connected to any controllable output, neither to the SoC 315*f126890aSEmmanuel Vadot * through a GPIO or to the PMIC, and it is pulled down, 316*f126890aSEmmanuel Vadot * meaning that we will never be able to enable VBUS on this 317*f126890aSEmmanuel Vadot * board. 318*f126890aSEmmanuel Vadot */ 319*f126890aSEmmanuel Vadot dr_mode = "otg"; 320*f126890aSEmmanuel Vadot status = "okay"; 321*f126890aSEmmanuel Vadot}; 322*f126890aSEmmanuel Vadot 323*f126890aSEmmanuel Vadot&usb_power_supply { 324*f126890aSEmmanuel Vadot status = "okay"; 325*f126890aSEmmanuel Vadot}; 326*f126890aSEmmanuel Vadot 327*f126890aSEmmanuel Vadot&usbphy { 328*f126890aSEmmanuel Vadot usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ 329*f126890aSEmmanuel Vadot usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 330*f126890aSEmmanuel Vadot usb0_vbus_power-supply = <&usb_power_supply>; 331*f126890aSEmmanuel Vadot usb1_vbus-supply = <®_usb1_vbus>; 332*f126890aSEmmanuel Vadot status = "okay"; 333*f126890aSEmmanuel Vadot}; 334