1724ba675SRob Herring/* 2724ba675SRob Herring * Copyright 2015 Free Electrons 3724ba675SRob Herring * Copyright 2015 NextThing Co 4724ba675SRob Herring * 5724ba675SRob Herring * Maxime Ripard <maxime.ripard@free-electrons.com> 6724ba675SRob Herring * 7724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms 8724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual 9724ba675SRob Herring * licensing only applies to this file, and not this project as a 10724ba675SRob Herring * whole. 11724ba675SRob Herring * 12724ba675SRob Herring * a) This file is free software; you can redistribute it and/or 13724ba675SRob Herring * modify it under the terms of the GNU General Public License as 14724ba675SRob Herring * published by the Free Software Foundation; either version 2 of the 15724ba675SRob Herring * License, or (at your option) any later version. 16724ba675SRob Herring * 17724ba675SRob Herring * This file is distributed in the hope that it will be useful, 18724ba675SRob Herring * but WITHOUT ANY WARRANTY; without even the implied warranty of 19724ba675SRob Herring * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20724ba675SRob Herring * GNU General Public License for more details. 21724ba675SRob Herring * 22724ba675SRob Herring * Or, alternatively, 23724ba675SRob Herring * 24724ba675SRob Herring * b) Permission is hereby granted, free of charge, to any person 25724ba675SRob Herring * obtaining a copy of this software and associated documentation 26724ba675SRob Herring * files (the "Software"), to deal in the Software without 27724ba675SRob Herring * restriction, including without limitation the rights to use, 28724ba675SRob Herring * copy, modify, merge, publish, distribute, sublicense, and/or 29724ba675SRob Herring * sell copies of the Software, and to permit persons to whom the 30724ba675SRob Herring * Software is furnished to do so, subject to the following 31724ba675SRob Herring * conditions: 32724ba675SRob Herring * 33724ba675SRob Herring * The above copyright notice and this permission notice shall be 34724ba675SRob Herring * included in all copies or substantial portions of the Software. 35724ba675SRob Herring * 36724ba675SRob Herring * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37724ba675SRob Herring * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38724ba675SRob Herring * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39724ba675SRob Herring * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40724ba675SRob Herring * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 41724ba675SRob Herring * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42724ba675SRob Herring * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43724ba675SRob Herring * OTHER DEALINGS IN THE SOFTWARE. 44724ba675SRob Herring */ 45724ba675SRob Herring 46724ba675SRob Herring/dts-v1/; 47724ba675SRob Herring#include "sun5i-r8.dtsi" 48724ba675SRob Herring#include "sunxi-common-regulators.dtsi" 49724ba675SRob Herring 50724ba675SRob Herring#include <dt-bindings/gpio/gpio.h> 51724ba675SRob Herring#include <dt-bindings/interrupt-controller/irq.h> 52724ba675SRob Herring 53724ba675SRob Herring/ { 54724ba675SRob Herring model = "NextThing C.H.I.P."; 55724ba675SRob Herring compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13"; 56724ba675SRob Herring 57724ba675SRob Herring aliases { 58724ba675SRob Herring i2c0 = &i2c0; 59724ba675SRob Herring i2c1 = &i2c1; 60724ba675SRob Herring i2c2 = &i2c2; 61724ba675SRob Herring serial0 = &uart1; 62724ba675SRob Herring serial1 = &uart3; 63724ba675SRob Herring spi0 = &spi2; 64724ba675SRob Herring }; 65724ba675SRob Herring 66724ba675SRob Herring chosen { 67724ba675SRob Herring stdout-path = "serial0:115200n8"; 68724ba675SRob Herring }; 69724ba675SRob Herring 70724ba675SRob Herring leds { 71724ba675SRob Herring compatible = "gpio-leds"; 72724ba675SRob Herring 73724ba675SRob Herring led-0 { 74724ba675SRob Herring label = "chip:white:status"; 75724ba675SRob Herring gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>; 76724ba675SRob Herring default-state = "on"; 77724ba675SRob Herring }; 78724ba675SRob Herring }; 79724ba675SRob Herring 80*0f47ef3fSKrzysztof Kozlowski mmc0_pwrseq: pwrseq { 81724ba675SRob Herring compatible = "mmc-pwrseq-simple"; 82724ba675SRob Herring reset-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */ 83724ba675SRob Herring }; 84724ba675SRob Herring 85724ba675SRob Herring onewire { 86724ba675SRob Herring compatible = "w1-gpio"; 87724ba675SRob Herring gpios = <&pio 3 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PD2 */ 88724ba675SRob Herring }; 89724ba675SRob Herring}; 90724ba675SRob Herring 91724ba675SRob Herring&be0 { 92724ba675SRob Herring status = "okay"; 93724ba675SRob Herring}; 94724ba675SRob Herring 95724ba675SRob Herring&codec { 96724ba675SRob Herring status = "okay"; 97724ba675SRob Herring}; 98724ba675SRob Herring 99724ba675SRob Herring&cpu0 { 100724ba675SRob Herring cpu-supply = <®_dcdc2>; 101724ba675SRob Herring}; 102724ba675SRob Herring 103724ba675SRob Herring&ehci0 { 104724ba675SRob Herring status = "okay"; 105724ba675SRob Herring}; 106724ba675SRob Herring 107724ba675SRob Herring&i2c0 { 108724ba675SRob Herring status = "okay"; 109724ba675SRob Herring 110724ba675SRob Herring axp209: pmic@34 { 111724ba675SRob Herring reg = <0x34>; 112724ba675SRob Herring 113724ba675SRob Herring /* 114724ba675SRob Herring * The interrupt is routed through the "External Fast 115724ba675SRob Herring * Interrupt Request" pin (ball G13 of the module) 116724ba675SRob Herring * directly to the main interrupt controller, without 117724ba675SRob Herring * any other controller interfering. 118724ba675SRob Herring */ 119724ba675SRob Herring interrupts = <0>; 120724ba675SRob Herring }; 121724ba675SRob Herring}; 122724ba675SRob Herring 123724ba675SRob Herring#include "axp209.dtsi" 124724ba675SRob Herring 125724ba675SRob Herring&ac_power_supply { 126724ba675SRob Herring status = "okay"; 127724ba675SRob Herring}; 128724ba675SRob Herring 129724ba675SRob Herring&battery_power_supply { 130724ba675SRob Herring status = "okay"; 131724ba675SRob Herring}; 132724ba675SRob Herring 133724ba675SRob Herring&i2c1 { 134724ba675SRob Herring status = "disabled"; 135724ba675SRob Herring}; 136724ba675SRob Herring 137724ba675SRob Herring&i2c2 { 138724ba675SRob Herring status = "okay"; 139724ba675SRob Herring 140724ba675SRob Herring xio: gpio@38 { 141724ba675SRob Herring compatible = "nxp,pcf8574a"; 142724ba675SRob Herring reg = <0x38>; 143724ba675SRob Herring 144724ba675SRob Herring gpio-controller; 145724ba675SRob Herring #gpio-cells = <2>; 146724ba675SRob Herring 147724ba675SRob Herring interrupt-parent = <&pio>; 148724ba675SRob Herring interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>; 149724ba675SRob Herring interrupt-controller; 150724ba675SRob Herring #interrupt-cells = <2>; 151724ba675SRob Herring }; 152724ba675SRob Herring}; 153724ba675SRob Herring 154724ba675SRob Herring&mmc0_pins { 155724ba675SRob Herring bias-pull-up; 156724ba675SRob Herring}; 157724ba675SRob Herring 158724ba675SRob Herring&mmc0 { 159724ba675SRob Herring vmmc-supply = <®_vcc3v3>; 160724ba675SRob Herring mmc-pwrseq = <&mmc0_pwrseq>; 161724ba675SRob Herring bus-width = <4>; 162724ba675SRob Herring non-removable; 163724ba675SRob Herring status = "okay"; 164724ba675SRob Herring}; 165724ba675SRob Herring 166724ba675SRob Herring&ohci0 { 167724ba675SRob Herring status = "okay"; 168724ba675SRob Herring}; 169724ba675SRob Herring 170724ba675SRob Herring&otg_sram { 171724ba675SRob Herring status = "okay"; 172724ba675SRob Herring}; 173724ba675SRob Herring 174724ba675SRob Herring®_dcdc2 { 175724ba675SRob Herring regulator-min-microvolt = <1000000>; 176724ba675SRob Herring regulator-max-microvolt = <1400000>; 177724ba675SRob Herring regulator-name = "cpuvdd"; 178724ba675SRob Herring regulator-always-on; 179724ba675SRob Herring}; 180724ba675SRob Herring 181724ba675SRob Herring®_dcdc3 { 182724ba675SRob Herring regulator-min-microvolt = <1000000>; 183724ba675SRob Herring regulator-max-microvolt = <1300000>; 184724ba675SRob Herring regulator-name = "corevdd"; 185724ba675SRob Herring regulator-always-on; 186724ba675SRob Herring}; 187724ba675SRob Herring 188724ba675SRob Herring®_ldo1 { 189724ba675SRob Herring regulator-name = "rtcvdd"; 190724ba675SRob Herring}; 191724ba675SRob Herring 192724ba675SRob Herring®_ldo2 { 193724ba675SRob Herring regulator-min-microvolt = <2700000>; 194724ba675SRob Herring regulator-max-microvolt = <3300000>; 195724ba675SRob Herring regulator-name = "avcc"; 196724ba675SRob Herring regulator-always-on; 197724ba675SRob Herring}; 198724ba675SRob Herring 199724ba675SRob Herring/* 200724ba675SRob Herring * Both LDO3 and LDO4 are used in parallel to power up the WiFi/BT 201724ba675SRob Herring * Chip. 202724ba675SRob Herring * 203724ba675SRob Herring * If those are not enabled, the SDIO part will not enumerate, and 204724ba675SRob Herring * since there's no way currently to pass DT infos to an SDIO device, 205724ba675SRob Herring * we cannot really do better than this ugly hack for now. 206724ba675SRob Herring */ 207724ba675SRob Herring®_ldo3 { 208724ba675SRob Herring regulator-min-microvolt = <3300000>; 209724ba675SRob Herring regulator-max-microvolt = <3300000>; 210724ba675SRob Herring regulator-name = "vcc-wifi-1"; 211724ba675SRob Herring regulator-always-on; 212724ba675SRob Herring}; 213724ba675SRob Herring 214724ba675SRob Herring®_ldo4 { 215724ba675SRob Herring regulator-min-microvolt = <3300000>; 216724ba675SRob Herring regulator-max-microvolt = <3300000>; 217724ba675SRob Herring regulator-name = "vcc-wifi-2"; 218724ba675SRob Herring regulator-always-on; 219724ba675SRob Herring}; 220724ba675SRob Herring 221724ba675SRob Herring®_ldo5 { 222724ba675SRob Herring regulator-min-microvolt = <1800000>; 223724ba675SRob Herring regulator-max-microvolt = <1800000>; 224724ba675SRob Herring regulator-name = "vcc-1v8"; 225724ba675SRob Herring}; 226724ba675SRob Herring 227724ba675SRob Herring®_usb0_vbus { 228724ba675SRob Herring vin-supply = <®_vcc5v0>; 229724ba675SRob Herring gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */ 230724ba675SRob Herring status = "okay"; 231724ba675SRob Herring}; 232724ba675SRob Herring 233724ba675SRob Herring&spi2 { 234724ba675SRob Herring pinctrl-names = "default"; 235724ba675SRob Herring pinctrl-0 = <&spi2_pe_pins>; 236724ba675SRob Herring status = "disabled"; 237724ba675SRob Herring}; 238724ba675SRob Herring 239724ba675SRob Herring&tcon0 { 240724ba675SRob Herring status = "okay"; 241724ba675SRob Herring}; 242724ba675SRob Herring 243724ba675SRob Herring&tve0 { 244724ba675SRob Herring status = "okay"; 245724ba675SRob Herring}; 246724ba675SRob Herring 247724ba675SRob Herring&uart1 { 248724ba675SRob Herring pinctrl-names = "default"; 249724ba675SRob Herring pinctrl-0 = <&uart1_pg_pins>; 250724ba675SRob Herring status = "okay"; 251724ba675SRob Herring}; 252724ba675SRob Herring 253724ba675SRob Herring&uart3 { 254724ba675SRob Herring pinctrl-names = "default"; 255724ba675SRob Herring pinctrl-0 = <&uart3_pg_pins>, 256724ba675SRob Herring <&uart3_cts_rts_pg_pins>; 257724ba675SRob Herring status = "okay"; 258724ba675SRob Herring 259724ba675SRob Herring bluetooth { 260724ba675SRob Herring compatible = "realtek,rtl8723bs-bt"; 261724ba675SRob Herring device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_HIGH>; 262724ba675SRob Herring host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ 263724ba675SRob Herring }; 264724ba675SRob Herring}; 265724ba675SRob Herring 266724ba675SRob Herring&usb_otg { 267724ba675SRob Herring dr_mode = "otg"; 268724ba675SRob Herring status = "okay"; 269724ba675SRob Herring}; 270724ba675SRob Herring 271724ba675SRob Herring&usb_power_supply { 272724ba675SRob Herring status = "okay"; 273724ba675SRob Herring}; 274724ba675SRob Herring 275724ba675SRob Herring&usbphy { 276724ba675SRob Herring status = "okay"; 277724ba675SRob Herring 278724ba675SRob Herring usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ 279724ba675SRob Herring usb0_vbus_power-supply = <&usb_power_supply>; 280724ba675SRob Herring usb0_vbus-supply = <®_usb0_vbus>; 281724ba675SRob Herring usb1_vbus-supply = <®_vcc5v0>; 282724ba675SRob Herring}; 283