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