0001 /*
0002 * Copyright 2013 Maxime Ripard
0003 *
0004 * Maxime Ripard <maxime.ripard@free-electrons.com>
0005 *
0006 * This file is dual-licensed: you can use it either under the terms
0007 * of the GPL or the X11 license, at your option. Note that this dual
0008 * licensing only applies to this file, and not this project as a
0009 * whole.
0010 *
0011 * a) This file is free software; you can redistribute it and/or
0012 * modify it under the terms of the GNU General Public License as
0013 * published by the Free Software Foundation; either version 2 of the
0014 * License, or (at your option) any later version.
0015 *
0016 * This file is distributed in the hope that it will be useful,
0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0019 * GNU General Public License for more details.
0020 *
0021 * Or, alternatively,
0022 *
0023 * b) Permission is hereby granted, free of charge, to any person
0024 * obtaining a copy of this software and associated documentation
0025 * files (the "Software"), to deal in the Software without
0026 * restriction, including without limitation the rights to use,
0027 * copy, modify, merge, publish, distribute, sublicense, and/or
0028 * sell copies of the Software, and to permit persons to whom the
0029 * Software is furnished to do so, subject to the following
0030 * conditions:
0031 *
0032 * The above copyright notice and this permission notice shall be
0033 * included in all copies or substantial portions of the Software.
0034 *
0035 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0036 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0037 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0038 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0039 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0040 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0041 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0042 * OTHER DEALINGS IN THE SOFTWARE.
0043 */
0044
0045 /dts-v1/;
0046 #include "sun7i-a20.dtsi"
0047 #include "sunxi-common-regulators.dtsi"
0048
0049 #include <dt-bindings/gpio/gpio.h>
0050 #include <dt-bindings/input/input.h>
0051 #include <dt-bindings/interrupt-controller/irq.h>
0052
0053 / {
0054 model = "Olimex A20-Olinuxino Micro";
0055 compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20";
0056
0057 aliases {
0058 serial0 = &uart0;
0059 serial1 = &uart6;
0060 serial2 = &uart7;
0061 spi0 = &spi1;
0062 spi1 = &spi2;
0063 };
0064
0065 chosen {
0066 stdout-path = "serial0:115200n8";
0067 };
0068
0069 hdmi-connector {
0070 compatible = "hdmi-connector";
0071 type = "a";
0072
0073 port {
0074 hdmi_con_in: endpoint {
0075 remote-endpoint = <&hdmi_out_con>;
0076 };
0077 };
0078 };
0079
0080 leds {
0081 compatible = "gpio-leds";
0082 pinctrl-names = "default";
0083 pinctrl-0 = <&led_pins_olinuxino>;
0084
0085 led {
0086 label = "a20-olinuxino-micro:green:usr";
0087 gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
0088 default-state = "on";
0089 };
0090 };
0091 };
0092
0093 &ahci {
0094 target-supply = <®_ahci_5v>;
0095 status = "okay";
0096 };
0097
0098 &codec {
0099 status = "okay";
0100 };
0101
0102 &cpu0 {
0103 cpu-supply = <®_dcdc2>;
0104 };
0105
0106 &de {
0107 status = "okay";
0108 };
0109
0110 &ehci0 {
0111 status = "okay";
0112 };
0113
0114 &ehci1 {
0115 status = "okay";
0116 };
0117
0118 &gmac {
0119 pinctrl-names = "default";
0120 pinctrl-0 = <&gmac_mii_pins>, <&gmac_txerr>;
0121 phy-handle = <&phy1>;
0122 phy-mode = "mii";
0123 status = "okay";
0124 };
0125
0126 &hdmi {
0127 status = "okay";
0128 };
0129
0130 &hdmi_out {
0131 hdmi_out_con: endpoint {
0132 remote-endpoint = <&hdmi_con_in>;
0133 };
0134 };
0135
0136 &i2c0 {
0137 status = "okay";
0138
0139 axp209: pmic@34 {
0140 reg = <0x34>;
0141 interrupt-parent = <&nmi_intc>;
0142 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0143 };
0144 };
0145
0146 &i2c1 {
0147 status = "okay";
0148
0149 eeprom: eeprom@50 {
0150 compatible = "atmel,24c16";
0151 reg = <0x50>;
0152 pagesize = <16>;
0153 };
0154 };
0155
0156 &i2c2 {
0157 status = "okay";
0158 };
0159
0160 &lradc {
0161 vref-supply = <®_vcc3v0>;
0162 status = "okay";
0163
0164 button-191 {
0165 label = "Volume Up";
0166 linux,code = <KEY_VOLUMEUP>;
0167 channel = <0>;
0168 voltage = <191274>;
0169 };
0170
0171 button-392 {
0172 label = "Volume Down";
0173 linux,code = <KEY_VOLUMEDOWN>;
0174 channel = <0>;
0175 voltage = <392644>;
0176 };
0177
0178 button-601 {
0179 label = "Menu";
0180 linux,code = <KEY_MENU>;
0181 channel = <0>;
0182 voltage = <601151>;
0183 };
0184
0185 button-795 {
0186 label = "Search";
0187 linux,code = <KEY_SEARCH>;
0188 channel = <0>;
0189 voltage = <795090>;
0190 };
0191
0192 button-987 {
0193 label = "Home";
0194 linux,code = <KEY_HOMEPAGE>;
0195 channel = <0>;
0196 voltage = <987387>;
0197 };
0198
0199 button-1184 {
0200 label = "Esc";
0201 linux,code = <KEY_ESC>;
0202 channel = <0>;
0203 voltage = <1184678>;
0204 };
0205
0206 button-1398 {
0207 label = "Enter";
0208 linux,code = <KEY_ENTER>;
0209 channel = <0>;
0210 voltage = <1398804>;
0211 };
0212 };
0213
0214 &gmac_mdio {
0215 phy1: ethernet-phy@1 {
0216 reg = <1>;
0217 };
0218 };
0219
0220 &mmc0 {
0221 vmmc-supply = <®_vcc3v3>;
0222 bus-width = <4>;
0223 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
0224 status = "okay";
0225 };
0226
0227 &mmc3 {
0228 vmmc-supply = <®_vcc3v3>;
0229 bus-width = <4>;
0230 cd-gpios = <&pio 7 11 GPIO_ACTIVE_LOW>; /* PH11 */
0231 status = "okay";
0232 };
0233
0234 &ohci0 {
0235 status = "okay";
0236 };
0237
0238 &ohci1 {
0239 status = "okay";
0240 };
0241
0242 &otg_sram {
0243 status = "okay";
0244 };
0245
0246 &pio {
0247 gmac_txerr: gmac-txerr-pin {
0248 pins = "PA17";
0249 function = "gmac";
0250 };
0251
0252 led_pins_olinuxino: led-pins {
0253 pins = "PH2";
0254 function = "gpio_out";
0255 drive-strength = <20>;
0256 };
0257 };
0258
0259 #include "axp209.dtsi"
0260
0261 &ac_power_supply {
0262 status = "okay";
0263 };
0264
0265 &battery_power_supply {
0266 status = "okay";
0267 };
0268
0269 ®_dcdc2 {
0270 regulator-always-on;
0271 regulator-min-microvolt = <1000000>;
0272 regulator-max-microvolt = <1400000>;
0273 regulator-name = "vdd-cpu";
0274 };
0275
0276 ®_dcdc3 {
0277 regulator-always-on;
0278 regulator-min-microvolt = <1000000>;
0279 regulator-max-microvolt = <1400000>;
0280 regulator-name = "vdd-int-dll";
0281 };
0282
0283 ®_ldo2 {
0284 regulator-always-on;
0285 regulator-min-microvolt = <3000000>;
0286 regulator-max-microvolt = <3000000>;
0287 regulator-name = "avcc";
0288 };
0289
0290 ®_ahci_5v {
0291 status = "okay";
0292 };
0293
0294 ®_usb0_vbus {
0295 status = "okay";
0296 };
0297
0298 ®_usb1_vbus {
0299 status = "okay";
0300 };
0301
0302 ®_usb2_vbus {
0303 status = "okay";
0304 };
0305
0306 &spi1 {
0307 pinctrl-names = "default";
0308 pinctrl-0 = <&spi1_pi_pins>,
0309 <&spi1_cs0_pi_pin>;
0310 status = "okay";
0311 };
0312
0313 &spi2 {
0314 pinctrl-names = "default";
0315 pinctrl-0 = <&spi2_pc_pins>,
0316 <&spi2_cs0_pc_pin>;
0317 status = "okay";
0318 };
0319
0320 &uart0 {
0321 pinctrl-names = "default";
0322 pinctrl-0 = <&uart0_pb_pins>;
0323 status = "okay";
0324 };
0325
0326 &uart6 {
0327 pinctrl-names = "default";
0328 pinctrl-0 = <&uart6_pi_pins>;
0329 status = "okay";
0330 };
0331
0332 &uart7 {
0333 pinctrl-names = "default";
0334 pinctrl-0 = <&uart7_pi_pins>;
0335 status = "okay";
0336 };
0337
0338 &usb_otg {
0339 dr_mode = "otg";
0340 status = "okay";
0341 };
0342
0343 &usb_power_supply {
0344 status = "okay";
0345 };
0346
0347 &usbphy {
0348 usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
0349 usb0_vbus_det-gpios = <&pio 7 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PH5 */
0350 usb0_vbus-supply = <®_usb0_vbus>;
0351 usb1_vbus-supply = <®_usb1_vbus>;
0352 usb2_vbus-supply = <®_usb2_vbus>;
0353 status = "okay";
0354 };