1f126890aSEmmanuel Vadot/* 2f126890aSEmmanuel Vadot * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com> 3f126890aSEmmanuel Vadot * 4f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms 5f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual 6f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a 7f126890aSEmmanuel Vadot * whole. 8f126890aSEmmanuel Vadot * 9f126890aSEmmanuel Vadot * a) This file is free software; you can redistribute it and/or 10f126890aSEmmanuel Vadot * modify it under the terms of the GNU General Public License as 11f126890aSEmmanuel Vadot * published by the Free Software Foundation; either version 2 of the 12f126890aSEmmanuel Vadot * License, or (at your option) any later version. 13f126890aSEmmanuel Vadot * 14f126890aSEmmanuel Vadot * This file is distributed in the hope that it will be useful, 15f126890aSEmmanuel Vadot * but WITHOUT ANY WARRANTY; without even the implied warranty of 16f126890aSEmmanuel Vadot * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17f126890aSEmmanuel Vadot * GNU General Public License for more details. 18f126890aSEmmanuel Vadot * 19f126890aSEmmanuel Vadot * Or, alternatively, 20f126890aSEmmanuel Vadot * 21f126890aSEmmanuel Vadot * b) Permission is hereby granted, free of charge, to any person 22f126890aSEmmanuel Vadot * obtaining a copy of this software and associated documentation 23f126890aSEmmanuel Vadot * files (the "Software"), to deal in the Software without 24f126890aSEmmanuel Vadot * restriction, including without limitation the rights to use, 25f126890aSEmmanuel Vadot * copy, modify, merge, publish, distribute, sublicense, and/or 26f126890aSEmmanuel Vadot * sell copies of the Software, and to permit persons to whom the 27f126890aSEmmanuel Vadot * Software is furnished to do so, subject to the following 28f126890aSEmmanuel Vadot * conditions: 29f126890aSEmmanuel Vadot * 30f126890aSEmmanuel Vadot * The above copyright notice and this permission notice shall be 31f126890aSEmmanuel Vadot * included in all copies or substantial portions of the Software. 32f126890aSEmmanuel Vadot * 33f126890aSEmmanuel Vadot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 34f126890aSEmmanuel Vadot * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 35f126890aSEmmanuel Vadot * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 36f126890aSEmmanuel Vadot * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 37f126890aSEmmanuel Vadot * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 38f126890aSEmmanuel Vadot * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 39f126890aSEmmanuel Vadot * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 40f126890aSEmmanuel Vadot * OTHER DEALINGS IN THE SOFTWARE. 41f126890aSEmmanuel Vadot */ 42f126890aSEmmanuel Vadot 43f126890aSEmmanuel Vadot/dts-v1/; 44f126890aSEmmanuel Vadot#include "sun8i-h3.dtsi" 45f126890aSEmmanuel Vadot#include "sunxi-common-regulators.dtsi" 46f126890aSEmmanuel Vadot 47f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 48f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h> 49f126890aSEmmanuel Vadot 50f126890aSEmmanuel Vadot/ { 51f126890aSEmmanuel Vadot model = "Xunlong Orange Pi 2"; 52f126890aSEmmanuel Vadot compatible = "xunlong,orangepi-2", "allwinner,sun8i-h3"; 53f126890aSEmmanuel Vadot 54f126890aSEmmanuel Vadot aliases { 55f126890aSEmmanuel Vadot serial0 = &uart0; 56f126890aSEmmanuel Vadot /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ 57f126890aSEmmanuel Vadot ethernet0 = &emac; 58f126890aSEmmanuel Vadot ethernet1 = &rtl8189; 59f126890aSEmmanuel Vadot }; 60f126890aSEmmanuel Vadot 61f126890aSEmmanuel Vadot chosen { 62f126890aSEmmanuel Vadot stdout-path = "serial0:115200n8"; 63f126890aSEmmanuel Vadot }; 64f126890aSEmmanuel Vadot 65f126890aSEmmanuel Vadot connector { 66f126890aSEmmanuel Vadot compatible = "hdmi-connector"; 67f126890aSEmmanuel Vadot type = "a"; 68f126890aSEmmanuel Vadot 69f126890aSEmmanuel Vadot port { 70f126890aSEmmanuel Vadot hdmi_con_in: endpoint { 71f126890aSEmmanuel Vadot remote-endpoint = <&hdmi_out_con>; 72f126890aSEmmanuel Vadot }; 73f126890aSEmmanuel Vadot }; 74f126890aSEmmanuel Vadot }; 75f126890aSEmmanuel Vadot 76f126890aSEmmanuel Vadot leds { 77f126890aSEmmanuel Vadot compatible = "gpio-leds"; 78f126890aSEmmanuel Vadot 79f126890aSEmmanuel Vadot status_led { 80f126890aSEmmanuel Vadot label = "orangepi:red:status"; 81f126890aSEmmanuel Vadot gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; 82f126890aSEmmanuel Vadot }; 83f126890aSEmmanuel Vadot 84f126890aSEmmanuel Vadot pwr_led { 85f126890aSEmmanuel Vadot label = "orangepi:green:pwr"; 86f126890aSEmmanuel Vadot gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; 87f126890aSEmmanuel Vadot default-state = "on"; 88f126890aSEmmanuel Vadot }; 89f126890aSEmmanuel Vadot }; 90f126890aSEmmanuel Vadot 91f126890aSEmmanuel Vadot gpio-keys { 92f126890aSEmmanuel Vadot compatible = "gpio-keys"; 93f126890aSEmmanuel Vadot 94f126890aSEmmanuel Vadot switch-2 { 95f126890aSEmmanuel Vadot label = "sw2"; 96f126890aSEmmanuel Vadot linux,code = <BTN_1>; 97f126890aSEmmanuel Vadot gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; 98f126890aSEmmanuel Vadot }; 99f126890aSEmmanuel Vadot 100f126890aSEmmanuel Vadot switch-4 { 101f126890aSEmmanuel Vadot label = "sw4"; 102f126890aSEmmanuel Vadot linux,code = <KEY_POWER>; 103f126890aSEmmanuel Vadot gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; 104f126890aSEmmanuel Vadot wakeup-source; 105f126890aSEmmanuel Vadot }; 106f126890aSEmmanuel Vadot }; 107f126890aSEmmanuel Vadot 108*7d0873ebSEmmanuel Vadot wifi_pwrseq: pwrseq { 109f126890aSEmmanuel Vadot compatible = "mmc-pwrseq-simple"; 110f126890aSEmmanuel Vadot reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 WIFI_EN */ 111f126890aSEmmanuel Vadot }; 112f126890aSEmmanuel Vadot}; 113f126890aSEmmanuel Vadot 114f126890aSEmmanuel Vadot&codec { 115f126890aSEmmanuel Vadot allwinner,pa-gpios = <&pio 0 16 GPIO_ACTIVE_HIGH>; /* PA16 */ 116f126890aSEmmanuel Vadot allwinner,audio-routing = 117f126890aSEmmanuel Vadot "Speaker", "LINEOUT", 118f126890aSEmmanuel Vadot "MIC1", "Mic", 119f126890aSEmmanuel Vadot "Mic", "MBIAS"; 120f126890aSEmmanuel Vadot status = "okay"; 121f126890aSEmmanuel Vadot}; 122f126890aSEmmanuel Vadot 123f126890aSEmmanuel Vadot&de { 124f126890aSEmmanuel Vadot status = "okay"; 125f126890aSEmmanuel Vadot}; 126f126890aSEmmanuel Vadot 127f126890aSEmmanuel Vadot&ehci1 { 128f126890aSEmmanuel Vadot status = "okay"; 129f126890aSEmmanuel Vadot}; 130f126890aSEmmanuel Vadot 131f126890aSEmmanuel Vadot&emac { 132f126890aSEmmanuel Vadot phy-handle = <&int_mii_phy>; 133f126890aSEmmanuel Vadot phy-mode = "mii"; 134f126890aSEmmanuel Vadot allwinner,leds-active-low; 135f126890aSEmmanuel Vadot status = "okay"; 136f126890aSEmmanuel Vadot}; 137f126890aSEmmanuel Vadot 138f126890aSEmmanuel Vadot&hdmi { 139f126890aSEmmanuel Vadot status = "okay"; 140f126890aSEmmanuel Vadot}; 141f126890aSEmmanuel Vadot 142f126890aSEmmanuel Vadot&hdmi_out { 143f126890aSEmmanuel Vadot hdmi_out_con: endpoint { 144f126890aSEmmanuel Vadot remote-endpoint = <&hdmi_con_in>; 145f126890aSEmmanuel Vadot }; 146f126890aSEmmanuel Vadot}; 147f126890aSEmmanuel Vadot 148f126890aSEmmanuel Vadot&ir { 149f126890aSEmmanuel Vadot pinctrl-names = "default"; 150f126890aSEmmanuel Vadot pinctrl-0 = <&r_ir_rx_pin>; 151f126890aSEmmanuel Vadot status = "okay"; 152f126890aSEmmanuel Vadot}; 153f126890aSEmmanuel Vadot 154f126890aSEmmanuel Vadot&mmc0 { 155f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 156f126890aSEmmanuel Vadot bus-width = <4>; 157f126890aSEmmanuel Vadot cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 158f126890aSEmmanuel Vadot status = "okay"; 159f126890aSEmmanuel Vadot}; 160f126890aSEmmanuel Vadot 161f126890aSEmmanuel Vadot&mmc1 { 162f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 163f126890aSEmmanuel Vadot mmc-pwrseq = <&wifi_pwrseq>; 164f126890aSEmmanuel Vadot bus-width = <4>; 165f126890aSEmmanuel Vadot non-removable; 166f126890aSEmmanuel Vadot status = "okay"; 167f126890aSEmmanuel Vadot 168f126890aSEmmanuel Vadot /* 169f126890aSEmmanuel Vadot * Explicitly define the sdio device, so that we can add an ethernet 170f126890aSEmmanuel Vadot * alias for it (which e.g. makes u-boot set a mac-address). 171f126890aSEmmanuel Vadot */ 172*7d0873ebSEmmanuel Vadot rtl8189: wifi@1 { 173f126890aSEmmanuel Vadot reg = <1>; 174f126890aSEmmanuel Vadot }; 175f126890aSEmmanuel Vadot}; 176f126890aSEmmanuel Vadot 177f126890aSEmmanuel Vadot®_usb1_vbus { 178f126890aSEmmanuel Vadot gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; 179f126890aSEmmanuel Vadot status = "okay"; 180f126890aSEmmanuel Vadot}; 181f126890aSEmmanuel Vadot 182f126890aSEmmanuel Vadot&uart0 { 183f126890aSEmmanuel Vadot pinctrl-names = "default"; 184f126890aSEmmanuel Vadot pinctrl-0 = <&uart0_pa_pins>; 185f126890aSEmmanuel Vadot status = "okay"; 186f126890aSEmmanuel Vadot}; 187f126890aSEmmanuel Vadot 188f126890aSEmmanuel Vadot&uart1 { 189f126890aSEmmanuel Vadot pinctrl-names = "default"; 190f126890aSEmmanuel Vadot pinctrl-0 = <&uart1_pins>; 191f126890aSEmmanuel Vadot status = "disabled"; 192f126890aSEmmanuel Vadot}; 193f126890aSEmmanuel Vadot 194f126890aSEmmanuel Vadot&uart2 { 195f126890aSEmmanuel Vadot pinctrl-names = "default"; 196f126890aSEmmanuel Vadot pinctrl-0 = <&uart2_pins>; 197f126890aSEmmanuel Vadot status = "disabled"; 198f126890aSEmmanuel Vadot}; 199f126890aSEmmanuel Vadot 200f126890aSEmmanuel Vadot&uart3 { 201f126890aSEmmanuel Vadot pinctrl-names = "default"; 202f126890aSEmmanuel Vadot pinctrl-0 = <&uart3_pins>; 203f126890aSEmmanuel Vadot status = "disabled"; 204f126890aSEmmanuel Vadot}; 205f126890aSEmmanuel Vadot 206f126890aSEmmanuel Vadot&usbphy { 207f126890aSEmmanuel Vadot usb1_vbus-supply = <®_usb1_vbus>; 208f126890aSEmmanuel Vadot status = "okay"; 209f126890aSEmmanuel Vadot}; 210