0001 /*
0002 * Copyright 2016 Free Electrons
0003 * Copyright 2016 NextThing Co
0004 *
0005 * Mylène Josserand <mylene.josserand@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 GR8-EVB";
0056 compatible = "nextthing,gr8-evb", "nextthing,gr8";
0057
0058 aliases {
0059 i2c0 = &i2c0;
0060 i2c1 = &i2c1;
0061 i2c2 = &i2c2;
0062 serial0 = &uart1;
0063 serial1 = &uart2;
0064 };
0065
0066 chosen {
0067 stdout-path = "serial0:115200n8";
0068 };
0069
0070 backlight: backlight {
0071 compatible = "pwm-backlight";
0072 pwms = <&pwm 0 10000 0>;
0073 enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
0074 power-supply = <®_vcc3v3>;
0075 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
0076 default-brightness-level = <8>;
0077 };
0078
0079 sound-analog {
0080 compatible = "simple-audio-card";
0081 simple-audio-card,name = "gr8-evb-wm8978";
0082 simple-audio-card,format = "i2s";
0083 simple-audio-card,mclk-fs = <512>;
0084
0085 simple-audio-card,cpu {
0086 sound-dai = <&i2s0>;
0087 };
0088
0089 simple-audio-card,codec {
0090 sound-dai = <&wm8978>;
0091 };
0092 };
0093
0094 sound-spdif {
0095 compatible = "simple-audio-card";
0096 simple-audio-card,name = "On-board SPDIF";
0097
0098 simple-audio-card,cpu {
0099 sound-dai = <&spdif>;
0100 };
0101
0102 simple-audio-card,codec {
0103 sound-dai = <&spdif_out>;
0104 };
0105 };
0106
0107 spdif_out: spdif-out {
0108 #sound-dai-cells = <0>;
0109 compatible = "linux,spdif-dit";
0110 };
0111 };
0112
0113 &be0 {
0114 status = "okay";
0115 };
0116
0117 &codec {
0118 status = "okay";
0119 };
0120
0121 &ehci0 {
0122 status = "okay";
0123 };
0124
0125 &i2c0 {
0126 status = "okay";
0127
0128 axp209: pmic@34 {
0129 reg = <0x34>;
0130
0131 /*
0132 * The interrupt is routed through the "External Fast
0133 * Interrupt Request" pin (ball G13 of the module)
0134 * directly to the main interrupt controller, without
0135 * any other controller interfering.
0136 */
0137 interrupts = <0>;
0138 };
0139 };
0140
0141 #include "axp209.dtsi"
0142
0143 &i2c1 {
0144 status = "okay";
0145
0146 wm8978: codec@1a {
0147 #sound-dai-cells = <0>;
0148 compatible = "wlf,wm8978";
0149 reg = <0x1a>;
0150 };
0151
0152 pcf8563: rtc@51 {
0153 compatible = "nxp,pcf8563";
0154 reg = <0x51>;
0155 };
0156 };
0157
0158 &i2c2 {
0159 status = "okay";
0160 };
0161
0162 &i2s0 {
0163 pinctrl-names = "default";
0164 pinctrl-0 = <&i2s0_mclk_pin>, <&i2s0_data_pins>;
0165 status = "okay";
0166 };
0167
0168 &ir0 {
0169 pinctrl-names = "default";
0170 pinctrl-0 = <&ir0_rx_pin>;
0171 status = "okay";
0172 };
0173
0174 &lradc {
0175 vref-supply = <®_ldo2>;
0176 status = "okay";
0177
0178 button-190 {
0179 label = "Volume Up";
0180 linux,code = <KEY_VOLUMEUP>;
0181 channel = <0>;
0182 voltage = <190000>;
0183 };
0184
0185 button-390 {
0186 label = "Volume Down";
0187 linux,code = <KEY_VOLUMEDOWN>;
0188 channel = <0>;
0189 voltage = <390000>;
0190 };
0191
0192 button-600 {
0193 label = "Menu";
0194 linux,code = <KEY_MENU>;
0195 channel = <0>;
0196 voltage = <600000>;
0197 };
0198
0199 button-800 {
0200 label = "Search";
0201 linux,code = <KEY_SEARCH>;
0202 channel = <0>;
0203 voltage = <800000>;
0204 };
0205
0206 button-980 {
0207 label = "Home";
0208 linux,code = <KEY_HOMEPAGE>;
0209 channel = <0>;
0210 voltage = <980000>;
0211 };
0212
0213 button-1180 {
0214 label = "Esc";
0215 linux,code = <KEY_ESC>;
0216 channel = <0>;
0217 voltage = <1180000>;
0218 };
0219
0220 button-1400 {
0221 label = "Enter";
0222 linux,code = <KEY_ENTER>;
0223 channel = <0>;
0224 voltage = <1400000>;
0225 };
0226 };
0227
0228 &mmc0 {
0229 vmmc-supply = <®_vcc3v3>;
0230 bus-width = <4>;
0231 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
0232 status = "okay";
0233 };
0234
0235 &nfc {
0236 pinctrl-names = "default";
0237 pinctrl-0 = <&nand_pins &nand_cs0_pin &nand_rb0_pin>;
0238
0239 /* MLC Support sucks for now */
0240 status = "disabled";
0241 };
0242
0243 &ohci0 {
0244 status = "okay";
0245 };
0246
0247 &otg_sram {
0248 status = "okay";
0249 };
0250
0251 &pwm {
0252 pinctrl-names = "default";
0253 pinctrl-0 = <&pwm0_pin>;
0254 status = "okay";
0255 };
0256
0257 ®_dcdc2 {
0258 regulator-min-microvolt = <1000000>;
0259 regulator-max-microvolt = <1400000>;
0260 regulator-name = "vdd-cpu";
0261 regulator-always-on;
0262 };
0263
0264 ®_dcdc3 {
0265 regulator-min-microvolt = <1000000>;
0266 regulator-max-microvolt = <1300000>;
0267 regulator-name = "vdd-sys";
0268 regulator-always-on;
0269 };
0270
0271 ®_ldo1 {
0272 regulator-name = "vdd-rtc";
0273 };
0274
0275 ®_ldo2 {
0276 regulator-min-microvolt = <2700000>;
0277 regulator-max-microvolt = <3300000>;
0278 regulator-name = "avcc";
0279 regulator-always-on;
0280 };
0281
0282 ®_usb1_vbus {
0283 gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
0284 status = "okay";
0285 };
0286
0287 &rtp {
0288 allwinner,ts-attached;
0289 };
0290
0291 &spdif {
0292 pinctrl-names = "default";
0293 pinctrl-0 = <&spdif_tx_pin>;
0294 status = "okay";
0295 };
0296
0297 &tve0 {
0298 status = "okay";
0299 };
0300
0301 &uart1 {
0302 pinctrl-names = "default";
0303 pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pins>;
0304 status = "okay";
0305 };
0306
0307 &usb_otg {
0308 /*
0309 * The GR8-EVB has a somewhat interesting design. There's a
0310 * pin supposed to control VBUS, an ID pin, a VBUS detect pin,
0311 * so everything should work just fine.
0312 *
0313 * Except that the pin supposed to control VBUS is not
0314 * connected to any controllable output, neither to the SoC
0315 * through a GPIO or to the PMIC, and it is pulled down,
0316 * meaning that we will never be able to enable VBUS on this
0317 * board.
0318 */
0319 dr_mode = "otg";
0320 status = "okay";
0321 };
0322
0323 &usb_power_supply {
0324 status = "okay";
0325 };
0326
0327 &usbphy {
0328 usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
0329 usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
0330 usb0_vbus_power-supply = <&usb_power_supply>;
0331 usb1_vbus-supply = <®_usb1_vbus>;
0332 status = "okay";
0333 };