b745ea104fd5e5ac2e9f14ed525b454bc13cbc09
[openwrt/openwrt.git] / target / linux / kirkwood / patches-5.15 / 002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch
1 From e977a103840c57d72b52cbc8c17f87f86ef9aa8d Mon Sep 17 00:00:00 2001
2 From: Pawel Dembicki <paweldembicki@gmail.com>
3 Date: Sat, 29 Oct 2022 22:57:38 +0200
4 Subject: [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board
5
6 Zyxel NSA310S is a NAS based on Marvell kirkwood SoC.
7
8 Specification:
9 - Processor Marvell 88F6702 1 GHz
10 - 256MB RAM
11 - 128MB NAND
12 - 1x GBE LAN port (PHY: Marvell 88E1318)
13 - 2x USB 2.0
14 - 1x SATA
15 - 3x button
16 - 7x leds
17 - serial on J1 connector (115200 8N1) (GND-NOPIN-RX-TX-VCC)
18
19 Tested-by: Tony Dinh <mibodhi@gmail.com>
20 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
21 Acked-by: Adam Baker <linux@baker-net.org.uk>
22 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
23 Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
24 ---
25 arch/arm/boot/dts/Makefile | 1 +
26 arch/arm/boot/dts/kirkwood-nsa310s.dts | 259 +++++++++++++++++++++++++
27 2 files changed, 260 insertions(+)
28 create mode 100644 arch/arm/boot/dts/kirkwood-nsa310s.dts
29
30 --- a/arch/arm/boot/dts/Makefile
31 +++ b/arch/arm/boot/dts/Makefile
32 @@ -320,6 +320,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
33 kirkwood-ns2mini.dtb \
34 kirkwood-nsa310.dtb \
35 kirkwood-nsa310a.dtb \
36 + kirkwood-nsa310s.dtb \
37 kirkwood-nsa320.dtb \
38 kirkwood-nsa325.dtb \
39 kirkwood-openblocks_a6.dtb \
40 --- /dev/null
41 +++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts
42 @@ -0,0 +1,259 @@
43 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
44 +/*
45 + * ZyXEL NSA310S Board Description
46 + * Copyright 2020-2022 Pawel Dembicki <paweldembicki@gmail.com>
47 + * Copyright (c) 2015-2021, Tony Dinh <mibodhi@gmail.com>
48 + * Copyright (c) 2014, Adam Baker <linux@baker-net.org.uk>
49 + * Based upon the board setup file created by Peter Schildmann
50 + */
51 +/dts-v1/;
52 +
53 +#include "kirkwood.dtsi"
54 +#include "kirkwood-6281.dtsi"
55 +#include <dt-bindings/leds/common.h>
56 +
57 +/ {
58 + model = "ZyXEL NSA310S";
59 + compatible = "zyxel,nsa310s", "marvell,kirkwood-88f6702", "marvell,kirkwood";
60 +
61 + memory {
62 + device_type = "memory";
63 + reg = <0x00000000 0x10000000>;
64 + };
65 +
66 + chosen {
67 + bootargs = "console=ttyS0,115200n8 earlyprintk";
68 + stdout-path = &uart0;
69 + };
70 +
71 + gpio_poweroff {
72 + compatible = "gpio-poweroff";
73 + pinctrl-0 = <&pmx_pwr_off>;
74 + pinctrl-names = "default";
75 + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
76 + };
77 +
78 + keys {
79 + compatible = "gpio-keys";
80 + #address-cells = <1>;
81 + #size-cells = <0>;
82 + pinctrl-0 = <&pmx_buttons>;
83 + pinctrl-names = "default";
84 +
85 + power {
86 + label = "Power Button";
87 + linux,code = <KEY_POWER>;
88 + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
89 + };
90 +
91 + copy {
92 + label = "Copy Button";
93 + linux,code = <KEY_COPY>;
94 + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
95 + };
96 +
97 + reset {
98 + label = "Reset Button";
99 + linux,code = <KEY_RESTART>;
100 + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
101 + };
102 + };
103 +
104 + leds {
105 + compatible = "gpio-leds";
106 + pinctrl-0 = <&pmx_leds>;
107 + pinctrl-names = "default";
108 +
109 + led-1 {
110 + function = LED_FUNCTION_DISK_ERR;
111 + color = <LED_COLOR_ID_RED>;
112 + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
113 + };
114 +
115 + led-2 {
116 + function = LED_FUNCTION_USB;
117 + color = <LED_COLOR_ID_GREEN>;
118 + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
119 + linux,default-trigger = "usb-host";
120 + };
121 +
122 + led-3 {
123 + function = LED_FUNCTION_DISK;
124 + color = <LED_COLOR_ID_GREEN>;
125 + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
126 + linux,default-trigger = "ata1";
127 + };
128 +
129 + led-4 {
130 + function = LED_FUNCTION_INDICATOR;
131 + color = <LED_COLOR_ID_GREEN>;
132 + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
133 + };
134 +
135 + led-5 {
136 + function = LED_FUNCTION_INDICATOR;
137 + color = <LED_COLOR_ID_RED>;
138 + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
139 + };
140 +
141 + led-6 {
142 + function = LED_FUNCTION_STATUS;
143 + color = <LED_COLOR_ID_GREEN>;
144 + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
145 + linux,default-trigger = "default-on";
146 + };
147 +
148 + led-7 {
149 + function = LED_FUNCTION_STATUS;
150 + color = <LED_COLOR_ID_RED>;
151 + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
152 + };
153 + };
154 +
155 + usb0_power: regulator@1 {
156 + compatible = "regulator-fixed";
157 + regulator-name = "USB Power";
158 +
159 + regulator-min-microvolt = <5000000>;
160 + regulator-max-microvolt = <5000000>;
161 + regulator-always-on;
162 + regulator-boot-on;
163 + gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
164 + };
165 +
166 + sata1_power: regulator@2 {
167 + compatible = "regulator-fixed";
168 + regulator-name = "SATA1 Power";
169 +
170 + regulator-min-microvolt = <5000000>;
171 + regulator-max-microvolt = <5000000>;
172 + regulator-always-on;
173 + regulator-boot-on;
174 + gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
175 + };
176 +
177 + thermal-zones {
178 + disk-thermal {
179 + polling-delay = <20000>;
180 + polling-delay-passive = <2000>;
181 +
182 + thermal-sensors = <&hdd_temp>;
183 +
184 + trips {
185 + disk_alert: disk-alert {
186 + temperature = <40000>;
187 + hysteresis = <5000>;
188 + type = "active";
189 + };
190 + disk_crit: disk-crit {
191 + temperature = <60000>;
192 + hysteresis = <2000>;
193 + type = "critical";
194 + };
195 + };
196 + };
197 + };
198 +};
199 +
200 +
201 +&eth0 {
202 + status = "okay";
203 +
204 + ethernet0-port@0 {
205 + phy-handle = <&ethphy0>;
206 + };
207 +};
208 +
209 +&i2c0 {
210 + status = "okay";
211 +
212 + rtc@68 {
213 + compatible = "htk,ht1382";
214 + reg = <0x68>;
215 + };
216 +};
217 +
218 +&mdio {
219 + status = "okay";
220 +
221 + ethphy0: ethernet-phy@1 {
222 + reg = <1>;
223 + phy-mode = "rgmii-id";
224 + marvell,reg-init = <0x1 0x16 0x0 0x3>,
225 + <0x1 0x10 0x0 0x1017>,
226 + <0x1 0x11 0x0 0x4408>,
227 + <0x1 0x16 0x0 0x0>;
228 + };
229 +};
230 +
231 +&nand {
232 + status = "okay";
233 + chip-delay = <35>;
234 +
235 + partition@0 {
236 + label = "uboot";
237 + reg = <0x0000000 0x00c0000>;
238 + read-only;
239 + };
240 + partition@c0000 {
241 + label = "uboot_env";
242 + reg = <0x00c0000 0x0080000>;
243 + };
244 + partition@140000 {
245 + label = "ubi";
246 + reg = <0x0140000 0x7ec0000>;
247 + };
248 +};
249 +
250 +&pciec {
251 + status = "okay";
252 +};
253 +
254 +&pcie0 {
255 + status = "okay";
256 +};
257 +
258 +&pinctrl {
259 + pinctrl-names = "default";
260 +
261 + pmx_buttons: pmx-buttons {
262 + marvell,pins = "mpp24", "mpp25", "mpp26";
263 + marvell,function = "gpio";
264 + };
265 +
266 + pmx_leds: pmx-leds {
267 + marvell,pins = "mpp13", "mpp15", "mpp16", "mpp22", "mpp23",
268 + "mpp28", "mpp29";
269 + marvell,function = "gpio";
270 + };
271 +
272 + pmx_power: pmx-power {
273 + marvell,pins = "mpp21", "mpp33";
274 + marvell,function = "gpio";
275 + };
276 +
277 + pmx_pwr_off: pmx-pwr-off {
278 + marvell,pins = "mpp27";
279 + marvell,function = "gpio";
280 + };
281 +};
282 +
283 +&rtc {
284 + status = "disabled";
285 +};
286 +
287 +&sata {
288 + status = "okay";
289 + nr-ports = <1>;
290 + #address-cells = <1>;
291 + #size-cells = <0>;
292 +
293 + hdd_temp: sata-port@0 {
294 + reg = <0>;
295 + #thermal-sensor-cells = <0>;
296 + };
297 +};
298 +
299 +&uart0 {
300 + status = "okay";
301 +};