12ff28361SIcenowy Zheng/*
22ff28361SIcenowy Zheng * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
32ff28361SIcenowy Zheng *
42ff28361SIcenowy Zheng * Based on sun50i-h5-orangepi-pc2.dts, which is:
52ff28361SIcenowy Zheng *   Copyright (C) 2016 ARM Ltd.
62ff28361SIcenowy Zheng *
72ff28361SIcenowy Zheng * This file is dual-licensed: you can use it either under the terms
82ff28361SIcenowy Zheng * of the GPL or the X11 license, at your option. Note that this dual
92ff28361SIcenowy Zheng * licensing only applies to this file, and not this project as a
102ff28361SIcenowy Zheng * whole.
112ff28361SIcenowy Zheng *
122ff28361SIcenowy Zheng *  a) This file is free software; you can redistribute it and/or
132ff28361SIcenowy Zheng *     modify it under the terms of the GNU General Public License as
142ff28361SIcenowy Zheng *     published by the Free Software Foundation; either version 2 of the
152ff28361SIcenowy Zheng *     License, or (at your option) any later version.
162ff28361SIcenowy Zheng *
172ff28361SIcenowy Zheng *     This file is distributed in the hope that it will be useful,
182ff28361SIcenowy Zheng *     but WITHOUT ANY WARRANTY; without even the implied warranty of
192ff28361SIcenowy Zheng *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
202ff28361SIcenowy Zheng *     GNU General Public License for more details.
212ff28361SIcenowy Zheng *
222ff28361SIcenowy Zheng * Or, alternatively,
232ff28361SIcenowy Zheng *
242ff28361SIcenowy Zheng *  b) Permission is hereby granted, free of charge, to any person
252ff28361SIcenowy Zheng *     obtaining a copy of this software and associated documentation
262ff28361SIcenowy Zheng *     files (the "Software"), to deal in the Software without
272ff28361SIcenowy Zheng *     restriction, including without limitation the rights to use,
282ff28361SIcenowy Zheng *     copy, modify, merge, publish, distribute, sublicense, and/or
292ff28361SIcenowy Zheng *     sell copies of the Software, and to permit persons to whom the
302ff28361SIcenowy Zheng *     Software is furnished to do so, subject to the following
312ff28361SIcenowy Zheng *     conditions:
322ff28361SIcenowy Zheng *
332ff28361SIcenowy Zheng *     The above copyright notice and this permission notice shall be
342ff28361SIcenowy Zheng *     included in all copies or substantial portions of the Software.
352ff28361SIcenowy Zheng *
362ff28361SIcenowy Zheng *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
372ff28361SIcenowy Zheng *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
382ff28361SIcenowy Zheng *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
392ff28361SIcenowy Zheng *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
402ff28361SIcenowy Zheng *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
412ff28361SIcenowy Zheng *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
422ff28361SIcenowy Zheng *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
432ff28361SIcenowy Zheng *     OTHER DEALINGS IN THE SOFTWARE.
442ff28361SIcenowy Zheng */
452ff28361SIcenowy Zheng
462ff28361SIcenowy Zheng/dts-v1/;
472ff28361SIcenowy Zheng#include "sun50i-h5.dtsi"
482ff28361SIcenowy Zheng
492ff28361SIcenowy Zheng#include <dt-bindings/gpio/gpio.h>
502ff28361SIcenowy Zheng#include <dt-bindings/input/input.h>
512ff28361SIcenowy Zheng
522ff28361SIcenowy Zheng/ {
532ff28361SIcenowy Zheng	model = "Xunlong Orange Pi Prime";
542ff28361SIcenowy Zheng	compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5";
552ff28361SIcenowy Zheng
562ff28361SIcenowy Zheng	aliases {
572ff28361SIcenowy Zheng		serial0 = &uart0;
582ff28361SIcenowy Zheng	};
592ff28361SIcenowy Zheng
602ff28361SIcenowy Zheng	chosen {
612ff28361SIcenowy Zheng		stdout-path = "serial0:115200n8";
622ff28361SIcenowy Zheng	};
632ff28361SIcenowy Zheng
642ff28361SIcenowy Zheng	leds {
652ff28361SIcenowy Zheng		compatible = "gpio-leds";
662ff28361SIcenowy Zheng
672ff28361SIcenowy Zheng		pwr {
682ff28361SIcenowy Zheng			label = "orangepi:green:pwr";
692ff28361SIcenowy Zheng			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
702ff28361SIcenowy Zheng			default-state = "on";
712ff28361SIcenowy Zheng		};
722ff28361SIcenowy Zheng
732ff28361SIcenowy Zheng		status {
742ff28361SIcenowy Zheng			label = "orangepi:red:status";
752ff28361SIcenowy Zheng			gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
762ff28361SIcenowy Zheng		};
772ff28361SIcenowy Zheng	};
782ff28361SIcenowy Zheng
792ff28361SIcenowy Zheng	r-gpio-keys {
802ff28361SIcenowy Zheng		compatible = "gpio-keys";
812ff28361SIcenowy Zheng
822ff28361SIcenowy Zheng		sw4 {
832ff28361SIcenowy Zheng			label = "sw4";
842ff28361SIcenowy Zheng			linux,code = <BTN_0>;
852ff28361SIcenowy Zheng			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
862ff28361SIcenowy Zheng		};
872ff28361SIcenowy Zheng	};
882ff28361SIcenowy Zheng
899907da07SIcenowy Zheng	reg_vcc3v3: vcc3v3 {
909907da07SIcenowy Zheng		compatible = "regulator-fixed";
919907da07SIcenowy Zheng		regulator-name = "vcc3v3";
929907da07SIcenowy Zheng		regulator-min-microvolt = <3300000>;
939907da07SIcenowy Zheng		regulator-max-microvolt = <3300000>;
949907da07SIcenowy Zheng	};
959907da07SIcenowy Zheng
962ff28361SIcenowy Zheng	reg_usb0_vbus: usb0-vbus {
972ff28361SIcenowy Zheng		compatible = "regulator-fixed";
982ff28361SIcenowy Zheng		regulator-name = "usb0-vbus";
992ff28361SIcenowy Zheng		regulator-min-microvolt = <5000000>;
1002ff28361SIcenowy Zheng		regulator-max-microvolt = <5000000>;
1012ff28361SIcenowy Zheng		enable-active-high;
1022ff28361SIcenowy Zheng		gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
1032ff28361SIcenowy Zheng		status = "okay";
1042ff28361SIcenowy Zheng	};
1052ff28361SIcenowy Zheng
1062ff28361SIcenowy Zheng	wifi_pwrseq: wifi_pwrseq {
1072ff28361SIcenowy Zheng		compatible = "mmc-pwrseq-simple";
1082ff28361SIcenowy Zheng		reset-gpios = <&pio 2 14 GPIO_ACTIVE_LOW>; /* PC14 */
1092ff28361SIcenowy Zheng	};
1102ff28361SIcenowy Zheng};
1112ff28361SIcenowy Zheng
1122ff28361SIcenowy Zheng&codec {
1132ff28361SIcenowy Zheng	allwinner,audio-routing =
1142ff28361SIcenowy Zheng		"Line Out", "LINEOUT",
1152ff28361SIcenowy Zheng		"MIC1", "Mic",
1162ff28361SIcenowy Zheng		"Mic",  "MBIAS";
1172ff28361SIcenowy Zheng	status = "okay";
1182ff28361SIcenowy Zheng};
1192ff28361SIcenowy Zheng
1202ff28361SIcenowy Zheng&ehci0 {
1212ff28361SIcenowy Zheng	status = "okay";
1222ff28361SIcenowy Zheng};
1232ff28361SIcenowy Zheng
1242ff28361SIcenowy Zheng&ehci1 {
1252ff28361SIcenowy Zheng	status = "okay";
1262ff28361SIcenowy Zheng};
1272ff28361SIcenowy Zheng
1282ff28361SIcenowy Zheng&ehci2 {
1292ff28361SIcenowy Zheng	status = "okay";
1302ff28361SIcenowy Zheng};
1312ff28361SIcenowy Zheng
1322ff28361SIcenowy Zheng&ehci3 {
1332ff28361SIcenowy Zheng	status = "okay";
1342ff28361SIcenowy Zheng};
1352ff28361SIcenowy Zheng
1362ff28361SIcenowy Zheng&ir {
1372ff28361SIcenowy Zheng	pinctrl-names = "default";
1382ff28361SIcenowy Zheng	pinctrl-0 = <&ir_pins_a>;
1392ff28361SIcenowy Zheng	status = "okay";
1402ff28361SIcenowy Zheng};
1412ff28361SIcenowy Zheng
1422ff28361SIcenowy Zheng&mmc0 {
1432ff28361SIcenowy Zheng	pinctrl-names = "default";
1442ff28361SIcenowy Zheng	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
1452ff28361SIcenowy Zheng	vmmc-supply = <&reg_vcc3v3>;
1462ff28361SIcenowy Zheng	bus-width = <4>;
1472ff28361SIcenowy Zheng	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
1482ff28361SIcenowy Zheng	status = "okay";
1492ff28361SIcenowy Zheng};
1502ff28361SIcenowy Zheng
1512ff28361SIcenowy Zheng&mmc1 {
1522ff28361SIcenowy Zheng	pinctrl-names = "default";
1532ff28361SIcenowy Zheng	pinctrl-0 = <&mmc1_pins_a>;
1542ff28361SIcenowy Zheng	vmmc-supply = <&reg_vcc3v3>;
1552ff28361SIcenowy Zheng	mmc-pwrseq = <&wifi_pwrseq>;
1562ff28361SIcenowy Zheng	bus-width = <4>;
1572ff28361SIcenowy Zheng	non-removable;
1582ff28361SIcenowy Zheng	status = "okay";
1592ff28361SIcenowy Zheng};
1602ff28361SIcenowy Zheng
1612ff28361SIcenowy Zheng&ohci0 {
1622ff28361SIcenowy Zheng	status = "okay";
1632ff28361SIcenowy Zheng};
1642ff28361SIcenowy Zheng
1652ff28361SIcenowy Zheng&ohci1 {
1662ff28361SIcenowy Zheng	status = "okay";
1672ff28361SIcenowy Zheng};
1682ff28361SIcenowy Zheng
1692ff28361SIcenowy Zheng&ohci2 {
1702ff28361SIcenowy Zheng	status = "okay";
1712ff28361SIcenowy Zheng};
1722ff28361SIcenowy Zheng
1732ff28361SIcenowy Zheng&ohci3 {
1742ff28361SIcenowy Zheng	status = "okay";
1752ff28361SIcenowy Zheng};
1762ff28361SIcenowy Zheng
1772ff28361SIcenowy Zheng&uart0 {
1782ff28361SIcenowy Zheng	pinctrl-names = "default";
1792ff28361SIcenowy Zheng	pinctrl-0 = <&uart0_pins_a>;
1802ff28361SIcenowy Zheng	status = "okay";
1812ff28361SIcenowy Zheng};
1822ff28361SIcenowy Zheng
1832ff28361SIcenowy Zheng&uart1 {
1842ff28361SIcenowy Zheng	pinctrl-names = "default";
1852ff28361SIcenowy Zheng	pinctrl-0 = <&uart1_pins>;
1862ff28361SIcenowy Zheng	status = "disabled";
1872ff28361SIcenowy Zheng};
1882ff28361SIcenowy Zheng
1892ff28361SIcenowy Zheng&uart2 {
1902ff28361SIcenowy Zheng	pinctrl-names = "default";
1912ff28361SIcenowy Zheng	pinctrl-0 = <&uart2_pins>;
1922ff28361SIcenowy Zheng	status = "disabled";
1932ff28361SIcenowy Zheng};
1942ff28361SIcenowy Zheng
1952ff28361SIcenowy Zheng&usb_otg {
1962ff28361SIcenowy Zheng	dr_mode = "otg";
1972ff28361SIcenowy Zheng	status = "okay";
1982ff28361SIcenowy Zheng};
1992ff28361SIcenowy Zheng
2002ff28361SIcenowy Zheng&usbphy {
2012ff28361SIcenowy Zheng	/* USB Type-A ports' VBUS is always on */
2022ff28361SIcenowy Zheng	usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
2032ff28361SIcenowy Zheng	usb0_vbus-supply = <&reg_usb0_vbus>;
2042ff28361SIcenowy Zheng	status = "okay";
2052ff28361SIcenowy Zheng};
206