1f126890aSEmmanuel Vadot/* 2f126890aSEmmanuel Vadot * Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org> 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#include "sunxi-common-regulators.dtsi" 44f126890aSEmmanuel Vadot 45f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 46f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h> 47f126890aSEmmanuel Vadot 48f126890aSEmmanuel Vadot/ { 49f126890aSEmmanuel Vadot aliases { 50f126890aSEmmanuel Vadot ethernet0 = &emac; 51f126890aSEmmanuel Vadot serial0 = &uart0; 52f126890aSEmmanuel Vadot serial1 = &uart1; 53f126890aSEmmanuel Vadot }; 54f126890aSEmmanuel Vadot 55f126890aSEmmanuel Vadot chosen { 56f126890aSEmmanuel Vadot stdout-path = "serial0:115200n8"; 57f126890aSEmmanuel Vadot }; 58f126890aSEmmanuel Vadot 59f126890aSEmmanuel Vadot connector { 60f126890aSEmmanuel Vadot compatible = "hdmi-connector"; 61f126890aSEmmanuel Vadot type = "a"; 62f126890aSEmmanuel Vadot 63f126890aSEmmanuel Vadot port { 64f126890aSEmmanuel Vadot hdmi_con_in: endpoint { 65f126890aSEmmanuel Vadot remote-endpoint = <&hdmi_out_con>; 66f126890aSEmmanuel Vadot }; 67f126890aSEmmanuel Vadot }; 68f126890aSEmmanuel Vadot }; 69f126890aSEmmanuel Vadot 70f126890aSEmmanuel Vadot leds { 71f126890aSEmmanuel Vadot compatible = "gpio-leds"; 72f126890aSEmmanuel Vadot 73f126890aSEmmanuel Vadot pwr_led { 74f126890aSEmmanuel Vadot label = "bananapi-m2-plus:red:pwr"; 75f126890aSEmmanuel Vadot gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ 76f126890aSEmmanuel Vadot default-state = "on"; 77f126890aSEmmanuel Vadot }; 78f126890aSEmmanuel Vadot }; 79f126890aSEmmanuel Vadot 80f126890aSEmmanuel Vadot gpio-keys { 81f126890aSEmmanuel Vadot compatible = "gpio-keys"; 82f126890aSEmmanuel Vadot 83f126890aSEmmanuel Vadot switch-4 { 84f126890aSEmmanuel Vadot label = "power"; 85f126890aSEmmanuel Vadot linux,code = <KEY_POWER>; 86f126890aSEmmanuel Vadot gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; 87f126890aSEmmanuel Vadot wakeup-source; 88f126890aSEmmanuel Vadot }; 89f126890aSEmmanuel Vadot }; 90f126890aSEmmanuel Vadot 91f126890aSEmmanuel Vadot reg_gmac_3v3: gmac-3v3 { 92f126890aSEmmanuel Vadot compatible = "regulator-fixed"; 93f126890aSEmmanuel Vadot regulator-name = "gmac-3v3"; 94f126890aSEmmanuel Vadot regulator-min-microvolt = <3300000>; 95f126890aSEmmanuel Vadot regulator-max-microvolt = <3300000>; 96f126890aSEmmanuel Vadot startup-delay-us = <100000>; 97f126890aSEmmanuel Vadot enable-active-high; 98f126890aSEmmanuel Vadot gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; 99f126890aSEmmanuel Vadot }; 100f126890aSEmmanuel Vadot 101*7d0873ebSEmmanuel Vadot wifi_pwrseq: pwrseq { 102f126890aSEmmanuel Vadot compatible = "mmc-pwrseq-simple"; 103f126890aSEmmanuel Vadot reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ 104f126890aSEmmanuel Vadot clocks = <&rtc CLK_OSC32K_FANOUT>; 105f126890aSEmmanuel Vadot clock-names = "ext_clock"; 106f126890aSEmmanuel Vadot }; 107f126890aSEmmanuel Vadot}; 108f126890aSEmmanuel Vadot 109f126890aSEmmanuel Vadot&de { 110f126890aSEmmanuel Vadot status = "okay"; 111f126890aSEmmanuel Vadot}; 112f126890aSEmmanuel Vadot 113f126890aSEmmanuel Vadot&ehci0 { 114f126890aSEmmanuel Vadot status = "okay"; 115f126890aSEmmanuel Vadot}; 116f126890aSEmmanuel Vadot 117f126890aSEmmanuel Vadot&ehci1 { 118f126890aSEmmanuel Vadot status = "okay"; 119f126890aSEmmanuel Vadot}; 120f126890aSEmmanuel Vadot 121f126890aSEmmanuel Vadot&ehci2 { 122f126890aSEmmanuel Vadot status = "okay"; 123f126890aSEmmanuel Vadot}; 124f126890aSEmmanuel Vadot 125f126890aSEmmanuel Vadot&emac { 126f126890aSEmmanuel Vadot pinctrl-names = "default"; 127f126890aSEmmanuel Vadot pinctrl-0 = <&emac_rgmii_pins>; 128f126890aSEmmanuel Vadot phy-supply = <®_gmac_3v3>; 129f126890aSEmmanuel Vadot phy-handle = <&ext_rgmii_phy>; 130f126890aSEmmanuel Vadot phy-mode = "rgmii-id"; 131f126890aSEmmanuel Vadot 132f126890aSEmmanuel Vadot status = "okay"; 133f126890aSEmmanuel Vadot}; 134f126890aSEmmanuel Vadot 135f126890aSEmmanuel Vadot&external_mdio { 136f126890aSEmmanuel Vadot ext_rgmii_phy: ethernet-phy@1 { 137f126890aSEmmanuel Vadot compatible = "ethernet-phy-ieee802.3-c22"; 138f126890aSEmmanuel Vadot reg = <1>; 139f126890aSEmmanuel Vadot }; 140f126890aSEmmanuel Vadot}; 141f126890aSEmmanuel Vadot 142f126890aSEmmanuel Vadot&hdmi { 143f126890aSEmmanuel Vadot status = "okay"; 144f126890aSEmmanuel Vadot}; 145f126890aSEmmanuel Vadot 146f126890aSEmmanuel Vadot&hdmi_out { 147f126890aSEmmanuel Vadot hdmi_out_con: endpoint { 148f126890aSEmmanuel Vadot remote-endpoint = <&hdmi_con_in>; 149f126890aSEmmanuel Vadot }; 150f126890aSEmmanuel Vadot}; 151f126890aSEmmanuel Vadot 152f126890aSEmmanuel Vadot&ir { 153f126890aSEmmanuel Vadot pinctrl-names = "default"; 154f126890aSEmmanuel Vadot pinctrl-0 = <&r_ir_rx_pin>; 155f126890aSEmmanuel Vadot status = "okay"; 156f126890aSEmmanuel Vadot}; 157f126890aSEmmanuel Vadot 158f126890aSEmmanuel Vadot&mmc0 { 159f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 160f126890aSEmmanuel Vadot bus-width = <4>; 161f126890aSEmmanuel Vadot cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 162f126890aSEmmanuel Vadot status = "okay"; 163f126890aSEmmanuel Vadot}; 164f126890aSEmmanuel Vadot 165f126890aSEmmanuel Vadot&mmc1 { 166f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 167f126890aSEmmanuel Vadot vqmmc-supply = <®_vcc3v3>; 168f126890aSEmmanuel Vadot mmc-pwrseq = <&wifi_pwrseq>; 169f126890aSEmmanuel Vadot bus-width = <4>; 170f126890aSEmmanuel Vadot non-removable; 171f126890aSEmmanuel Vadot status = "okay"; 172f126890aSEmmanuel Vadot 173f126890aSEmmanuel Vadot brcmf: wifi@1 { 174f126890aSEmmanuel Vadot reg = <1>; 175f126890aSEmmanuel Vadot compatible = "brcm,bcm4329-fmac"; 176f126890aSEmmanuel Vadot interrupt-parent = <&pio>; 177f126890aSEmmanuel Vadot interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ 178f126890aSEmmanuel Vadot interrupt-names = "host-wake"; 179f126890aSEmmanuel Vadot }; 180f126890aSEmmanuel Vadot}; 181f126890aSEmmanuel Vadot 182f126890aSEmmanuel Vadot&mmc2 { 183f126890aSEmmanuel Vadot pinctrl-names = "default"; 184f126890aSEmmanuel Vadot pinctrl-0 = <&mmc2_8bit_pins>; 185f126890aSEmmanuel Vadot vmmc-supply = <®_vcc3v3>; 186f126890aSEmmanuel Vadot vqmmc-supply = <®_vcc3v3>; 187f126890aSEmmanuel Vadot bus-width = <8>; 188f126890aSEmmanuel Vadot non-removable; 189f126890aSEmmanuel Vadot status = "okay"; 190f126890aSEmmanuel Vadot}; 191f126890aSEmmanuel Vadot 192f126890aSEmmanuel Vadot&ohci0 { 193f126890aSEmmanuel Vadot status = "okay"; 194f126890aSEmmanuel Vadot}; 195f126890aSEmmanuel Vadot 196f126890aSEmmanuel Vadot&ohci1 { 197f126890aSEmmanuel Vadot status = "okay"; 198f126890aSEmmanuel Vadot}; 199f126890aSEmmanuel Vadot 200f126890aSEmmanuel Vadot&ohci2 { 201f126890aSEmmanuel Vadot status = "okay"; 202f126890aSEmmanuel Vadot}; 203f126890aSEmmanuel Vadot 204f126890aSEmmanuel Vadot®_usb0_vbus { 205f126890aSEmmanuel Vadot gpio = <&pio 3 11 GPIO_ACTIVE_HIGH>; /* PD11 */ 206f126890aSEmmanuel Vadot status = "okay"; 207f126890aSEmmanuel Vadot}; 208f126890aSEmmanuel Vadot 209f126890aSEmmanuel Vadot&uart0 { 210f126890aSEmmanuel Vadot pinctrl-names = "default"; 211f126890aSEmmanuel Vadot pinctrl-0 = <&uart0_pa_pins>; 212f126890aSEmmanuel Vadot status = "okay"; 213f126890aSEmmanuel Vadot}; 214f126890aSEmmanuel Vadot 215f126890aSEmmanuel Vadot&uart1 { 216f126890aSEmmanuel Vadot pinctrl-names = "default"; 217f126890aSEmmanuel Vadot pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 218f126890aSEmmanuel Vadot uart-has-rtscts; 219f126890aSEmmanuel Vadot status = "okay"; 220f126890aSEmmanuel Vadot 221f126890aSEmmanuel Vadot bluetooth { 222f126890aSEmmanuel Vadot compatible = "brcm,bcm43438-bt"; 223f126890aSEmmanuel Vadot max-speed = <1500000>; 224f126890aSEmmanuel Vadot clocks = <&rtc CLK_OSC32K_FANOUT>; 225f126890aSEmmanuel Vadot clock-names = "lpo"; 226f126890aSEmmanuel Vadot vbat-supply = <®_vcc3v3>; 227f126890aSEmmanuel Vadot vddio-supply = <®_vcc3v3>; 228f126890aSEmmanuel Vadot device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ 229f126890aSEmmanuel Vadot host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ 230f126890aSEmmanuel Vadot shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ 231f126890aSEmmanuel Vadot }; 232f126890aSEmmanuel Vadot}; 233f126890aSEmmanuel Vadot 234f126890aSEmmanuel Vadot&usb_otg { 235f126890aSEmmanuel Vadot dr_mode = "otg"; 236f126890aSEmmanuel Vadot status = "okay"; 237f126890aSEmmanuel Vadot}; 238f126890aSEmmanuel Vadot 239f126890aSEmmanuel Vadot&usbphy { 240f126890aSEmmanuel Vadot usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ 241f126890aSEmmanuel Vadot usb0_vbus-supply = <®_usb0_vbus>; 242f126890aSEmmanuel Vadot /* USB host VBUS is on as long as VCC-IO is on */ 243f126890aSEmmanuel Vadot status = "okay"; 244f126890aSEmmanuel Vadot}; 245