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