xref: /freebsd/sys/contrib/device-tree/src/arm64/allwinner/sun50i-h5-nanopi-r1s-h5.dts (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
15956d97fSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
25956d97fSEmmanuel Vadot/*
35956d97fSEmmanuel Vadot * Copyright (C) 2021 Chukun Pan <amadeus@jmu.edu.cn>
45956d97fSEmmanuel Vadot *
55956d97fSEmmanuel Vadot * Based on sun50i-h5-nanopi-neo-plus2.dts, which is:
65956d97fSEmmanuel Vadot *   Copyright (C) 2017 Antony Antony <antony@phenome.org>
75956d97fSEmmanuel Vadot *   Copyright (C) 2016 ARM Ltd.
85956d97fSEmmanuel Vadot */
95956d97fSEmmanuel Vadot
105956d97fSEmmanuel Vadot/dts-v1/;
115956d97fSEmmanuel Vadot#include "sun50i-h5.dtsi"
125956d97fSEmmanuel Vadot#include "sun50i-h5-cpu-opp.dtsi"
135956d97fSEmmanuel Vadot
145956d97fSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
155956d97fSEmmanuel Vadot#include <dt-bindings/input/input.h>
165956d97fSEmmanuel Vadot#include <dt-bindings/leds/common.h>
175956d97fSEmmanuel Vadot
185956d97fSEmmanuel Vadot/ {
195956d97fSEmmanuel Vadot	model = "FriendlyARM NanoPi R1S H5";
205956d97fSEmmanuel Vadot	compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5";
215956d97fSEmmanuel Vadot
225956d97fSEmmanuel Vadot	aliases {
235956d97fSEmmanuel Vadot		ethernet0 = &emac;
245956d97fSEmmanuel Vadot		ethernet1 = &rtl8189etv;
255956d97fSEmmanuel Vadot		serial0 = &uart0;
265956d97fSEmmanuel Vadot	};
275956d97fSEmmanuel Vadot
285956d97fSEmmanuel Vadot	chosen {
295956d97fSEmmanuel Vadot		stdout-path = "serial0:115200n8";
305956d97fSEmmanuel Vadot	};
315956d97fSEmmanuel Vadot
325956d97fSEmmanuel Vadot	leds {
335956d97fSEmmanuel Vadot		compatible = "gpio-leds";
345956d97fSEmmanuel Vadot
355956d97fSEmmanuel Vadot		led-0 {
365956d97fSEmmanuel Vadot			function = LED_FUNCTION_LAN;
375956d97fSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
385956d97fSEmmanuel Vadot			gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
395956d97fSEmmanuel Vadot		};
405956d97fSEmmanuel Vadot
415956d97fSEmmanuel Vadot		led-1 {
425956d97fSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
435956d97fSEmmanuel Vadot			color = <LED_COLOR_ID_RED>;
445956d97fSEmmanuel Vadot			gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
455956d97fSEmmanuel Vadot			linux,default-trigger = "heartbeat";
465956d97fSEmmanuel Vadot		};
475956d97fSEmmanuel Vadot
485956d97fSEmmanuel Vadot		led-2 {
495956d97fSEmmanuel Vadot			function = LED_FUNCTION_WAN;
505956d97fSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
515956d97fSEmmanuel Vadot			gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
525956d97fSEmmanuel Vadot		};
535956d97fSEmmanuel Vadot	};
545956d97fSEmmanuel Vadot
55b97ee269SEmmanuel Vadot	gpio-keys {
565956d97fSEmmanuel Vadot		compatible = "gpio-keys";
575956d97fSEmmanuel Vadot
58b97ee269SEmmanuel Vadot		key-reset {
595956d97fSEmmanuel Vadot			label = "reset";
605956d97fSEmmanuel Vadot			linux,code = <KEY_RESTART>;
615956d97fSEmmanuel Vadot			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
625956d97fSEmmanuel Vadot		};
635956d97fSEmmanuel Vadot	};
645956d97fSEmmanuel Vadot
655956d97fSEmmanuel Vadot	reg_gmac_3v3: gmac-3v3 {
665956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
675956d97fSEmmanuel Vadot		regulator-name = "gmac-3v3";
685956d97fSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
695956d97fSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
705956d97fSEmmanuel Vadot		startup-delay-us = <100000>;
715956d97fSEmmanuel Vadot		enable-active-high;
725956d97fSEmmanuel Vadot		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
735956d97fSEmmanuel Vadot	};
745956d97fSEmmanuel Vadot
755956d97fSEmmanuel Vadot	reg_vcc3v3: vcc3v3 {
765956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
775956d97fSEmmanuel Vadot		regulator-name = "vcc3v3";
785956d97fSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
795956d97fSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
805956d97fSEmmanuel Vadot	};
815956d97fSEmmanuel Vadot
825956d97fSEmmanuel Vadot	reg_usb0_vbus: usb0-vbus {
835956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
845956d97fSEmmanuel Vadot		regulator-name = "usb0-vbus";
855956d97fSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
865956d97fSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
875956d97fSEmmanuel Vadot		enable-active-high;
885956d97fSEmmanuel Vadot		gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
895956d97fSEmmanuel Vadot		status = "okay";
905956d97fSEmmanuel Vadot	};
915956d97fSEmmanuel Vadot
925956d97fSEmmanuel Vadot	vdd_cpux: gpio-regulator {
935956d97fSEmmanuel Vadot		compatible = "regulator-gpio";
945956d97fSEmmanuel Vadot		regulator-name = "vdd-cpux";
955956d97fSEmmanuel Vadot		regulator-type = "voltage";
965956d97fSEmmanuel Vadot		regulator-boot-on;
975956d97fSEmmanuel Vadot		regulator-always-on;
985956d97fSEmmanuel Vadot		regulator-min-microvolt = <1100000>;
995956d97fSEmmanuel Vadot		regulator-max-microvolt = <1300000>;
1005956d97fSEmmanuel Vadot		regulator-ramp-delay = <50>; /* 4ms */
1015956d97fSEmmanuel Vadot		gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
1025956d97fSEmmanuel Vadot		gpios-states = <0x1>;
1035956d97fSEmmanuel Vadot		states = <1100000 0x0>, <1300000 0x1>;
1045956d97fSEmmanuel Vadot	};
1055956d97fSEmmanuel Vadot
106*7d0873ebSEmmanuel Vadot	wifi_pwrseq: pwrseq {
1075956d97fSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
1085956d97fSEmmanuel Vadot		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
1095956d97fSEmmanuel Vadot		post-power-on-delay-ms = <200>;
1105956d97fSEmmanuel Vadot	};
1115956d97fSEmmanuel Vadot};
1125956d97fSEmmanuel Vadot
1135956d97fSEmmanuel Vadot&cpu0 {
1145956d97fSEmmanuel Vadot	cpu-supply = <&vdd_cpux>;
1155956d97fSEmmanuel Vadot};
1165956d97fSEmmanuel Vadot
1175956d97fSEmmanuel Vadot&ehci1 {
1185956d97fSEmmanuel Vadot	status = "okay";
1195956d97fSEmmanuel Vadot};
1205956d97fSEmmanuel Vadot
1215956d97fSEmmanuel Vadot&ehci2 {
1225956d97fSEmmanuel Vadot	status = "okay";
1235956d97fSEmmanuel Vadot};
1245956d97fSEmmanuel Vadot
1255956d97fSEmmanuel Vadot&emac {
1265956d97fSEmmanuel Vadot	pinctrl-names = "default";
1275956d97fSEmmanuel Vadot	pinctrl-0 = <&emac_rgmii_pins>;
1285956d97fSEmmanuel Vadot	phy-supply = <&reg_gmac_3v3>;
1295956d97fSEmmanuel Vadot	phy-handle = <&ext_rgmii_phy>;
1305956d97fSEmmanuel Vadot	phy-mode = "rgmii-id";
1315956d97fSEmmanuel Vadot	status = "okay";
1325956d97fSEmmanuel Vadot};
1335956d97fSEmmanuel Vadot
1345956d97fSEmmanuel Vadot&external_mdio {
1355956d97fSEmmanuel Vadot	ext_rgmii_phy: ethernet-phy@7 {
1365956d97fSEmmanuel Vadot		compatible = "ethernet-phy-ieee802.3-c22";
1375956d97fSEmmanuel Vadot		reg = <7>;
1385956d97fSEmmanuel Vadot	};
1395956d97fSEmmanuel Vadot};
1405956d97fSEmmanuel Vadot
1415956d97fSEmmanuel Vadot&i2c0 {
1425956d97fSEmmanuel Vadot	status = "okay";
1435956d97fSEmmanuel Vadot
1445956d97fSEmmanuel Vadot	eeprom@51 {
1458cc087a1SEmmanuel Vadot		compatible = "microchip,24c02", "atmel,24c02";
1465956d97fSEmmanuel Vadot		reg = <0x51>;
1475956d97fSEmmanuel Vadot		pagesize = <16>;
1488cc087a1SEmmanuel Vadot		read-only;
1498cc087a1SEmmanuel Vadot		#address-cells = <1>;
1508cc087a1SEmmanuel Vadot		#size-cells = <1>;
1518cc087a1SEmmanuel Vadot
1528cc087a1SEmmanuel Vadot		eth_mac1: mac-address@fa {
1538cc087a1SEmmanuel Vadot			reg = <0xfa 0x06>;
1548cc087a1SEmmanuel Vadot		};
1555956d97fSEmmanuel Vadot	};
1565956d97fSEmmanuel Vadot};
1575956d97fSEmmanuel Vadot
1585956d97fSEmmanuel Vadot&mmc0 {
1595956d97fSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
1605956d97fSEmmanuel Vadot	bus-width = <4>;
1615956d97fSEmmanuel Vadot	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
1625956d97fSEmmanuel Vadot	status = "okay";
1635956d97fSEmmanuel Vadot};
1645956d97fSEmmanuel Vadot
1655956d97fSEmmanuel Vadot&mmc1 {
1665956d97fSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
1675956d97fSEmmanuel Vadot	vqmmc-supply = <&reg_vcc3v3>;
1685956d97fSEmmanuel Vadot	mmc-pwrseq = <&wifi_pwrseq>;
1695956d97fSEmmanuel Vadot	bus-width = <4>;
1705956d97fSEmmanuel Vadot	non-removable;
1715956d97fSEmmanuel Vadot	status = "okay";
1725956d97fSEmmanuel Vadot
173*7d0873ebSEmmanuel Vadot	rtl8189etv: wifi@1 {
1745956d97fSEmmanuel Vadot		reg = <1>;
1755956d97fSEmmanuel Vadot	};
1765956d97fSEmmanuel Vadot};
1775956d97fSEmmanuel Vadot
1785956d97fSEmmanuel Vadot&ohci1 {
1795956d97fSEmmanuel Vadot	status = "okay";
1805956d97fSEmmanuel Vadot};
1815956d97fSEmmanuel Vadot
1825956d97fSEmmanuel Vadot&ohci2 {
1835956d97fSEmmanuel Vadot	status = "okay";
1845956d97fSEmmanuel Vadot};
1855956d97fSEmmanuel Vadot
1865956d97fSEmmanuel Vadot&uart0 {
1875956d97fSEmmanuel Vadot	pinctrl-names = "default";
1885956d97fSEmmanuel Vadot	pinctrl-0 = <&uart0_pa_pins>;
1895956d97fSEmmanuel Vadot	status = "okay";
1905956d97fSEmmanuel Vadot};
1915956d97fSEmmanuel Vadot
1925956d97fSEmmanuel Vadot&usb_otg {
1935956d97fSEmmanuel Vadot	dr_mode = "peripheral";
1945956d97fSEmmanuel Vadot	status = "okay";
1955956d97fSEmmanuel Vadot};
1965956d97fSEmmanuel Vadot
1975956d97fSEmmanuel Vadot&usbphy {
1985956d97fSEmmanuel Vadot	/* USB Type-A port's VBUS is always on */
1995956d97fSEmmanuel Vadot	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
2005956d97fSEmmanuel Vadot	usb0_vbus-supply = <&reg_usb0_vbus>;
2015956d97fSEmmanuel Vadot	status = "okay";
2025956d97fSEmmanuel Vadot};
203