c508d713171a16e986d37d512a7597a2461699de
[openwrt/staging/mans0n.git] /
1 From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001
2 From: Tianling Shen <cnsztl@gmail.com>
3 Date: Fri, 19 Mar 2021 13:16:27 +0800
4 Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S
5
6 This adds support for the NanoPi R4S from FriendlyArm.
7
8 Rockchip RK3399 SoC
9 1GB DDR3 or 4GB LPDDR4 RAM
10 Gigabit Ethernet (WAN)
11 Gigabit Ethernet (PCIe) (LAN)
12 USB 3.0 Port x 2
13 MicroSD slot
14 Reset button
15 WAN - LAN - SYS LED
16
17 Co-developed-by: Jensen Huang <jensenhuang@friendlyarm.com>
18 Signed-off-by: Jensen Huang <jensenhuang@friendlyarm.com>
19 [minor adjustments]
20 Co-developed-by: Marty Jones <mj8263788@gmail.com>
21 Signed-off-by: Marty Jones <mj8263788@gmail.com>
22 [further adjustments, fixed format issues]
23 Signed-off-by: Tianling Shen <cnsztl@gmail.com>
24 Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl@gmail.com
25 Signed-off-by: Heiko Stuebner <heiko@sntech.de>
26 ---
27 arch/arm64/boot/dts/rockchip/Makefile | 1 +
28 .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 133 +++++++++++++++++++++
29 2 files changed, 134 insertions(+)
30 create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
31
32 --- a/arch/arm64/boot/dts/rockchip/Makefile
33 +++ b/arch/arm64/boot/dts/rockchip/Makefile
34 @@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le
35 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
36 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
37 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
38 +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb
39 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
40 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
41 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
42 --- /dev/null
43 +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
44 @@ -0,0 +1,133 @@
45 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
46 +/*
47 + * FriendlyElec NanoPC-T4 board device tree source
48 + *
49 + * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd.
50 + * (http://www.friendlyarm.com)
51 + *
52 + * Copyright (c) 2018 Collabora Ltd.
53 + *
54 + * Copyright (c) 2020 Jensen Huang <jensenhuang@friendlyarm.com>
55 + * Copyright (c) 2020 Marty Jones <mj8263788@gmail.com>
56 + * Copyright (c) 2021 Tianling Shen <cnsztl@gmail.com>
57 + */
58 +
59 +/dts-v1/;
60 +#include "rk3399-nanopi4.dtsi"
61 +
62 +/ {
63 + model = "FriendlyElec NanoPi R4S";
64 + compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
65 +
66 + /delete-node/ display-subsystem;
67 +
68 + gpio-leds {
69 + pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
70 +
71 + /delete-node/ status;
72 +
73 + lan_led: led-lan {
74 + gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
75 + label = "green:lan";
76 + };
77 +
78 + sys_led: led-sys {
79 + gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
80 + label = "red:sys";
81 + default-state = "on";
82 + };
83 +
84 + wan_led: led-wan {
85 + gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
86 + label = "green:wan";
87 + };
88 + };
89 +
90 + gpio-keys {
91 + pinctrl-0 = <&reset_button_pin>;
92 +
93 + /delete-node/ power;
94 +
95 + reset {
96 + debounce-interval = <50>;
97 + gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
98 + label = "reset";
99 + linux,code = <KEY_RESTART>;
100 + };
101 + };
102 +
103 + vdd_5v: vdd-5v {
104 + compatible = "regulator-fixed";
105 + regulator-name = "vdd_5v";
106 + regulator-always-on;
107 + regulator-boot-on;
108 + };
109 +};
110 +
111 +&emmc_phy {
112 + status = "disabled";
113 +};
114 +
115 +&i2c4 {
116 + status = "disabled";
117 +};
118 +
119 +&pcie0 {
120 + max-link-speed = <1>;
121 + num-lanes = <1>;
122 + vpcie3v3-supply = <&vcc3v3_sys>;
123 +};
124 +
125 +&pinctrl {
126 + gpio-leds {
127 + /delete-node/ leds-gpio;
128 +
129 + lan_led_pin: lan-led-pin {
130 + rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
131 + };
132 +
133 + sys_led_pin: sys-led-pin {
134 + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
135 + };
136 +
137 + wan_led_pin: wan-led-pin {
138 + rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
139 + };
140 + };
141 +
142 + rockchip-key {
143 + /delete-node/ power-key;
144 +
145 + reset_button_pin: reset-button-pin {
146 + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
147 + };
148 + };
149 +};
150 +
151 +&sdhci {
152 + status = "disabled";
153 +};
154 +
155 +&sdio0 {
156 + status = "disabled";
157 +};
158 +
159 +&u2phy0_host {
160 + phy-supply = <&vdd_5v>;
161 +};
162 +
163 +&u2phy1_host {
164 + status = "disabled";
165 +};
166 +
167 +&uart0 {
168 + status = "disabled";
169 +};
170 +
171 +&usbdrd_dwc3_0 {
172 + dr_mode = "host";
173 +};
174 +
175 +&vcc3v3_sys {
176 + vin-supply = <&vcc5v0_sys>;
177 +};