0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (C) 2021 Chukun Pan <amadeus@jmu.edu.cn>
0004 *
0005 * Based on sun50i-h5-nanopi-neo-plus2.dts, which is:
0006 * Copyright (C) 2017 Antony Antony <antony@phenome.org>
0007 * Copyright (C) 2016 ARM Ltd.
0008 */
0009
0010 /dts-v1/;
0011 #include "sun50i-h5.dtsi"
0012 #include "sun50i-h5-cpu-opp.dtsi"
0013
0014 #include <dt-bindings/gpio/gpio.h>
0015 #include <dt-bindings/input/input.h>
0016 #include <dt-bindings/leds/common.h>
0017
0018 / {
0019 model = "FriendlyARM NanoPi R1S H5";
0020 compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5";
0021
0022 aliases {
0023 ethernet0 = &emac;
0024 ethernet1 = &rtl8189etv;
0025 serial0 = &uart0;
0026 };
0027
0028 chosen {
0029 stdout-path = "serial0:115200n8";
0030 };
0031
0032 leds {
0033 compatible = "gpio-leds";
0034
0035 led-0 {
0036 function = LED_FUNCTION_LAN;
0037 color = <LED_COLOR_ID_GREEN>;
0038 gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
0039 };
0040
0041 led-1 {
0042 function = LED_FUNCTION_STATUS;
0043 color = <LED_COLOR_ID_RED>;
0044 gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
0045 linux,default-trigger = "heartbeat";
0046 };
0047
0048 led-2 {
0049 function = LED_FUNCTION_WAN;
0050 color = <LED_COLOR_ID_GREEN>;
0051 gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
0052 };
0053 };
0054
0055 gpio-keys {
0056 compatible = "gpio-keys";
0057
0058 key-reset {
0059 label = "reset";
0060 linux,code = <KEY_RESTART>;
0061 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
0062 };
0063 };
0064
0065 reg_gmac_3v3: gmac-3v3 {
0066 compatible = "regulator-fixed";
0067 regulator-name = "gmac-3v3";
0068 regulator-min-microvolt = <3300000>;
0069 regulator-max-microvolt = <3300000>;
0070 startup-delay-us = <100000>;
0071 enable-active-high;
0072 gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
0073 };
0074
0075 reg_vcc3v3: vcc3v3 {
0076 compatible = "regulator-fixed";
0077 regulator-name = "vcc3v3";
0078 regulator-min-microvolt = <3300000>;
0079 regulator-max-microvolt = <3300000>;
0080 };
0081
0082 reg_usb0_vbus: usb0-vbus {
0083 compatible = "regulator-fixed";
0084 regulator-name = "usb0-vbus";
0085 regulator-min-microvolt = <5000000>;
0086 regulator-max-microvolt = <5000000>;
0087 enable-active-high;
0088 gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
0089 status = "okay";
0090 };
0091
0092 vdd_cpux: gpio-regulator {
0093 compatible = "regulator-gpio";
0094 regulator-name = "vdd-cpux";
0095 regulator-type = "voltage";
0096 regulator-boot-on;
0097 regulator-always-on;
0098 regulator-min-microvolt = <1100000>;
0099 regulator-max-microvolt = <1300000>;
0100 regulator-ramp-delay = <50>; /* 4ms */
0101 gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
0102 gpios-states = <0x1>;
0103 states = <1100000 0x0>, <1300000 0x1>;
0104 };
0105
0106 wifi_pwrseq: wifi_pwrseq {
0107 compatible = "mmc-pwrseq-simple";
0108 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
0109 post-power-on-delay-ms = <200>;
0110 };
0111 };
0112
0113 &cpu0 {
0114 cpu-supply = <&vdd_cpux>;
0115 };
0116
0117 &ehci1 {
0118 status = "okay";
0119 };
0120
0121 &ehci2 {
0122 status = "okay";
0123 };
0124
0125 &emac {
0126 pinctrl-names = "default";
0127 pinctrl-0 = <&emac_rgmii_pins>;
0128 phy-supply = <®_gmac_3v3>;
0129 phy-handle = <&ext_rgmii_phy>;
0130 phy-mode = "rgmii-id";
0131 status = "okay";
0132 };
0133
0134 &external_mdio {
0135 ext_rgmii_phy: ethernet-phy@7 {
0136 compatible = "ethernet-phy-ieee802.3-c22";
0137 reg = <7>;
0138 };
0139 };
0140
0141 &i2c0 {
0142 status = "okay";
0143
0144 eeprom@51 {
0145 compatible = "microchip,24c02", "atmel,24c02";
0146 reg = <0x51>;
0147 pagesize = <16>;
0148 read-only;
0149 #address-cells = <1>;
0150 #size-cells = <1>;
0151
0152 eth_mac1: mac-address@fa {
0153 reg = <0xfa 0x06>;
0154 };
0155 };
0156 };
0157
0158 &mmc0 {
0159 vmmc-supply = <®_vcc3v3>;
0160 bus-width = <4>;
0161 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
0162 status = "okay";
0163 };
0164
0165 &mmc1 {
0166 vmmc-supply = <®_vcc3v3>;
0167 vqmmc-supply = <®_vcc3v3>;
0168 mmc-pwrseq = <&wifi_pwrseq>;
0169 bus-width = <4>;
0170 non-removable;
0171 status = "okay";
0172
0173 rtl8189etv: sdio_wifi@1 {
0174 reg = <1>;
0175 };
0176 };
0177
0178 &ohci1 {
0179 status = "okay";
0180 };
0181
0182 &ohci2 {
0183 status = "okay";
0184 };
0185
0186 &uart0 {
0187 pinctrl-names = "default";
0188 pinctrl-0 = <&uart0_pa_pins>;
0189 status = "okay";
0190 };
0191
0192 &usb_otg {
0193 dr_mode = "peripheral";
0194 status = "okay";
0195 };
0196
0197 &usbphy {
0198 /* USB Type-A port's VBUS is always on */
0199 usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0200 usb0_vbus-supply = <®_usb0_vbus>;
0201 status = "okay";
0202 };