1 From 749cbb7b1a4bc2244b6af8cd7d8b471d4e33c80f Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Fri, 10 Jul 2020 15:57:46 +0200
4 Subject: [PATCH] rockchip: rk3328: Add support for FriendlyARM NanoPi R2S
6 This adds support for the NanoPi R2S from FriendlyARM.
10 Gigabit Ethernet (WAN)
11 Gigabit Ethernet (USB3) (LAN)
17 Signed-off-by: David Bauer <mail@david-bauer.net>
19 arch/arm64/boot/dts/rockchip/Makefile | 1 +
20 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts | 334 ++++++++++++++++++
21 2 files changed, 335 insertions(+)
22 create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
24 --- a/arch/arm64/boot/dts/rockchip/Makefile
25 +++ b/arch/arm64/boot/dts/rockchip/Makefile
27 # SPDX-License-Identifier: GPL-2.0
28 dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
29 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
30 +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb
31 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb
32 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb
33 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-evb-act8846.dtb
35 +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
37 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
39 + * Copyright (c) 2020 David Bauer <mail@david-bauer.net>
44 +#include <dt-bindings/input/input.h>
45 +#include <dt-bindings/gpio/gpio.h>
46 +#include "rk3328.dtsi"
49 + model = "FriendlyARM NanoPi R2S";
50 + compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
53 + stdout-path = "serial2:1500000n8";
56 + gmac_clkin: external-gmac-clock {
57 + compatible = "fixed-clock";
58 + clock-frequency = <125000000>;
59 + clock-output-names = "gmac_clkin";
63 + vcc_sd: sdmmc-regulator {
64 + compatible = "regulator-fixed";
65 + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
66 + pinctrl-names = "default";
67 + pinctrl-0 = <&sdmmc0m1_gpio>;
68 + regulator-name = "vcc_sd";
69 + regulator-min-microvolt = <3300000>;
70 + regulator-max-microvolt = <3300000>;
71 + vin-supply = <&vcc_io>;
74 + vcc_sdio: sdmmcio-regulator {
75 + compatible = "regulator-gpio";
76 + gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
78 + states = <1800000 0x1
80 + pinctrl-names = "default";
81 + pinctrl-0 = <&sdio_vcc_pin>;
82 + regulator-always-on;
83 + regulator-min-microvolt = <1800000>;
84 + regulator-max-microvolt = <3300000>;
85 + regulator-name = "vcc_sdio";
86 + regulator-settling-time-us = <5000>;
87 + regulator-type = "voltage";
88 + vin-supply = <&vcc_io>;
92 + compatible = "regulator-fixed";
93 + regulator-name = "vcc_sys";
94 + regulator-always-on;
96 + regulator-min-microvolt = <5000000>;
97 + regulator-max-microvolt = <5000000>;
101 + compatible = "gpio-leds";
103 + pinctrl-names = "default";
104 + pinctrl-0 = <&led_pins>;
107 + gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
108 + label = "nanopi-r2s:red:sys";
112 + gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
113 + label = "nanopi-r2s:green:lan";
117 + gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
118 + label = "nanopi-r2s:green:wan";
123 + compatible = "gpio-keys-polled";
124 + poll-interval = <100>;
126 + pinctrl-names = "default";
127 + pinctrl-0 = <&button_pins>;
130 + label = "Reset Button";
131 + gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
132 + linux,code = <KEY_RESTART>;
133 + debounce-interval = <50>;
139 + cpu-supply = <&vdd_arm>;
143 + cpu-supply = <&vdd_arm>;
147 + cpu-supply = <&vdd_arm>;
151 + cpu-supply = <&vdd_arm>;
155 + assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
156 + assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
157 + clock_in_out = "input";
158 + phy-supply = <&vcc_io>;
159 + phy-handle = <&rtl8211e>;
160 + phy-mode = "rgmii";
161 + pinctrl-names = "default";
162 + pinctrl-0 = <&rgmiim1_pins>;
164 + snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
165 + snps,reset-active-low;
166 + snps,reset-delays-us = <0 10000 50000>;
172 + compatible = "snps,dwmac-mdio";
173 + #address-cells = <1>;
176 + rtl8211e: ethernet-phy@0 {
186 + compatible = "rockchip,rk805";
188 + interrupt-parent = <&gpio2>;
189 + interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
190 + #clock-cells = <1>;
191 + clock-output-names = "xin32k", "rk805-clkout2";
194 + pinctrl-names = "default";
195 + pinctrl-0 = <&pmic_int_l>;
196 + rockchip,system-power-controller;
199 + vcc1-supply = <&vcc_sys>;
200 + vcc2-supply = <&vcc_sys>;
201 + vcc3-supply = <&vcc_sys>;
202 + vcc4-supply = <&vcc_sys>;
203 + vcc5-supply = <&vcc_io>;
204 + vcc6-supply = <&vcc_sys>;
207 + vdd_logic: DCDC_REG1 {
208 + regulator-name = "vdd_logic";
209 + regulator-min-microvolt = <712500>;
210 + regulator-max-microvolt = <1450000>;
211 + regulator-ramp-delay = <12500>;
212 + regulator-always-on;
214 + regulator-state-mem {
215 + regulator-on-in-suspend;
216 + regulator-suspend-microvolt = <1000000>;
220 + vdd_arm: DCDC_REG2 {
221 + regulator-name = "vdd_arm";
222 + regulator-min-microvolt = <712500>;
223 + regulator-max-microvolt = <1450000>;
224 + regulator-ramp-delay = <12500>;
225 + regulator-always-on;
227 + regulator-state-mem {
228 + regulator-on-in-suspend;
229 + regulator-suspend-microvolt = <950000>;
233 + vcc_ddr: DCDC_REG3 {
234 + regulator-name = "vcc_ddr";
235 + regulator-always-on;
237 + regulator-state-mem {
238 + regulator-on-in-suspend;
242 + vcc_io: DCDC_REG4 {
243 + regulator-name = "vcc_io";
244 + regulator-min-microvolt = <3300000>;
245 + regulator-max-microvolt = <3300000>;
246 + regulator-always-on;
248 + regulator-state-mem {
249 + regulator-on-in-suspend;
250 + regulator-suspend-microvolt = <3300000>;
255 + regulator-name = "vcc_18";
256 + regulator-min-microvolt = <1800000>;
257 + regulator-max-microvolt = <1800000>;
258 + regulator-always-on;
260 + regulator-state-mem {
261 + regulator-on-in-suspend;
262 + regulator-suspend-microvolt = <1800000>;
266 + vcc18_emmc: LDO_REG2 {
267 + regulator-name = "vcc18_emmc";
268 + regulator-min-microvolt = <1800000>;
269 + regulator-max-microvolt = <1800000>;
270 + regulator-always-on;
272 + regulator-state-mem {
273 + regulator-on-in-suspend;
274 + regulator-suspend-microvolt = <1800000>;
279 + regulator-name = "vdd_10";
280 + regulator-min-microvolt = <1000000>;
281 + regulator-max-microvolt = <1000000>;
282 + regulator-always-on;
284 + regulator-state-mem {
285 + regulator-on-in-suspend;
286 + regulator-suspend-microvolt = <1000000>;
296 + vccio1-supply = <&vcc_io>;
297 + vccio2-supply = <&vcc18_emmc>;
298 + vccio3-supply = <&vcc_sdio>;
299 + vccio4-supply = <&vcc_18>;
300 + vccio5-supply = <&vcc_io>;
301 + vccio6-supply = <&vcc_io>;
302 + pmuio-supply = <&vcc_io>;
307 + led_pins: led-pins {
308 + rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>,
309 + <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>,
310 + <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
315 + button_pins: button-pins {
316 + rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
321 + pmic_int_l: pmic-int-l {
322 + rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
327 + sdio_vcc_pin: sdio-vcc-pin {
328 + rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
338 + max-frequency = <150000000>;
339 + pinctrl-names = "default";
340 + pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
341 + vmmc-supply = <&vcc_sd>;
342 + vqmmc-supply = <&vcc_sdio>;
347 + rockchip,hw-tshut-mode = <0>;
348 + rockchip,hw-tshut-polarity = <0>;
359 + u2phy_host: host-port {