Linux Audio

Check our new training course

Embedded Linux training

Mar 10-20, 2025, special US time zones
Register
Loading...
v4.17
  1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2/*
  3 * Device Tree file for Synology DS213j
  4 *
  5 * Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org>
  6 *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  7 * Note: this Device Tree assumes that the bootloader has remapped the
  8 * internal registers to 0xf1000000 (instead of the old 0xd0000000).
  9 * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
 10 * bootloaders provided by Marvell. It is used in recent versions of
 11 * DSM software provided by Synology. Nonetheless, some earlier boards
 12 * were delivered with an older version of u-boot that left internal
 13 * registers mapped at 0xd0000000. If you have such a device you will
 14 * not be able to directly boot a kernel based on this Device Tree. In
 15 * that case, the preferred solution is to update your bootloader (e.g.
 16 * by upgrading to latest version of DSM, or building a new one and
 17 * installing it from u-boot prompt) or adjust the Devive Tree
 18 * (s/0xf1000000/0xd0000000/ in 'ranges' below).
 19 */
 20
 21/dts-v1/;
 22
 23#include <dt-bindings/input/input.h>
 24#include <dt-bindings/gpio/gpio.h>
 25#include "armada-370.dtsi"
 26
 27/ {
 28	model = "Synology DS213j";
 29	compatible = "synology,ds213j", "marvell,armada370",
 30		     "marvell,armada-370-xp";
 31
 32	chosen {
 33		stdout-path = "serial0:115200n8";
 34	};
 35
 36	memory@0 {
 37		device_type = "memory";
 38		reg = <0x00000000 0x20000000>; /* 512 MB */
 39	};
 40
 41	soc {
 42		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
 43			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
 44			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 45
 46		internal-regs {
 47
 48			/* RTC provided by Seiko S-35390A I2C RTC chip below */
 49			rtc@10300 {
 50				status = "disabled";
 51			};
 52
 53			i2c@11000 {
 54				compatible = "marvell,mv64xxx-i2c";
 55				pinctrl-0 = <&i2c0_pins>;
 56				pinctrl-names = "default";
 57				clock-frequency = <400000>;
 58				status = "okay";
 59
 60				/* Main device RTC chip */
 61				s35390a: s35390a@30 {
 62					 compatible = "sii,s35390a";
 63					 reg = <0x30>;
 64				};
 65			};
 66
 67			/* Connected to a header on device's PCB */
 68			serial@12000 {
 69				status = "okay";
 70			};
 71
 72			/* Connected to a TI MSP430F2111 for power control */
 73			serial@12100 {
 74				status = "okay";
 75			};
 76
 77			poweroff@12100 {
 78				compatible = "synology,power-off";
 79				reg = <0x12100 0x100>;
 80				clocks = <&coreclk 0>;
 81			};
 82
 83			/* rear USB port, near reset button */
 84			usb@50000 {
 85				status = "okay";
 86			};
 87
 88			/* rear USB port, near RJ45 port */
 89			usb@51000 {
 90				status = "okay";
 91			};
 92
 93			ethernet@70000 {
 94			       status = "okay";
 95			       phy = <&phy1>;
 96			       phy-mode = "sgmii";
 97			};
 98
 99			sata@a0000 {
100				nr-ports = <2>;
101				status = "okay";
102			};
103		};
104	};
105
106	gpio-fan-32-38 {
107		status = "okay";
108		compatible = "gpio-fan";
109		pinctrl-0 = <&fan_ctrl_low_pin &fan_ctrl_mid_pin
110			     &fan_ctrl_high_pin &fan_alarm_pin>;
111		pinctrl-names = "default";
112		gpios = <&gpio1 31 GPIO_ACTIVE_HIGH
113			 &gpio2  0 GPIO_ACTIVE_HIGH
114			 &gpio2  1 GPIO_ACTIVE_HIGH>;
115		alarm-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
116		gpio-fan,speed-map = <    0 0
117				       1000 1
118				       1150 2
119				       1350 4
120				       1500 3
121				       1650 5
122				       1750 6
123				       1900 7 >;
124	};
125
126	gpio-leds {
127		compatible = "gpio-leds";
128		pinctrl-0 = <&disk1_led_pin
129			     &disk2_led_pin>;
130		pinctrl-names = "default";
131
132		disk1-led-amber {
133			label = "synology:amber:disk1";
134			gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
135			default-state = "keep";
136		};
137
138		disk2-led-amber {
139			label = "synology:amber:disk2";
140			gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
141			default-state = "keep";
142		};
143	};
144
145	regulators {
146		compatible = "simple-bus";
147		#address-cells = <1>;
148		#size-cells = <0>;
149		pinctrl-0 = <&sata1_pwr_pin &sata2_pwr_pin>;
150		pinctrl-names = "default";
151
152		sata1_regulator: sata1-regulator@1 {
153			compatible = "regulator-fixed";
154			reg = <1>;
155			regulator-name = "SATA1 Power";
156			regulator-min-microvolt = <5000000>;
157			regulator-max-microvolt = <5000000>;
158			startup-delay-us = <2000000>;
159			enable-active-high;
160			regulator-always-on;
161			regulator-boot-on;
162			gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
163		};
164
165		sata2_regulator: sata2-regulator@2 {
166			compatible = "regulator-fixed";
167			reg = <2>;
168			regulator-name = "SATA2 Power";
169			regulator-min-microvolt = <5000000>;
170			regulator-max-microvolt = <5000000>;
171			startup-delay-us = <4000000>;
172			enable-active-high;
173			regulator-always-on;
174			regulator-boot-on;
175			gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
176		};
177	};
178};
179
180&mdio {
181	phy1: ethernet-phy@1 { /* Marvell 88E1512 */
182		reg = <1>;
183	};
184};
185
186&pinctrl {
187	disk1_led_pin: disk1-led-pin {
188		marvell,pins = "mpp31";
189		marvell,function = "gpio";
190	};
191
192	disk2_led_pin: disk2-led-pin {
193		marvell,pins = "mpp32";
194		marvell,function = "gpio";
195	};
196
197	sata1_pwr_pin: sata1-pwr-pin {
198		marvell,pins = "mpp37";
199		marvell,function = "gpio";
200	};
201
202	sata2_pwr_pin: sata2-pwr-pin {
203		marvell,pins = "mpp62";
204		marvell,function = "gpio";
205	};
206
207	sata1_pres_pin: sata1-pres-pin {
208		marvell,pins = "mpp60";
209		marvell,function = "gpio";
210	};
211
212	sata2_pres_pin: sata2-pres-pin {
213		marvell,pins = "mpp48";
214		marvell,function = "gpio";
215	};
216
217	syno_id_bit0_pin: syno-id-bit0-pin {
218		marvell,pins = "mpp55";
219		marvell,function = "gpio";
220	};
221
222	syno_id_bit1_pin: syno-id-bit1-pin {
223		marvell,pins = "mpp56";
224		marvell,function = "gpio";
225	};
226
227	syno_id_bit2_pin: syno-id-bit2-pin {
228		marvell,pins = "mpp57";
229		marvell,function = "gpio";
230	};
231
232	syno_id_bit3_pin: syno-id-bit3-pin {
233		marvell,pins = "mpp58";
234		marvell,function = "gpio";
235	};
236
237	fan_ctrl_low_pin: fan-ctrl-low-pin {
238		marvell,pins = "mpp65";
239		marvell,function = "gpio";
240	};
241
242	fan_ctrl_mid_pin: fan-ctrl-mid-pin {
243		marvell,pins = "mpp64";
244		marvell,function = "gpio";
245	};
246
247	fan_ctrl_high_pin: fan-ctrl-high-pin {
248		marvell,pins = "mpp63";
249		marvell,function = "gpio";
250	};
251
252	fan_alarm_pin: fan-alarm-pin {
253		marvell,pins = "mpp38";
254		marvell,function = "gpio";
255	};
256};
257
258&spi0 {
259	status = "okay";
260
261	spi-flash@0 {
262		#address-cells = <1>;
263		#size-cells = <1>;
264		compatible = "micron,n25q064", "jedec,spi-nor";
265		reg = <0>; /* Chip select 0 */
266		spi-max-frequency = <20000000>;
267
268		/*
269		 * Warning!
270		 *
271		 * Synology u-boot uses its compiled-in environment
272		 * and it seems Synology did not care to change u-boot
273		 * default configuration in order to allow saving a
274		 * modified environment at a sensible location. So,
275		 * if you do a 'saveenv' under u-boot, your modified
276		 * environment will be saved at 1MB after the start
277		 * of the flash, i.e. in the middle of the uImage.
278		 * For that reason, it is strongly advised not to
279		 * change the default environment, unless you know
280		 * what you are doing.
281		 */
282		partition@0 { /* u-boot */
283			label = "RedBoot";
284			reg = <0x00000000 0x000c0000>; /* 768KB */
285		};
286
287		partition@c0000 { /* uImage */
288			label = "zImage";
289			reg = <0x000c0000 0x002d0000>; /* 2880KB */
290		};
291
292		partition@390000 { /* uInitramfs */
293			label = "rd.gz";
294			reg = <0x00390000 0x00440000>; /* 4250KB */
295		};
296
297		partition@7d0000 { /* MAC address and serial number */
298			label = "vendor";
299			reg = <0x007d0000 0x00010000>; /* 64KB */
300		};
301
302		partition@7e0000 {
303			label = "RedBoot config";
304			reg = <0x007e0000 0x00010000>; /* 64KB */
305		};
306
307		partition@7f0000 {
308			label = "FIS directory";
309			reg = <0x007f0000 0x00010000>; /* 64KB */
310		};
311	};
312};
v4.10.11
 
  1/*
  2 * Device Tree file for Synology DS213j
  3 *
  4 * Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org>
  5 *
  6 * This file is dual-licensed: you can use it either under the terms
  7 * of the GPL or the X11 license, at your option. Note that this dual
  8 * licensing only applies to this file, and not this project as a
  9 * whole.
 10 *
 11 *  a) This file is free software; you can redistribute it and/or
 12 *     modify it under the terms of the GNU General Public License as
 13 *     published by the Free Software Foundation; either version 2 of the
 14 *     License, or (at your option) any later version.
 15 *
 16 *     This file is distributed in the hope that it will be useful
 17 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 18 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 19 *     GNU General Public License for more details.
 20 *
 21 * Or, alternatively
 22 *
 23 *  b) Permission is hereby granted, free of charge, to any person
 24 *     obtaining a copy of this software and associated documentation
 25 *     files (the "Software"), to deal in the Software without
 26 *     restriction, including without limitation the rights to use
 27 *     copy, modify, merge, publish, distribute, sublicense, and/or
 28 *     sell copies of the Software, and to permit persons to whom the
 29 *     Software is furnished to do so, subject to the following
 30 *     conditions:
 31 *
 32 *     The above copyright notice and this permission notice shall be
 33 *     included in all copies or substantial portions of the Software.
 34 *
 35 *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
 36 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 37 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 38 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 39 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
 40 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 41 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 42 *     OTHER DEALINGS IN THE SOFTWARE.
 43 *
 44 * Note: this Device Tree assumes that the bootloader has remapped the
 45 * internal registers to 0xf1000000 (instead of the old 0xd0000000).
 46 * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
 47 * bootloaders provided by Marvell. It is used in recent versions of
 48 * DSM software provided by Synology. Nonetheless, some earlier boards
 49 * were delivered with an older version of u-boot that left internal
 50 * registers mapped at 0xd0000000. If you have such a device you will
 51 * not be able to directly boot a kernel based on this Device Tree. In
 52 * that case, the preferred solution is to update your bootloader (e.g.
 53 * by upgrading to latest version of DSM, or building a new one and
 54 * installing it from u-boot prompt) or adjust the Devive Tree
 55 * (s/0xf1000000/0xd0000000/ in 'ranges' below).
 56 */
 57
 58/dts-v1/;
 59
 60#include <dt-bindings/input/input.h>
 61#include <dt-bindings/gpio/gpio.h>
 62#include "armada-370.dtsi"
 63
 64/ {
 65	model = "Synology DS213j";
 66	compatible = "synology,ds213j", "marvell,armada370",
 67		     "marvell,armada-370-xp";
 68
 69	chosen {
 70		stdout-path = "serial0:115200n8";
 71	};
 72
 73	memory@0 {
 74		device_type = "memory";
 75		reg = <0x00000000 0x20000000>; /* 512 MB */
 76	};
 77
 78	soc {
 79		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
 80			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
 81			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 82
 83		internal-regs {
 84
 85			/* RTC provided by Seiko S-35390A I2C RTC chip below */
 86			rtc@10300 {
 87				status = "disabled";
 88			};
 89
 90			i2c@11000 {
 91				compatible = "marvell,mv64xxx-i2c";
 92				pinctrl-0 = <&i2c0_pins>;
 93				pinctrl-names = "default";
 94				clock-frequency = <400000>;
 95				status = "okay";
 96
 97				/* Main device RTC chip */
 98				s35390a: s35390a@30 {
 99					 compatible = "sii,s35390a";
100					 reg = <0x30>;
101				};
102			};
103
104			/* Connected to a header on device's PCB */
105			serial@12000 {
106				status = "okay";
107			};
108
109			/* Connected to a TI MSP430F2111 for power control */
110			serial@12100 {
111				status = "okay";
112			};
113
114			poweroff@12100 {
115				compatible = "synology,power-off";
116				reg = <0x12100 0x100>;
117				clocks = <&coreclk 0>;
118			};
119
120			/* rear USB port, near reset button */
121			usb@50000 {
122				status = "okay";
123			};
124
125			/* rear USB port, near RJ45 port */
126			usb@51000 {
127				status = "okay";
128			};
129
130			ethernet@70000 {
131			       status = "okay";
132			       phy = <&phy1>;
133			       phy-mode = "sgmii";
134			};
135
136			sata@a0000 {
137				nr-ports = <2>;
138				status = "okay";
139			};
140		};
141	};
142
143	gpio-fan-32-38 {
144		status = "okay";
145		compatible = "gpio-fan";
146		pinctrl-0 = <&fan_ctrl_low_pin &fan_ctrl_mid_pin
147			     &fan_ctrl_high_pin &fan_alarm_pin>;
148		pinctrl-names = "default";
149		gpios = <&gpio1 31 GPIO_ACTIVE_HIGH
150			 &gpio2  0 GPIO_ACTIVE_HIGH
151			 &gpio2  1 GPIO_ACTIVE_HIGH>;
152		alarm-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
153		gpio-fan,speed-map = <    0 0
154				       1000 1
155				       1150 2
156				       1350 4
157				       1500 3
158				       1650 5
159				       1750 6
160				       1900 7 >;
161	};
162
163	gpio-leds {
164		compatible = "gpio-leds";
165		pinctrl-0 = <&disk1_led_pin
166			     &disk2_led_pin>;
167		pinctrl-names = "default";
168
169		disk1-led-amber {
170			label = "synology:amber:disk1";
171			gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
172			default-state = "keep";
173		};
174
175		disk2-led-amber {
176			label = "synology:amber:disk2";
177			gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
178			default-state = "keep";
179		};
180	};
181
182	regulators {
183		compatible = "simple-bus";
184		#address-cells = <1>;
185		#size-cells = <0>;
186		pinctrl-0 = <&sata1_pwr_pin &sata2_pwr_pin>;
187		pinctrl-names = "default";
188
189		sata1_regulator: sata1-regulator@1 {
190			compatible = "regulator-fixed";
191			reg = <1>;
192			regulator-name = "SATA1 Power";
193			regulator-min-microvolt = <5000000>;
194			regulator-max-microvolt = <5000000>;
195			startup-delay-us = <2000000>;
196			enable-active-high;
197			regulator-always-on;
198			regulator-boot-on;
199			gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
200		};
201
202		sata2_regulator: sata2-regulator@2 {
203			compatible = "regulator-fixed";
204			reg = <2>;
205			regulator-name = "SATA2 Power";
206			regulator-min-microvolt = <5000000>;
207			regulator-max-microvolt = <5000000>;
208			startup-delay-us = <4000000>;
209			enable-active-high;
210			regulator-always-on;
211			regulator-boot-on;
212			gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
213		};
214	};
215};
216
217&mdio {
218	phy1: ethernet-phy@1 { /* Marvell 88E1512 */
219		reg = <1>;
220	};
221};
222
223&pinctrl {
224	disk1_led_pin: disk1-led-pin {
225		marvell,pins = "mpp31";
226		marvell,function = "gpio";
227	};
228
229	disk2_led_pin: disk2-led-pin {
230		marvell,pins = "mpp32";
231		marvell,function = "gpio";
232	};
233
234	sata1_pwr_pin: sata1-pwr-pin {
235		marvell,pins = "mpp37";
236		marvell,function = "gpio";
237	};
238
239	sata2_pwr_pin: sata2-pwr-pin {
240		marvell,pins = "mpp62";
241		marvell,function = "gpio";
242	};
243
244	sata1_pres_pin: sata1-pres-pin {
245		marvell,pins = "mpp60";
246		marvell,function = "gpio";
247	};
248
249	sata2_pres_pin: sata2-pres-pin {
250		marvell,pins = "mpp48";
251		marvell,function = "gpio";
252	};
253
254	syno_id_bit0_pin: syno-id-bit0-pin {
255		marvell,pins = "mpp55";
256		marvell,function = "gpio";
257	};
258
259	syno_id_bit1_pin: syno-id-bit1-pin {
260		marvell,pins = "mpp56";
261		marvell,function = "gpio";
262	};
263
264	syno_id_bit2_pin: syno-id-bit2-pin {
265		marvell,pins = "mpp57";
266		marvell,function = "gpio";
267	};
268
269	syno_id_bit3_pin: syno-id-bit3-pin {
270		marvell,pins = "mpp58";
271		marvell,function = "gpio";
272	};
273
274	fan_ctrl_low_pin: fan-ctrl-low-pin {
275		marvell,pins = "mpp65";
276		marvell,function = "gpio";
277	};
278
279	fan_ctrl_mid_pin: fan-ctrl-mid-pin {
280		marvell,pins = "mpp64";
281		marvell,function = "gpio";
282	};
283
284	fan_ctrl_high_pin: fan-ctrl-high-pin {
285		marvell,pins = "mpp63";
286		marvell,function = "gpio";
287	};
288
289	fan_alarm_pin: fan-alarm-pin {
290		marvell,pins = "mpp38";
291		marvell,function = "gpio";
292	};
293};
294
295&spi0 {
296	status = "okay";
297
298	spi-flash@0 {
299		#address-cells = <1>;
300		#size-cells = <1>;
301		compatible = "micron,n25q064", "jedec,spi-nor";
302		reg = <0>; /* Chip select 0 */
303		spi-max-frequency = <20000000>;
304
305		/*
306		 * Warning!
307		 *
308		 * Synology u-boot uses its compiled-in environment
309		 * and it seems Synology did not care to change u-boot
310		 * default configuration in order to allow saving a
311		 * modified environment at a sensible location. So,
312		 * if you do a 'saveenv' under u-boot, your modified
313		 * environment will be saved at 1MB after the start
314		 * of the flash, i.e. in the middle of the uImage.
315		 * For that reason, it is strongly advised not to
316		 * change the default environment, unless you know
317		 * what you are doing.
318		 */
319		partition@00000000 { /* u-boot */
320			label = "RedBoot";
321			reg = <0x00000000 0x000c0000>; /* 768KB */
322		};
323
324		partition@000c0000 { /* uImage */
325			label = "zImage";
326			reg = <0x000c0000 0x002d0000>; /* 2880KB */
327		};
328
329		partition@00390000 { /* uInitramfs */
330			label = "rd.gz";
331			reg = <0x00390000 0x00440000>; /* 4250KB */
332		};
333
334		partition@007d0000 { /* MAC address and serial number */
335			label = "vendor";
336			reg = <0x007d0000 0x00010000>; /* 64KB */
337		};
338
339		partition@007e0000 {
340			label = "RedBoot config";
341			reg = <0x007e0000 0x00010000>; /* 64KB */
342		};
343
344		partition@007f0000 {
345			label = "FIS directory";
346			reg = <0x007f0000 0x00010000>; /* 64KB */
347		};
348	};
349};