0001 /*
0002 * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
0003 *
0004 * This file is dual-licensed: you can use it either under the terms
0005 * of the GPL or the X11 license, at your option. Note that this dual
0006 * licensing only applies to this file, and not this project as a
0007 * whole.
0008 *
0009 * a) This file is free software; you can redistribute it and/or
0010 * modify it under the terms of the GNU General Public License as
0011 * published by the Free Software Foundation; either version 2 of the
0012 * License, or (at your option) any later version.
0013 *
0014 * This file is distributed in the hope that it will be useful,
0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 * GNU General Public License for more details.
0018 *
0019 * Or, alternatively,
0020 *
0021 * b) Permission is hereby granted, free of charge, to any person
0022 * obtaining a copy of this software and associated documentation
0023 * files (the "Software"), to deal in the Software without
0024 * restriction, including without limitation the rights to use,
0025 * copy, modify, merge, publish, distribute, sublicense, and/or
0026 * sell copies of the Software, and to permit persons to whom the
0027 * Software is furnished to do so, subject to the following
0028 * conditions:
0029 *
0030 * The above copyright notice and this permission notice shall be
0031 * included in all copies or substantial portions of the Software.
0032 *
0033 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0034 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0035 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0036 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0037 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0038 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0039 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0040 * OTHER DEALINGS IN THE SOFTWARE.
0041 */
0042
0043 /dts-v1/;
0044 #include "sun6i-a31.dtsi"
0045 #include "sunxi-common-regulators.dtsi"
0046
0047 #include <dt-bindings/gpio/gpio.h>
0048
0049 / {
0050 model = "Mele M9 top set box";
0051 compatible = "mele,m9", "allwinner,sun6i-a31";
0052
0053 aliases {
0054 serial0 = &uart0;
0055 };
0056
0057 chosen {
0058 stdout-path = "serial0:115200n8";
0059 };
0060
0061 leds {
0062 compatible = "gpio-leds";
0063
0064 led {
0065 label = "m9:blue:pwr";
0066 gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
0067 default-state = "on";
0068 };
0069 };
0070 };
0071
0072 &cpu0 {
0073 cpu-supply = <®_dcdc3>;
0074 };
0075
0076 &ehci0 {
0077 status = "okay";
0078 };
0079
0080 &ehci1 {
0081 status = "okay";
0082 };
0083
0084 &gmac {
0085 pinctrl-names = "default";
0086 pinctrl-0 = <&gmac_mii_pins>;
0087 phy-handle = <&phy1>;
0088 phy-mode = "mii";
0089 phy-supply = <®_dldo1>;
0090 status = "okay";
0091 };
0092
0093 &ir {
0094 pinctrl-names = "default";
0095 pinctrl-0 = <&s_ir_rx_pin>;
0096 status = "okay";
0097 };
0098
0099 &mdio {
0100 phy1: ethernet-phy@1 {
0101 reg = <1>;
0102 };
0103 };
0104
0105 &mmc0 {
0106 vmmc-supply = <®_dcdc1>;
0107 bus-width = <4>;
0108 cd-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
0109 status = "okay";
0110 };
0111
0112 &p2wi {
0113 status = "okay";
0114
0115 axp22x: pmic@68 {
0116 compatible = "x-powers,axp221";
0117 reg = <0x68>;
0118 interrupt-parent = <&r_intc>;
0119 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0120 };
0121 };
0122
0123 #include "axp22x.dtsi"
0124
0125 ®_aldo1 {
0126 regulator-min-microvolt = <3300000>;
0127 regulator-max-microvolt = <3300000>;
0128 regulator-name = "vcc-wifi";
0129 };
0130
0131 ®_aldo3 {
0132 regulator-always-on;
0133 regulator-min-microvolt = <2700000>;
0134 regulator-max-microvolt = <3300000>;
0135 regulator-name = "avcc";
0136 };
0137
0138 ®_dc5ldo {
0139 regulator-always-on;
0140 regulator-min-microvolt = <700000>;
0141 regulator-max-microvolt = <1320000>;
0142 regulator-name = "vdd-cpus"; /* This is an educated guess */
0143 };
0144
0145 ®_dcdc1 {
0146 regulator-always-on;
0147 regulator-min-microvolt = <3300000>;
0148 regulator-max-microvolt = <3300000>;
0149 regulator-name = "vcc-3v3";
0150 };
0151
0152 ®_dcdc2 {
0153 regulator-min-microvolt = <700000>;
0154 regulator-max-microvolt = <1320000>;
0155 regulator-name = "vdd-gpu";
0156 };
0157
0158 ®_dcdc3 {
0159 regulator-always-on;
0160 regulator-min-microvolt = <700000>;
0161 regulator-max-microvolt = <1320000>;
0162 regulator-name = "vdd-cpu";
0163 };
0164
0165 ®_dcdc4 {
0166 regulator-always-on;
0167 regulator-min-microvolt = <700000>;
0168 regulator-max-microvolt = <1320000>;
0169 regulator-name = "vdd-sys-dll";
0170 };
0171
0172 ®_dcdc5 {
0173 regulator-always-on;
0174 regulator-min-microvolt = <1500000>;
0175 regulator-max-microvolt = <1500000>;
0176 regulator-name = "vcc-dram";
0177 };
0178
0179 ®_dldo1 {
0180 regulator-min-microvolt = <3300000>;
0181 regulator-max-microvolt = <3300000>;
0182 regulator-name = "vcc-ethernet-phy";
0183 };
0184
0185 /*
0186 * Both reg_usb1_vbus and reg_dldo4 need to be on for the hub attached
0187 * to usb1 to work, and we can list only one usb1_vbus-supply, so dldo4 is
0188 * marked as regulator-always-on.
0189 */
0190 ®_dldo4 {
0191 regulator-always-on;
0192 regulator-min-microvolt = <3300000>;
0193 regulator-max-microvolt = <3300000>;
0194 regulator-name = "vcc-usb-hub";
0195 };
0196
0197 ®_usb1_vbus {
0198 gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
0199 status = "okay";
0200 };
0201
0202 &uart0 {
0203 pinctrl-names = "default";
0204 pinctrl-0 = <&uart0_ph_pins>;
0205 status = "okay";
0206 };
0207
0208 &usbphy {
0209 usb1_vbus-supply = <®_usb1_vbus>;
0210 usb2_vbus-supply = <®_aldo1>;
0211 status = "okay";
0212 };