1*4882a593Smuzhiyun/* 2*4882a593Smuzhiyun * Copyright 2015 Free Electrons 3*4882a593Smuzhiyun * Copyright 2015 NextThing Co 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Maxime Ripard <maxime.ripard@free-electrons.com> 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * This file is dual-licensed: you can use it either under the terms 8*4882a593Smuzhiyun * of the GPL or the X11 license, at your option. Note that this dual 9*4882a593Smuzhiyun * licensing only applies to this file, and not this project as a 10*4882a593Smuzhiyun * whole. 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * a) This file is free software; you can redistribute it and/or 13*4882a593Smuzhiyun * modify it under the terms of the GNU General Public License as 14*4882a593Smuzhiyun * published by the Free Software Foundation; either version 2 of the 15*4882a593Smuzhiyun * License, or (at your option) any later version. 16*4882a593Smuzhiyun * 17*4882a593Smuzhiyun * This file is distributed in the hope that it will be useful, 18*4882a593Smuzhiyun * but WITHOUT ANY WARRANTY; without even the implied warranty of 19*4882a593Smuzhiyun * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20*4882a593Smuzhiyun * GNU General Public License for more details. 21*4882a593Smuzhiyun * 22*4882a593Smuzhiyun * Or, alternatively, 23*4882a593Smuzhiyun * 24*4882a593Smuzhiyun * b) Permission is hereby granted, free of charge, to any person 25*4882a593Smuzhiyun * obtaining a copy of this software and associated documentation 26*4882a593Smuzhiyun * files (the "Software"), to deal in the Software without 27*4882a593Smuzhiyun * restriction, including without limitation the rights to use, 28*4882a593Smuzhiyun * copy, modify, merge, publish, distribute, sublicense, and/or 29*4882a593Smuzhiyun * sell copies of the Software, and to permit persons to whom the 30*4882a593Smuzhiyun * Software is furnished to do so, subject to the following 31*4882a593Smuzhiyun * conditions: 32*4882a593Smuzhiyun * 33*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be 34*4882a593Smuzhiyun * included in all copies or substantial portions of the Software. 35*4882a593Smuzhiyun * 36*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37*4882a593Smuzhiyun * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38*4882a593Smuzhiyun * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39*4882a593Smuzhiyun * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40*4882a593Smuzhiyun * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 41*4882a593Smuzhiyun * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42*4882a593Smuzhiyun * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43*4882a593Smuzhiyun * OTHER DEALINGS IN THE SOFTWARE. 44*4882a593Smuzhiyun */ 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun/dts-v1/; 47*4882a593Smuzhiyun#include "sun5i-r8.dtsi" 48*4882a593Smuzhiyun#include "sunxi-common-regulators.dtsi" 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun#include <dt-bindings/gpio/gpio.h> 51*4882a593Smuzhiyun#include <dt-bindings/interrupt-controller/irq.h> 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun/ { 54*4882a593Smuzhiyun model = "NextThing C.H.I.P."; 55*4882a593Smuzhiyun compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13"; 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun aliases { 58*4882a593Smuzhiyun i2c0 = &i2c0; 59*4882a593Smuzhiyun i2c1 = &i2c1; 60*4882a593Smuzhiyun i2c2 = &i2c2; 61*4882a593Smuzhiyun serial0 = &uart1; 62*4882a593Smuzhiyun serial1 = &uart3; 63*4882a593Smuzhiyun spi0 = &spi2; 64*4882a593Smuzhiyun }; 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun chosen { 67*4882a593Smuzhiyun stdout-path = "serial0:115200n8"; 68*4882a593Smuzhiyun }; 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun leds { 71*4882a593Smuzhiyun compatible = "gpio-leds"; 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun status { 74*4882a593Smuzhiyun label = "chip:white:status"; 75*4882a593Smuzhiyun gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>; 76*4882a593Smuzhiyun default-state = "on"; 77*4882a593Smuzhiyun }; 78*4882a593Smuzhiyun }; 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun mmc0_pwrseq: mmc0_pwrseq { 81*4882a593Smuzhiyun compatible = "mmc-pwrseq-simple"; 82*4882a593Smuzhiyun reset-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */ 83*4882a593Smuzhiyun }; 84*4882a593Smuzhiyun 85*4882a593Smuzhiyun onewire { 86*4882a593Smuzhiyun compatible = "w1-gpio"; 87*4882a593Smuzhiyun gpios = <&pio 3 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PD2 */ 88*4882a593Smuzhiyun }; 89*4882a593Smuzhiyun}; 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun&be0 { 92*4882a593Smuzhiyun status = "okay"; 93*4882a593Smuzhiyun}; 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun&codec { 96*4882a593Smuzhiyun status = "okay"; 97*4882a593Smuzhiyun}; 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun&cpu0 { 100*4882a593Smuzhiyun cpu-supply = <®_dcdc2>; 101*4882a593Smuzhiyun}; 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun&ehci0 { 104*4882a593Smuzhiyun status = "okay"; 105*4882a593Smuzhiyun}; 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun&i2c0 { 108*4882a593Smuzhiyun status = "okay"; 109*4882a593Smuzhiyun 110*4882a593Smuzhiyun axp209: pmic@34 { 111*4882a593Smuzhiyun reg = <0x34>; 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun /* 114*4882a593Smuzhiyun * The interrupt is routed through the "External Fast 115*4882a593Smuzhiyun * Interrupt Request" pin (ball G13 of the module) 116*4882a593Smuzhiyun * directly to the main interrupt controller, without 117*4882a593Smuzhiyun * any other controller interfering. 118*4882a593Smuzhiyun */ 119*4882a593Smuzhiyun interrupts = <0>; 120*4882a593Smuzhiyun }; 121*4882a593Smuzhiyun}; 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun#include "axp209.dtsi" 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun&ac_power_supply { 126*4882a593Smuzhiyun status = "okay"; 127*4882a593Smuzhiyun}; 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun&battery_power_supply { 130*4882a593Smuzhiyun status = "okay"; 131*4882a593Smuzhiyun}; 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun&i2c1 { 134*4882a593Smuzhiyun status = "disabled"; 135*4882a593Smuzhiyun}; 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun&i2c2 { 138*4882a593Smuzhiyun status = "okay"; 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun xio: gpio@38 { 141*4882a593Smuzhiyun compatible = "nxp,pcf8574a"; 142*4882a593Smuzhiyun reg = <0x38>; 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun gpio-controller; 145*4882a593Smuzhiyun #gpio-cells = <2>; 146*4882a593Smuzhiyun 147*4882a593Smuzhiyun interrupt-parent = <&pio>; 148*4882a593Smuzhiyun interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>; 149*4882a593Smuzhiyun interrupt-controller; 150*4882a593Smuzhiyun #interrupt-cells = <2>; 151*4882a593Smuzhiyun }; 152*4882a593Smuzhiyun}; 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun&mmc0_pins { 155*4882a593Smuzhiyun bias-pull-up; 156*4882a593Smuzhiyun}; 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun&mmc0 { 159*4882a593Smuzhiyun vmmc-supply = <®_vcc3v3>; 160*4882a593Smuzhiyun mmc-pwrseq = <&mmc0_pwrseq>; 161*4882a593Smuzhiyun bus-width = <4>; 162*4882a593Smuzhiyun non-removable; 163*4882a593Smuzhiyun status = "okay"; 164*4882a593Smuzhiyun}; 165*4882a593Smuzhiyun 166*4882a593Smuzhiyun&ohci0 { 167*4882a593Smuzhiyun status = "okay"; 168*4882a593Smuzhiyun}; 169*4882a593Smuzhiyun 170*4882a593Smuzhiyun&otg_sram { 171*4882a593Smuzhiyun status = "okay"; 172*4882a593Smuzhiyun}; 173*4882a593Smuzhiyun 174*4882a593Smuzhiyun®_dcdc2 { 175*4882a593Smuzhiyun regulator-min-microvolt = <1000000>; 176*4882a593Smuzhiyun regulator-max-microvolt = <1400000>; 177*4882a593Smuzhiyun regulator-name = "cpuvdd"; 178*4882a593Smuzhiyun regulator-always-on; 179*4882a593Smuzhiyun}; 180*4882a593Smuzhiyun 181*4882a593Smuzhiyun®_dcdc3 { 182*4882a593Smuzhiyun regulator-min-microvolt = <1000000>; 183*4882a593Smuzhiyun regulator-max-microvolt = <1300000>; 184*4882a593Smuzhiyun regulator-name = "corevdd"; 185*4882a593Smuzhiyun regulator-always-on; 186*4882a593Smuzhiyun}; 187*4882a593Smuzhiyun 188*4882a593Smuzhiyun®_ldo1 { 189*4882a593Smuzhiyun regulator-name = "rtcvdd"; 190*4882a593Smuzhiyun}; 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun®_ldo2 { 193*4882a593Smuzhiyun regulator-min-microvolt = <2700000>; 194*4882a593Smuzhiyun regulator-max-microvolt = <3300000>; 195*4882a593Smuzhiyun regulator-name = "avcc"; 196*4882a593Smuzhiyun regulator-always-on; 197*4882a593Smuzhiyun}; 198*4882a593Smuzhiyun 199*4882a593Smuzhiyun/* 200*4882a593Smuzhiyun * Both LDO3 and LDO4 are used in parallel to power up the WiFi/BT 201*4882a593Smuzhiyun * Chip. 202*4882a593Smuzhiyun * 203*4882a593Smuzhiyun * If those are not enabled, the SDIO part will not enumerate, and 204*4882a593Smuzhiyun * since there's no way currently to pass DT infos to an SDIO device, 205*4882a593Smuzhiyun * we cannot really do better than this ugly hack for now. 206*4882a593Smuzhiyun */ 207*4882a593Smuzhiyun®_ldo3 { 208*4882a593Smuzhiyun regulator-min-microvolt = <3300000>; 209*4882a593Smuzhiyun regulator-max-microvolt = <3300000>; 210*4882a593Smuzhiyun regulator-name = "vcc-wifi-1"; 211*4882a593Smuzhiyun regulator-always-on; 212*4882a593Smuzhiyun}; 213*4882a593Smuzhiyun 214*4882a593Smuzhiyun®_ldo4 { 215*4882a593Smuzhiyun regulator-min-microvolt = <3300000>; 216*4882a593Smuzhiyun regulator-max-microvolt = <3300000>; 217*4882a593Smuzhiyun regulator-name = "vcc-wifi-2"; 218*4882a593Smuzhiyun regulator-always-on; 219*4882a593Smuzhiyun}; 220*4882a593Smuzhiyun 221*4882a593Smuzhiyun®_ldo5 { 222*4882a593Smuzhiyun regulator-min-microvolt = <1800000>; 223*4882a593Smuzhiyun regulator-max-microvolt = <1800000>; 224*4882a593Smuzhiyun regulator-name = "vcc-1v8"; 225*4882a593Smuzhiyun}; 226*4882a593Smuzhiyun 227*4882a593Smuzhiyun®_usb0_vbus { 228*4882a593Smuzhiyun vin-supply = <®_vcc5v0>; 229*4882a593Smuzhiyun gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */ 230*4882a593Smuzhiyun status = "okay"; 231*4882a593Smuzhiyun}; 232*4882a593Smuzhiyun 233*4882a593Smuzhiyun&spi2 { 234*4882a593Smuzhiyun pinctrl-names = "default"; 235*4882a593Smuzhiyun pinctrl-0 = <&spi2_pe_pins>; 236*4882a593Smuzhiyun status = "disabled"; 237*4882a593Smuzhiyun}; 238*4882a593Smuzhiyun 239*4882a593Smuzhiyun&tcon0 { 240*4882a593Smuzhiyun status = "okay"; 241*4882a593Smuzhiyun}; 242*4882a593Smuzhiyun 243*4882a593Smuzhiyun&tve0 { 244*4882a593Smuzhiyun status = "okay"; 245*4882a593Smuzhiyun}; 246*4882a593Smuzhiyun 247*4882a593Smuzhiyun&uart1 { 248*4882a593Smuzhiyun pinctrl-names = "default"; 249*4882a593Smuzhiyun pinctrl-0 = <&uart1_pg_pins>; 250*4882a593Smuzhiyun status = "okay"; 251*4882a593Smuzhiyun}; 252*4882a593Smuzhiyun 253*4882a593Smuzhiyun&uart3 { 254*4882a593Smuzhiyun pinctrl-names = "default"; 255*4882a593Smuzhiyun pinctrl-0 = <&uart3_pg_pins>, 256*4882a593Smuzhiyun <&uart3_cts_rts_pg_pins>; 257*4882a593Smuzhiyun status = "okay"; 258*4882a593Smuzhiyun}; 259*4882a593Smuzhiyun 260*4882a593Smuzhiyun&usb_otg { 261*4882a593Smuzhiyun dr_mode = "otg"; 262*4882a593Smuzhiyun status = "okay"; 263*4882a593Smuzhiyun}; 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun&usb_power_supply { 266*4882a593Smuzhiyun status = "okay"; 267*4882a593Smuzhiyun}; 268*4882a593Smuzhiyun 269*4882a593Smuzhiyun&usbphy { 270*4882a593Smuzhiyun status = "okay"; 271*4882a593Smuzhiyun 272*4882a593Smuzhiyun usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ 273*4882a593Smuzhiyun usb0_vbus_power-supply = <&usb_power_supply>; 274*4882a593Smuzhiyun usb0_vbus-supply = <®_usb0_vbus>; 275*4882a593Smuzhiyun usb1_vbus-supply = <®_vcc5v0>; 276*4882a593Smuzhiyun}; 277