1c6629b9aSVasily Khoruzhick// SPDX-License-Identifier: GPL-2.0-or-later OR MIT 2c6629b9aSVasily Khoruzhick/* 3c6629b9aSVasily Khoruzhick * Copyright (c) 2022 FriendlyElec Computer Tech. Co., Ltd. 4c6629b9aSVasily Khoruzhick * (http://www.friendlyelec.com) 5c6629b9aSVasily Khoruzhick * 6c6629b9aSVasily Khoruzhick * Copyright (c) 2023 Tianling Shen <cnsztl@gmail.com> 7c6629b9aSVasily Khoruzhick */ 8c6629b9aSVasily Khoruzhick 9c6629b9aSVasily Khoruzhick/dts-v1/; 10c8ec73b0STianling Shen#include "rk3568-nanopi-r5s.dtsi" 11c6629b9aSVasily Khoruzhick 12c6629b9aSVasily Khoruzhick/ { 13c6629b9aSVasily Khoruzhick model = "FriendlyElec NanoPi R5S"; 14c6629b9aSVasily Khoruzhick compatible = "friendlyarm,nanopi-r5s", "rockchip,rk3568"; 15c6629b9aSVasily Khoruzhick 16c6629b9aSVasily Khoruzhick aliases { 17c6629b9aSVasily Khoruzhick ethernet0 = &gmac0; 18c6629b9aSVasily Khoruzhick }; 19c6629b9aSVasily Khoruzhick 20c6629b9aSVasily Khoruzhick gpio-leds { 21c6629b9aSVasily Khoruzhick compatible = "gpio-leds"; 22c6629b9aSVasily Khoruzhick pinctrl-names = "default"; 23c6629b9aSVasily Khoruzhick pinctrl-0 = <&lan1_led_pin>, <&lan2_led_pin>, <&power_led_pin>, <&wan_led_pin>; 24c6629b9aSVasily Khoruzhick 25c6629b9aSVasily Khoruzhick led-lan1 { 26c6629b9aSVasily Khoruzhick color = <LED_COLOR_ID_GREEN>; 27c6629b9aSVasily Khoruzhick function = LED_FUNCTION_LAN; 28c6629b9aSVasily Khoruzhick function-enumerator = <1>; 29c6629b9aSVasily Khoruzhick gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; 30c6629b9aSVasily Khoruzhick }; 31c6629b9aSVasily Khoruzhick 32c6629b9aSVasily Khoruzhick led-lan2 { 33c6629b9aSVasily Khoruzhick color = <LED_COLOR_ID_GREEN>; 34c6629b9aSVasily Khoruzhick function = LED_FUNCTION_LAN; 35c6629b9aSVasily Khoruzhick function-enumerator = <2>; 36c6629b9aSVasily Khoruzhick gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; 37c6629b9aSVasily Khoruzhick }; 38c6629b9aSVasily Khoruzhick 39c6629b9aSVasily Khoruzhick power_led: led-power { 40c6629b9aSVasily Khoruzhick color = <LED_COLOR_ID_RED>; 41c6629b9aSVasily Khoruzhick function = LED_FUNCTION_POWER; 42c6629b9aSVasily Khoruzhick linux,default-trigger = "heartbeat"; 43c6629b9aSVasily Khoruzhick gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; 44c6629b9aSVasily Khoruzhick }; 45c6629b9aSVasily Khoruzhick 46c6629b9aSVasily Khoruzhick led-wan { 47c6629b9aSVasily Khoruzhick color = <LED_COLOR_ID_GREEN>; 48c6629b9aSVasily Khoruzhick function = LED_FUNCTION_WAN; 49c6629b9aSVasily Khoruzhick gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 50c6629b9aSVasily Khoruzhick }; 51c6629b9aSVasily Khoruzhick }; 52c6629b9aSVasily Khoruzhick}; 53c6629b9aSVasily Khoruzhick 54c6629b9aSVasily Khoruzhick&gmac0 { 55c6629b9aSVasily Khoruzhick assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; 56c6629b9aSVasily Khoruzhick assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; 57c6629b9aSVasily Khoruzhick assigned-clock-rates = <0>, <125000000>; 58c6629b9aSVasily Khoruzhick clock_in_out = "output"; 59c6629b9aSVasily Khoruzhick phy-handle = <&rgmii_phy0>; 60*31425b1fSTianling Shen phy-mode = "rgmii"; 61c6629b9aSVasily Khoruzhick pinctrl-names = "default"; 62c6629b9aSVasily Khoruzhick pinctrl-0 = <&gmac0_miim 63c6629b9aSVasily Khoruzhick &gmac0_tx_bus2 64c6629b9aSVasily Khoruzhick &gmac0_rx_bus2 65c6629b9aSVasily Khoruzhick &gmac0_rgmii_clk 66c6629b9aSVasily Khoruzhick &gmac0_rgmii_bus>; 67c6629b9aSVasily Khoruzhick snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>; 68c6629b9aSVasily Khoruzhick snps,reset-active-low; 69c6629b9aSVasily Khoruzhick /* Reset time is 15ms, 50ms for rtl8211f */ 70c6629b9aSVasily Khoruzhick snps,reset-delays-us = <0 15000 50000>; 71c6629b9aSVasily Khoruzhick tx_delay = <0x3c>; 72c6629b9aSVasily Khoruzhick rx_delay = <0x2f>; 73c6629b9aSVasily Khoruzhick status = "okay"; 74c6629b9aSVasily Khoruzhick}; 75c6629b9aSVasily Khoruzhick 76c6629b9aSVasily Khoruzhick&mdio0 { 77c6629b9aSVasily Khoruzhick rgmii_phy0: ethernet-phy@1 { 78c6629b9aSVasily Khoruzhick compatible = "ethernet-phy-ieee802.3-c22"; 79c6629b9aSVasily Khoruzhick reg = <1>; 80c6629b9aSVasily Khoruzhick pinctrl-0 = <ð_phy0_reset_pin>; 81c6629b9aSVasily Khoruzhick pinctrl-names = "default"; 82c6629b9aSVasily Khoruzhick }; 83c6629b9aSVasily Khoruzhick}; 84c6629b9aSVasily Khoruzhick 85c6629b9aSVasily Khoruzhick&pcie2x1 { 86c6629b9aSVasily Khoruzhick num-lanes = <1>; 87c6629b9aSVasily Khoruzhick reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; 88c6629b9aSVasily Khoruzhick status = "okay"; 89c6629b9aSVasily Khoruzhick}; 90c6629b9aSVasily Khoruzhick 91c6629b9aSVasily Khoruzhick&pcie30phy { 92c6629b9aSVasily Khoruzhick data-lanes = <1 2>; 93c6629b9aSVasily Khoruzhick status = "okay"; 94c6629b9aSVasily Khoruzhick}; 95c6629b9aSVasily Khoruzhick 96c6629b9aSVasily Khoruzhick&pcie3x1 { 97c6629b9aSVasily Khoruzhick num-lanes = <1>; 98c6629b9aSVasily Khoruzhick reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; 99c6629b9aSVasily Khoruzhick vpcie3v3-supply = <&vcc3v3_pcie>; 100c6629b9aSVasily Khoruzhick status = "okay"; 101c6629b9aSVasily Khoruzhick}; 102c6629b9aSVasily Khoruzhick 103c6629b9aSVasily Khoruzhick&pcie3x2 { 104c6629b9aSVasily Khoruzhick num-lanes = <1>; 105c6629b9aSVasily Khoruzhick num-ib-windows = <8>; 106c6629b9aSVasily Khoruzhick num-ob-windows = <8>; 107c6629b9aSVasily Khoruzhick reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; 108c6629b9aSVasily Khoruzhick vpcie3v3-supply = <&vcc3v3_pcie>; 109c6629b9aSVasily Khoruzhick status = "okay"; 110c6629b9aSVasily Khoruzhick}; 111c6629b9aSVasily Khoruzhick 112c6629b9aSVasily Khoruzhick&pinctrl { 113c6629b9aSVasily Khoruzhick gmac0 { 114c6629b9aSVasily Khoruzhick eth_phy0_reset_pin: eth-phy0-reset-pin { 115*31425b1fSTianling Shen rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>; 116c6629b9aSVasily Khoruzhick }; 117c6629b9aSVasily Khoruzhick }; 118c6629b9aSVasily Khoruzhick 119c6629b9aSVasily Khoruzhick gpio-leds { 120c6629b9aSVasily Khoruzhick lan1_led_pin: lan1-led-pin { 121c6629b9aSVasily Khoruzhick rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; 122c6629b9aSVasily Khoruzhick }; 123c6629b9aSVasily Khoruzhick 124c6629b9aSVasily Khoruzhick lan2_led_pin: lan2-led-pin { 125c6629b9aSVasily Khoruzhick rockchip,pins = <3 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>; 126c6629b9aSVasily Khoruzhick }; 127c6629b9aSVasily Khoruzhick 128c6629b9aSVasily Khoruzhick power_led_pin: power-led-pin { 129c6629b9aSVasily Khoruzhick rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 130c6629b9aSVasily Khoruzhick }; 131c6629b9aSVasily Khoruzhick 132c6629b9aSVasily Khoruzhick wan_led_pin: wan-led-pin { 133c6629b9aSVasily Khoruzhick rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; 134c6629b9aSVasily Khoruzhick }; 135c6629b9aSVasily Khoruzhick }; 136c6629b9aSVasily Khoruzhick}; 137