0001 /*
0002 * Copyright 2016 Free Electrons
0003 * Copyright 2016 NextThing Co
0004 *
0005 * Maxime Ripard <maxime.ripard@free-electrons.com>
0006 *
0007 * This file is dual-licensed: you can use it either under the terms
0008 * of the GPL or the X11 license, at your option. Note that this dual
0009 * licensing only applies to this file, and not this project as a
0010 * whole.
0011 *
0012 * a) This file is free software; you can redistribute it and/or
0013 * modify it under the terms of the GNU General Public License as
0014 * published by the Free Software Foundation; either version 2 of the
0015 * License, or (at your option) any later version.
0016 *
0017 * This file is distributed in the hope that it will be useful,
0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020 * GNU General Public License for more details.
0021 *
0022 * Or, alternatively,
0023 *
0024 * b) Permission is hereby granted, free of charge, to any person
0025 * obtaining a copy of this software and associated documentation
0026 * files (the "Software"), to deal in the Software without
0027 * restriction, including without limitation the rights to use,
0028 * copy, modify, merge, publish, distribute, sublicense, and/or
0029 * sell copies of the Software, and to permit persons to whom the
0030 * Software is furnished to do so, subject to the following
0031 * conditions:
0032 *
0033 * The above copyright notice and this permission notice shall be
0034 * included in all copies or substantial portions of the Software.
0035 *
0036 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0037 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0038 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0039 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0040 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0041 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0042 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0043 * OTHER DEALINGS IN THE SOFTWARE.
0044 */
0045
0046 /dts-v1/;
0047 #include "sun5i-gr8.dtsi"
0048 #include "sunxi-common-regulators.dtsi"
0049
0050 #include <dt-bindings/gpio/gpio.h>
0051 #include <dt-bindings/input/input.h>
0052 #include <dt-bindings/interrupt-controller/irq.h>
0053
0054 / {
0055 model = "NextThing C.H.I.P. Pro";
0056 compatible = "nextthing,chip-pro", "nextthing,gr8";
0057
0058 aliases {
0059 i2c0 = &i2c0;
0060 i2c1 = &i2c1;
0061 serial0 = &uart1;
0062 serial1 = &uart2;
0063 serial2 = &uart3;
0064 };
0065
0066 chosen {
0067 stdout-path = "serial0:115200n8";
0068 };
0069
0070 leds {
0071 compatible = "gpio-leds";
0072
0073 status {
0074 label = "chip-pro:white:status";
0075 gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>;
0076 default-state = "on";
0077 };
0078 };
0079
0080 mmc0_pwrseq: mmc0_pwrseq {
0081 compatible = "mmc-pwrseq-simple";
0082 reset-gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; /* PB10 */
0083 };
0084 };
0085
0086 &codec {
0087 status = "okay";
0088 };
0089
0090 &ehci0 {
0091 status = "okay";
0092 };
0093
0094 &i2c0 {
0095 status = "okay";
0096
0097 axp209: pmic@34 {
0098 reg = <0x34>;
0099
0100 /*
0101 * The interrupt is routed through the "External Fast
0102 * Interrupt Request" pin (ball G13 of the module)
0103 * directly to the main interrupt controller, without
0104 * any other controller interfering.
0105 */
0106 interrupts = <0>;
0107 };
0108 };
0109
0110 #include "axp209.dtsi"
0111
0112 &i2c1 {
0113 status = "disabled";
0114 };
0115
0116 &i2s0 {
0117 pinctrl-names = "default";
0118 pinctrl-0 = <&i2s0_mclk_pin>, <&i2s0_data_pins>;
0119 status = "disabled";
0120 };
0121
0122 &mmc0 {
0123 vmmc-supply = <®_vcc3v3>;
0124 mmc-pwrseq = <&mmc0_pwrseq>;
0125 bus-width = <4>;
0126 non-removable;
0127 status = "okay";
0128 };
0129
0130 &nfc {
0131 pinctrl-names = "default";
0132 pinctrl-0 = <&nand_pins &nand_cs0_pin &nand_rb0_pin>;
0133 status = "okay";
0134
0135 nand@0 {
0136 reg = <0>;
0137 allwinner,rb = <0>;
0138 nand-ecc-mode = "hw";
0139 };
0140 };
0141
0142 &ohci0 {
0143 status = "okay";
0144 };
0145
0146 &otg_sram {
0147 status = "okay";
0148 };
0149
0150 &pwm {
0151 pinctrl-names = "default";
0152 pinctrl-0 = <&pwm0_pin>, <&pwm1_pins>;
0153 status = "disabled";
0154 };
0155
0156 ®_dcdc2 {
0157 regulator-min-microvolt = <1000000>;
0158 regulator-max-microvolt = <1400000>;
0159 regulator-name = "vdd-cpu";
0160 regulator-always-on;
0161 };
0162
0163 ®_dcdc3 {
0164 regulator-min-microvolt = <1000000>;
0165 regulator-max-microvolt = <1300000>;
0166 regulator-name = "vdd-sys";
0167 regulator-always-on;
0168 };
0169
0170 ®_ldo1 {
0171 regulator-name = "vdd-rtc";
0172 };
0173
0174 ®_ldo2 {
0175 regulator-min-microvolt = <2700000>;
0176 regulator-max-microvolt = <3300000>;
0177 regulator-name = "avcc";
0178 regulator-always-on;
0179 };
0180
0181 /*
0182 * Both LDO3 and LDO4 are used in parallel to power up the
0183 * WiFi/BT chip.
0184 */
0185 ®_ldo3 {
0186 regulator-min-microvolt = <3300000>;
0187 regulator-max-microvolt = <3300000>;
0188 regulator-name = "vcc-wifi-1";
0189 regulator-always-on;
0190 };
0191
0192 ®_ldo4 {
0193 regulator-min-microvolt = <3300000>;
0194 regulator-max-microvolt = <3300000>;
0195 regulator-name = "vcc-wifi-2";
0196 regulator-always-on;
0197 };
0198
0199 &uart1 {
0200 pinctrl-names = "default";
0201 pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pins>;
0202 status = "okay";
0203 };
0204
0205 &uart2 {
0206 pinctrl-names = "default";
0207 pinctrl-0 = <&uart2_pd_pins>, <&uart2_cts_rts_pd_pins>;
0208 status = "disabled";
0209 };
0210
0211 &uart3 {
0212 pinctrl-names = "default";
0213 pinctrl-0 = <&uart3_pg_pins>, <&uart3_cts_rts_pg_pins>;
0214 status = "okay";
0215 };
0216
0217 &usb_otg {
0218 /*
0219 * The CHIP Pro doesn't have a controllable VBUS, nor does it
0220 * have any 5v rail on the board itself.
0221 *
0222 * If one wants to use it as a true OTG port, it should be
0223 * done in the baseboard, and its DT / overlay will add it.
0224 */
0225 dr_mode = "otg";
0226 status = "okay";
0227 };
0228
0229 &usb_power_supply {
0230 status = "okay";
0231 };
0232
0233 &usbphy {
0234 usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
0235 usb0_vbus_power-supply = <&usb_power_supply>;
0236 usb1_vbus-supply = <®_vcc5v0>;
0237 status = "okay";
0238 };