Loading...
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree file for D-Link DNS-313 1-Bay Network Storage Enclosure
4 */
5
6/dts-v1/;
7
8#include "gemini.dtsi"
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/thermal/thermal.h>
11
12/ {
13 model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
14 compatible = "dlink,dns-313", "cortina,gemini";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 memory@0 {
19 /* 64 MB SDRAM in a Nanya NT5DS32M16BS-6K package */
20 device_type = "memory";
21 reg = <0x00000000 0x4000000>;
22 };
23
24 aliases {
25 mdio-gpio0 = &mdio0;
26 };
27
28 chosen {
29 bootargs = "console=ttyS0,19200n8 root=/dev/sda4 rw rootwait";
30 stdout-path = "uart0:19200n8";
31 };
32
33 gpio_keys {
34 compatible = "gpio-keys";
35
36 button-esc {
37 debounce-interval = <100>;
38 wakeup-source;
39 linux,code = <KEY_ESC>;
40 label = "reset";
41 gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47 led-power {
48 label = "dns313:blue:power";
49 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
50 default-state = "on";
51 linux,default-trigger = "heartbeat";
52 };
53 led-disk-blue {
54 label = "dns313:blue:disk";
55 gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
56 default-state = "off";
57 };
58 led-disk-green {
59 label = "dns313:green:disk";
60 gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
61 default-state = "off";
62 linux,default-trigger = "disk-read";
63 };
64 led-disk-red {
65 label = "dns313:red:disk";
66 gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
67 default-state = "off";
68 linux,default-trigger = "disk-write";
69 };
70 };
71
72 /*
73 * This is a ADDA AD0405GB-G73 fan @3000 and 6000 RPM.
74 */
75 fan0: gpio-fan {
76 compatible = "gpio-fan";
77 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
78 <&gpio0 12 GPIO_ACTIVE_HIGH>;
79 gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
80 #cooling-cells = <2>;
81 };
82
83
84 /* Global Mixed-Mode Technology G751 mounted on GPIO I2C */
85 gpio-i2c {
86 compatible = "i2c-gpio";
87 sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
88 scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
89 #address-cells = <1>;
90 #size-cells = <0>;
91
92 g751: temperature-sensor@48 {
93 compatible = "gmt,g751";
94 reg = <0x48>;
95 #thermal-sensor-cells = <0>;
96 };
97 };
98
99 thermal-zones {
100 chassis-thermal {
101 /* Poll every 20 seconds */
102 polling-delay = <20000>;
103 /* Poll every 2nd second when cooling */
104 polling-delay-passive = <2000>;
105
106 thermal-sensors = <&g751>;
107
108 /* Tripping points from the fan.script in the rootfs */
109 trips {
110 chassis_alert0: chassis-alert0 {
111 /* At 43 degrees turn on low speed */
112 temperature = <43000>;
113 hysteresis = <3000>;
114 type = "active";
115 };
116 chassis_alert1: chassis-alert1 {
117 /* At 47 degrees turn on high speed */
118 temperature = <47000>;
119 hysteresis = <3000>;
120 type = "active";
121 };
122 chassis_crit: chassis-crit {
123 /* Just shut down at 60 degrees */
124 temperature = <60000>;
125 hysteresis = <2000>;
126 type = "critical";
127 };
128 };
129
130 cooling-maps {
131 map0 {
132 trip = <&chassis_alert0>;
133 cooling-device = <&fan0 1 1>;
134 };
135 map1 {
136 trip = <&chassis_alert1>;
137 cooling-device = <&fan0 2 2>;
138 };
139 };
140 };
141 };
142
143 mdio0: ethernet-phy {
144 compatible = "virtual,mdio-gpio";
145 /* Uses MDC and MDIO */
146 gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
147 <&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
148 #address-cells = <1>;
149 #size-cells = <0>;
150
151 /* This is a Realtek RTL8211B Gigabit ethernet transceiver */
152 phy0: ethernet-phy@1 {
153 reg = <1>;
154 device_type = "ethernet-phy";
155 };
156 };
157
158 soc {
159 flash@30000000 {
160 /*
161 * This is a Eon EN29LV400AB 512 KiB flash with
162 * three partitions.
163 */
164 compatible = "cortina,gemini-flash", "jedec-flash";
165 status = "okay";
166 reg = <0x30000000 0x00080000>;
167
168 /*
169 * This "RedBoot" is the Storlink derivative.
170 */
171 partition@0 {
172 label = "RedBoot";
173 reg = <0x00000000 0x00040000>;
174 read-only;
175 };
176 partition@40000 {
177 label = "MTD1";
178 reg = <0x00040000 0x00020000>;
179 read-only;
180 };
181 partition@60000 {
182 label = "MTD2";
183 reg = <0x00060000 0x00020000>;
184 read-only;
185 };
186 };
187
188 syscon: syscon@40000000 {
189 pinctrl {
190 /*
191 */
192 gpio0_default_pins: pinctrl-gpio0 {
193 mux {
194 function = "gpio0";
195 groups =
196 /* Used by LEDs conflicts ICE */
197 "gpio0bgrp",
198 /* Used by ? conflicts ICE */
199 "gpio0cgrp",
200 /*
201 * Used by fan & G751, conflicts LPC,
202 * UART modem lines, SSP
203 */
204 "gpio0egrp",
205 /* Used by G751 */
206 "gpio0fgrp",
207 /* Used by MDIO */
208 "gpio0igrp";
209 };
210 };
211 gpio1_default_pins: pinctrl-gpio1 {
212 mux {
213 function = "gpio1";
214 /* Used by "reset" button */
215 groups = "gpio1dgrp";
216 };
217 };
218 pinctrl-gmii {
219 mux {
220 function = "gmii";
221 groups = "gmii_gmac0_grp";
222 };
223 /*
224 * In the vendor Linux tree, these values are set for the C3
225 * version of the SL3512 ASIC with the comment "benson suggest"
226 */
227 conf0 {
228 pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV";
229 skew-delay = <0>;
230 };
231 conf1 {
232 pins = "T8 GMAC0 RXC";
233 skew-delay = <10>;
234 };
235 conf2 {
236 pins = "T11 GMAC1 RXC";
237 skew-delay = <15>;
238 };
239 conf3 {
240 pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN";
241 skew-delay = <7>;
242 };
243 conf4 {
244 pins = "V7 GMAC0 TXC", "P10 GMAC1 TXC";
245 skew-delay = <10>;
246 };
247 conf5 {
248 /* The data lines all have default skew */
249 pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
250 "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
251 "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
252 "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
253 "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
254 "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
255 skew-delay = <7>;
256 };
257 conf6 {
258 pins = "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
259 "R7 GMAC0 TXD2", "P7 GMAC0 TXD3";
260 skew-delay = <5>;
261 };
262 /* Set up drive strength on GMAC0 to 16 mA */
263 conf7 {
264 groups = "gmii_gmac0_grp";
265 drive-strength = <16>;
266 };
267 };
268 };
269 };
270
271 sata: sata@46000000 {
272 /* The ROM uses this muxmode */
273 cortina,gemini-ata-muxmode = <0>;
274 cortina,gemini-enable-sata-bridge;
275 status = "okay";
276 };
277
278 gpio0: gpio@4d000000 {
279 pinctrl-names = "default";
280 pinctrl-0 = <&gpio0_default_pins>;
281 };
282
283 gpio1: gpio@4e000000 {
284 pinctrl-names = "default";
285 pinctrl-0 = <&gpio1_default_pins>;
286 };
287
288 ethernet@60000000 {
289 status = "okay";
290
291 ethernet-port@0 {
292 phy-mode = "rgmii";
293 phy-handle = <&phy0>;
294 };
295 ethernet-port@1 {
296 /* Not used in this platform */
297 };
298 };
299
300 ata@63000000 {
301 status = "okay";
302 };
303 };
304};
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree file for D-Link DNS-313 1-Bay Network Storage Enclosure
4 */
5
6/dts-v1/;
7
8#include "gemini.dtsi"
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/thermal/thermal.h>
11
12/ {
13 model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
14 compatible = "dlink,dir-313", "cortina,gemini";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 memory {
19 /* 64 MB SDRAM in a Nanya NT5DS32M16BS-6K package */
20 device_type = "memory";
21 reg = <0x00000000 0x4000000>;
22 };
23
24 aliases {
25 mdio-gpio0 = &mdio0;
26 };
27
28 chosen {
29 stdout-path = "uart0:19200n8";
30 };
31
32 gpio_keys {
33 compatible = "gpio-keys";
34 #address-cells = <1>;
35 #size-cells = <0>;
36 button-esc {
37 debounce_interval = <50>;
38 wakeup-source;
39 linux,code = <KEY_ESC>;
40 label = "reset";
41 gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47 led-power {
48 label = "dns313:blue:power";
49 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
50 default-state = "on";
51 linux,default-trigger = "heartbeat";
52 };
53 led-disk-blue {
54 label = "dns313:blue:disk";
55 gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
56 default-state = "off";
57 };
58 led-disk-green {
59 label = "dns313:green:disk";
60 gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
61 default-state = "off";
62 linux,default-trigger = "ide-disk";
63 /* Ideally should activate while reading */
64 };
65 led-disk-red {
66 label = "dns313:red:disk";
67 gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
68 default-state = "off";
69 /* Ideally should activate while writing */
70 };
71 };
72
73 /*
74 * This is a ADDA AD0405GB-G73 fan @3000 and 6000 RPM.
75 */
76 fan0: gpio-fan {
77 compatible = "gpio-fan";
78 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
79 <&gpio0 12 GPIO_ACTIVE_HIGH>;
80 gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
81 #cooling-cells = <2>;
82 };
83
84
85 /* Global Mixed-Mode Technology G751 mounted on GPIO I2C */
86 gpio-i2c {
87 compatible = "i2c-gpio";
88 sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
89 scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
90 #address-cells = <1>;
91 #size-cells = <0>;
92
93 g751: temperature-sensor@48 {
94 compatible = "gmt,g751";
95 reg = <0x48>;
96 #thermal-sensor-cells = <0>;
97 };
98 };
99
100 thermal-zones {
101 chassis-thermal {
102 /* Poll every 20 seconds */
103 polling-delay = <20000>;
104 /* Poll every 2nd second when cooling */
105 polling-delay-passive = <2000>;
106
107 thermal-sensors = <&g751>;
108
109 /* Tripping points from the fan.script in the rootfs */
110 trips {
111 chassis_alert0: chassis-alert0 {
112 /* At 43 degrees turn on low speed */
113 temperature = <43000>;
114 hysteresis = <3000>;
115 type = "active";
116 };
117 chassis_alert1: chassis-alert1 {
118 /* At 47 degrees turn on high speed */
119 temperature = <47000>;
120 hysteresis = <3000>;
121 type = "active";
122 };
123 chassis_crit: chassis-crit {
124 /* Just shut down at 60 degrees */
125 temperature = <60000>;
126 hysteresis = <2000>;
127 type = "critical";
128 };
129 };
130
131 cooling-maps {
132 map0 {
133 trip = <&chassis_alert0>;
134 cooling-device = <&fan0 1 1>;
135 };
136 map1 {
137 trip = <&chassis_alert1>;
138 cooling-device = <&fan0 2 2>;
139 };
140 };
141 };
142 };
143
144 mdio0: ethernet-phy {
145 compatible = "virtual,mdio-gpio";
146 /* Uses MDC and MDIO */
147 gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
148 <&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
149 #address-cells = <1>;
150 #size-cells = <0>;
151
152 /* This is a Realtek RTL8211B Gigabit ethernet transceiver */
153 phy0: ethernet-phy@1 {
154 reg = <1>;
155 device_type = "ethernet-phy";
156 };
157 };
158
159 soc {
160 flash@30000000 {
161 status = "okay";
162 /* 512KB of flash */
163 reg = <0x30000000 0x00080000>;
164
165 /*
166 * This "RedBoot" is the Storlink derivative.
167 */
168 partition@0 {
169 label = "RedBoot";
170 reg = <0x00000000 0x00040000>;
171 read-only;
172 };
173 partition@40000 {
174 label = "MTD1";
175 reg = <0x00040000 0x00020000>;
176 read-only;
177 };
178 partition@60000 {
179 label = "MTD2";
180 reg = <0x00060000 0x00020000>;
181 read-only;
182 };
183 };
184
185 syscon: syscon@40000000 {
186 pinctrl {
187 /*
188 */
189 gpio0_default_pins: pinctrl-gpio0 {
190 mux {
191 function = "gpio0";
192 groups =
193 /* Used by LEDs conflicts ICE */
194 "gpio0bgrp",
195 /* Used by ? conflicts ICE */
196 "gpio0cgrp",
197 /*
198 * Used by fan & G751, conflicts LPC,
199 * UART modem lines, SSP
200 */
201 "gpio0egrp",
202 /* Used by G751 */
203 "gpio0fgrp",
204 /* Used by MDIO */
205 "gpio0igrp";
206 };
207 };
208 gpio1_default_pins: pinctrl-gpio1 {
209 mux {
210 function = "gpio1";
211 /* Used by "reset" button */
212 groups = "gpio1dgrp";
213 };
214 };
215 pinctrl-gmii {
216 mux {
217 function = "gmii";
218 groups = "gmii_gmac0_grp";
219 };
220 /*
221 * In the vendor Linux tree, these values are set for the C3
222 * version of the SL3512 ASIC with the comment "benson suggest"
223 */
224 conf0 {
225 pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV";
226 skew-delay = <0>;
227 };
228 conf1 {
229 pins = "T8 GMAC0 RXC";
230 skew-delay = <10>;
231 };
232 conf2 {
233 pins = "T11 GMAC1 RXC";
234 skew-delay = <15>;
235 };
236 conf3 {
237 pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN";
238 skew-delay = <7>;
239 };
240 conf4 {
241 pins = "V7 GMAC0 TXC", "P10 GMAC1 TXC";
242 skew-delay = <10>;
243 };
244 conf5 {
245 /* The data lines all have default skew */
246 pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
247 "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
248 "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
249 "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
250 "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
251 "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
252 skew-delay = <7>;
253 };
254 conf6 {
255 pins = "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
256 "R7 GMAC0 TXD2", "P7 GMAC0 TXD3";
257 skew-delay = <5>;
258 };
259 /* Set up drive strength on GMAC0 to 16 mA */
260 conf7 {
261 groups = "gmii_gmac0_grp";
262 drive-strength = <16>;
263 };
264 };
265 };
266 };
267
268 sata: sata@46000000 {
269 /* The ROM uses this muxmode */
270 cortina,gemini-ata-muxmode = <0>;
271 cortina,gemini-enable-sata-bridge;
272 status = "okay";
273 };
274
275 gpio0: gpio@4d000000 {
276 pinctrl-names = "default";
277 pinctrl-0 = <&gpio0_default_pins>;
278 };
279
280 gpio1: gpio@4e000000 {
281 pinctrl-names = "default";
282 pinctrl-0 = <&gpio1_default_pins>;
283 };
284
285 ethernet@60000000 {
286 status = "okay";
287
288 ethernet-port@0 {
289 phy-mode = "rgmii";
290 phy-handle = <&phy0>;
291 };
292 ethernet-port@1 {
293 /* Not used in this platform */
294 };
295 };
296
297 ata@63000000 {
298 status = "okay";
299 };
300 };
301};