xref: /freebsd/sys/contrib/device-tree/src/arm/marvell/kirkwood-nsa310s.dts (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * ZyXEL NSA310S Board Description
4 * Copyright 2020-2022 Pawel Dembicki <paweldembicki@gmail.com>
5 * Copyright (c) 2015-2021, Tony Dinh <mibodhi@gmail.com>
6 * Copyright (c) 2014, Adam Baker <linux@baker-net.org.uk>
7 * Based upon the board setup file created by Peter Schildmann
8 */
9/dts-v1/;
10
11#include "kirkwood.dtsi"
12#include "kirkwood-6281.dtsi"
13#include <dt-bindings/leds/common.h>
14
15/ {
16	model = "ZyXEL NSA310S";
17	compatible = "zyxel,nsa310s", "marvell,kirkwood-88f6702", "marvell,kirkwood";
18
19	memory {
20		device_type = "memory";
21		reg = <0x00000000 0x10000000>;
22	};
23
24	chosen {
25		bootargs = "console=ttyS0,115200n8 earlyprintk";
26		stdout-path = &uart0;
27	};
28
29	gpio_poweroff {
30		compatible = "gpio-poweroff";
31		pinctrl-0 = <&pmx_pwr_off>;
32		pinctrl-names = "default";
33		gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
34	};
35
36	keys {
37		compatible = "gpio-keys";
38		#address-cells = <1>;
39		#size-cells = <0>;
40		pinctrl-0 = <&pmx_buttons>;
41		pinctrl-names = "default";
42
43		power {
44			label = "Power Button";
45			linux,code = <KEY_POWER>;
46			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
47		};
48
49		copy {
50			label = "Copy Button";
51			linux,code = <KEY_COPY>;
52			gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
53		};
54
55		reset {
56			label = "Reset Button";
57			linux,code = <KEY_RESTART>;
58			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
59		};
60	};
61
62	leds {
63		compatible = "gpio-leds";
64		pinctrl-0 = <&pmx_leds>;
65		pinctrl-names = "default";
66
67		led-1 {
68			function = LED_FUNCTION_DISK_ERR;
69			color = <LED_COLOR_ID_RED>;
70			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
71		};
72
73		led-2 {
74			function = LED_FUNCTION_USB;
75			color = <LED_COLOR_ID_GREEN>;
76			gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
77			linux,default-trigger = "usb-host";
78		};
79
80		led-3 {
81			function = LED_FUNCTION_DISK;
82			color = <LED_COLOR_ID_GREEN>;
83			gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
84			linux,default-trigger = "ata1";
85		};
86
87		led-4 {
88			function = LED_FUNCTION_INDICATOR;
89			color = <LED_COLOR_ID_GREEN>;
90			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
91		};
92
93		led-5 {
94			function = LED_FUNCTION_INDICATOR;
95			color = <LED_COLOR_ID_RED>;
96			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
97		};
98
99		led-6 {
100			function = LED_FUNCTION_STATUS;
101			color = <LED_COLOR_ID_GREEN>;
102			gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
103			linux,default-trigger = "default-on";
104		};
105
106		led-7 {
107			function = LED_FUNCTION_STATUS;
108			color = <LED_COLOR_ID_RED>;
109			gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
110		};
111	};
112
113	usb0_power: regulator@1 {
114		compatible = "regulator-fixed";
115		regulator-name = "USB Power";
116
117		regulator-min-microvolt = <5000000>;
118		regulator-max-microvolt = <5000000>;
119		regulator-always-on;
120		regulator-boot-on;
121		gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
122	};
123
124	sata1_power: regulator@2 {
125		compatible = "regulator-fixed";
126		regulator-name = "SATA1 Power";
127
128		regulator-min-microvolt = <5000000>;
129		regulator-max-microvolt = <5000000>;
130		regulator-always-on;
131		regulator-boot-on;
132		gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
133	};
134
135	thermal-zones {
136		disk-thermal {
137			polling-delay = <20000>;
138			polling-delay-passive = <2000>;
139
140			thermal-sensors = <&hdd_temp>;
141
142			trips {
143				disk_alert: disk-alert {
144					temperature = <40000>;
145					hysteresis = <5000>;
146					type = "active";
147				};
148				disk_crit: disk-crit {
149					temperature = <60000>;
150					hysteresis = <2000>;
151					type = "critical";
152				};
153			};
154		};
155	};
156};
157
158
159&eth0 {
160	status = "okay";
161
162	ethernet0-port@0 {
163		phy-handle = <&ethphy0>;
164	};
165};
166
167&i2c0 {
168	status = "okay";
169
170	rtc@68 {
171		compatible = "htk,ht1382";
172		reg = <0x68>;
173	};
174};
175
176&mdio {
177	status = "okay";
178
179	ethphy0: ethernet-phy@1 {
180		reg = <1>;
181		phy-mode = "rgmii-id";
182		marvell,reg-init = <0x1 0x16 0x0 0x3>,
183				   <0x1 0x10 0x0 0x1017>,
184				   <0x1 0x11 0x0 0x4408>,
185				   <0x1 0x16 0x0 0x0>;
186	};
187};
188
189&nand {
190	status = "okay";
191	chip-delay = <35>;
192
193	partition@0 {
194		label = "uboot";
195		reg = <0x0000000 0x00c0000>;
196		read-only;
197	};
198	partition@c0000 {
199		label = "uboot_env";
200		reg = <0x00c0000 0x0080000>;
201	};
202	partition@140000 {
203		label = "ubi";
204		reg = <0x0140000 0x7ec0000>;
205	};
206};
207
208&pciec {
209	status = "okay";
210};
211
212&pcie0 {
213	status = "okay";
214};
215
216&pinctrl {
217	pinctrl-names = "default";
218
219	pmx_buttons: pmx-buttons {
220		marvell,pins = "mpp24", "mpp25", "mpp26";
221		marvell,function = "gpio";
222	};
223
224	pmx_leds: pmx-leds {
225		marvell,pins = "mpp13", "mpp15", "mpp16", "mpp22", "mpp23",
226						"mpp28", "mpp29";
227		marvell,function = "gpio";
228	};
229
230	pmx_power: pmx-power {
231		marvell,pins = "mpp21", "mpp33";
232		marvell,function = "gpio";
233	};
234
235	pmx_pwr_off: pmx-pwr-off {
236		marvell,pins = "mpp27";
237		marvell,function = "gpio";
238	};
239};
240
241&rtc {
242	status = "disabled";
243};
244
245&sata {
246	status = "okay";
247	nr-ports = <1>;
248	#address-cells = <1>;
249	#size-cells = <0>;
250
251	hdd_temp: sata-port@0 {
252		reg = <0>;
253		#thermal-sensor-cells = <0>;
254	};
255};
256
257&uart0 {
258	status = "okay";
259};
260