0001 /*
0002 * Copyright (C) 2016 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 "sun8i-h3.dtsi"
0045 #include "sunxi-common-regulators.dtsi"
0046
0047 #include <dt-bindings/gpio/gpio.h>
0048 #include <dt-bindings/input/input.h>
0049
0050 / {
0051 model = "Xunlong Orange Pi One";
0052 compatible = "xunlong,orangepi-one", "allwinner,sun8i-h3";
0053
0054 aliases {
0055 ethernet0 = &emac;
0056 serial0 = &uart0;
0057 };
0058
0059 chosen {
0060 stdout-path = "serial0:115200n8";
0061 };
0062
0063 connector {
0064 compatible = "hdmi-connector";
0065 type = "a";
0066
0067 port {
0068 hdmi_con_in: endpoint {
0069 remote-endpoint = <&hdmi_out_con>;
0070 };
0071 };
0072 };
0073
0074 leds {
0075 compatible = "gpio-leds";
0076
0077 pwr_led {
0078 label = "orangepi:green:pwr";
0079 gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
0080 default-state = "on";
0081 };
0082
0083 status_led {
0084 label = "orangepi:red:status";
0085 gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
0086 };
0087 };
0088
0089 gpio-keys {
0090 compatible = "gpio-keys";
0091
0092 switch-4 {
0093 label = "sw4";
0094 linux,code = <BTN_0>;
0095 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0096 };
0097 };
0098
0099 reg_vdd_cpux: vdd-cpux-regulator {
0100 compatible = "regulator-gpio";
0101 regulator-name = "vdd-cpux";
0102 regulator-type = "voltage";
0103 regulator-boot-on;
0104 regulator-always-on;
0105 regulator-min-microvolt = <1100000>;
0106 regulator-max-microvolt = <1300000>;
0107 regulator-ramp-delay = <50>; /* 4ms */
0108
0109 gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
0110 enable-active-high;
0111 gpios-states = <0x1>;
0112 states = <1100000 0>, <1300000 1>;
0113 };
0114 };
0115
0116 &cpu0 {
0117 cpu-supply = <®_vdd_cpux>;
0118 };
0119
0120 &de {
0121 status = "okay";
0122 };
0123
0124 &ehci0 {
0125 status = "okay";
0126 };
0127
0128 &ehci1 {
0129 status = "okay";
0130 };
0131
0132 &emac {
0133 phy-handle = <&int_mii_phy>;
0134 phy-mode = "mii";
0135 allwinner,leds-active-low;
0136 status = "okay";
0137 };
0138
0139 &hdmi {
0140 status = "okay";
0141 };
0142
0143 &hdmi_out {
0144 hdmi_out_con: endpoint {
0145 remote-endpoint = <&hdmi_con_in>;
0146 };
0147 };
0148
0149 &mmc0 {
0150 vmmc-supply = <®_vcc3v3>;
0151 bus-width = <4>;
0152 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0153 status = "okay";
0154 };
0155
0156 &ohci0 {
0157 status = "okay";
0158 };
0159
0160 &ohci1 {
0161 status = "okay";
0162 };
0163
0164 ®_usb0_vbus {
0165 gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
0166 status = "okay";
0167 };
0168
0169 &uart0 {
0170 pinctrl-names = "default";
0171 pinctrl-0 = <&uart0_pa_pins>;
0172 status = "okay";
0173 };
0174
0175 &uart1 {
0176 pinctrl-names = "default";
0177 pinctrl-0 = <&uart1_pins>;
0178 status = "disabled";
0179 };
0180
0181 &uart2 {
0182 pinctrl-names = "default";
0183 pinctrl-0 = <&uart2_pins>;
0184 status = "disabled";
0185 };
0186
0187 &uart3 {
0188 pinctrl-names = "default";
0189 pinctrl-0 = <&uart3_pins>;
0190 status = "disabled";
0191 };
0192
0193 &usb_otg {
0194 dr_mode = "otg";
0195 status = "okay";
0196 };
0197
0198 &usbphy {
0199 /* USB Type-A port's VBUS is always on */
0200 usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0201 usb0_vbus-supply = <®_usb0_vbus>;
0202 status = "okay";
0203 };