0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Device Tree file for Synology DS213j
0004 *
0005 * Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org>
0006 *
0007 * Note: this Device Tree assumes that the bootloader has remapped the
0008 * internal registers to 0xf1000000 (instead of the old 0xd0000000).
0009 * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
0010 * bootloaders provided by Marvell. It is used in recent versions of
0011 * DSM software provided by Synology. Nonetheless, some earlier boards
0012 * were delivered with an older version of u-boot that left internal
0013 * registers mapped at 0xd0000000. If you have such a device you will
0014 * not be able to directly boot a kernel based on this Device Tree. In
0015 * that case, the preferred solution is to update your bootloader (e.g.
0016 * by upgrading to latest version of DSM, or building a new one and
0017 * installing it from u-boot prompt) or adjust the Devive Tree
0018 * (s/0xf1000000/0xd0000000/ in 'ranges' below).
0019 */
0020
0021 /dts-v1/;
0022
0023 #include <dt-bindings/input/input.h>
0024 #include <dt-bindings/gpio/gpio.h>
0025 #include "armada-370.dtsi"
0026
0027 / {
0028 model = "Synology DS213j";
0029 compatible = "synology,ds213j", "marvell,armada370",
0030 "marvell,armada-370-xp";
0031
0032 chosen {
0033 stdout-path = "serial0:115200n8";
0034 };
0035
0036 memory@0 {
0037 device_type = "memory";
0038 reg = <0x00000000 0x20000000>; /* 512 MB */
0039 };
0040
0041 soc {
0042 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
0043 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
0044 MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
0045
0046 internal-regs {
0047
0048 /* RTC provided by Seiko S-35390A I2C RTC chip below */
0049 rtc@10300 {
0050 status = "disabled";
0051 };
0052
0053 i2c@11000 {
0054 compatible = "marvell,mv64xxx-i2c";
0055 pinctrl-0 = <&i2c0_pins>;
0056 pinctrl-names = "default";
0057 clock-frequency = <400000>;
0058 status = "okay";
0059
0060 /* Main device RTC chip */
0061 s35390a: s35390a@30 {
0062 compatible = "sii,s35390a";
0063 reg = <0x30>;
0064 };
0065 };
0066
0067 /* Connected to a header on device's PCB */
0068 serial@12000 {
0069 status = "okay";
0070 };
0071
0072 /* Connected to a TI MSP430F2111 for power control */
0073 serial@12100 {
0074 status = "okay";
0075 };
0076
0077 poweroff@12100 {
0078 compatible = "synology,power-off";
0079 reg = <0x12100 0x100>;
0080 clocks = <&coreclk 0>;
0081 };
0082
0083 /* rear USB port, near reset button */
0084 usb@50000 {
0085 status = "okay";
0086 };
0087
0088 /* rear USB port, near RJ45 port */
0089 usb@51000 {
0090 status = "okay";
0091 };
0092
0093 ethernet@70000 {
0094 status = "okay";
0095 phy = <&phy1>;
0096 phy-mode = "sgmii";
0097 };
0098
0099 sata@a0000 {
0100 nr-ports = <2>;
0101 status = "okay";
0102 };
0103 };
0104 };
0105
0106 gpio-fan-32-38 {
0107 status = "okay";
0108 compatible = "gpio-fan";
0109 pinctrl-0 = <&fan_ctrl_low_pin &fan_ctrl_mid_pin
0110 &fan_ctrl_high_pin &fan_alarm_pin>;
0111 pinctrl-names = "default";
0112 gpios = <&gpio1 31 GPIO_ACTIVE_HIGH
0113 &gpio2 0 GPIO_ACTIVE_HIGH
0114 &gpio2 1 GPIO_ACTIVE_HIGH>;
0115 alarm-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
0116 gpio-fan,speed-map = < 0 0
0117 1000 1
0118 1150 2
0119 1350 4
0120 1500 3
0121 1650 5
0122 1750 6
0123 1900 7 >;
0124 };
0125
0126 gpio-leds {
0127 compatible = "gpio-leds";
0128 pinctrl-0 = <&disk1_led_pin
0129 &disk2_led_pin>;
0130 pinctrl-names = "default";
0131
0132 disk1-led-amber {
0133 label = "synology:amber:disk1";
0134 gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
0135 default-state = "keep";
0136 };
0137
0138 disk2-led-amber {
0139 label = "synology:amber:disk2";
0140 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
0141 default-state = "keep";
0142 };
0143 };
0144
0145 regulators {
0146 compatible = "simple-bus";
0147 #address-cells = <1>;
0148 #size-cells = <0>;
0149 pinctrl-0 = <&sata1_pwr_pin &sata2_pwr_pin>;
0150 pinctrl-names = "default";
0151
0152 sata1_regulator: sata1-regulator@1 {
0153 compatible = "regulator-fixed";
0154 reg = <1>;
0155 regulator-name = "SATA1 Power";
0156 regulator-min-microvolt = <5000000>;
0157 regulator-max-microvolt = <5000000>;
0158 startup-delay-us = <2000000>;
0159 enable-active-high;
0160 regulator-always-on;
0161 regulator-boot-on;
0162 gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
0163 };
0164
0165 sata2_regulator: sata2-regulator@2 {
0166 compatible = "regulator-fixed";
0167 reg = <2>;
0168 regulator-name = "SATA2 Power";
0169 regulator-min-microvolt = <5000000>;
0170 regulator-max-microvolt = <5000000>;
0171 startup-delay-us = <4000000>;
0172 enable-active-high;
0173 regulator-always-on;
0174 regulator-boot-on;
0175 gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
0176 };
0177 };
0178 };
0179
0180 &mdio {
0181 phy1: ethernet-phy@1 { /* Marvell 88E1512 */
0182 reg = <1>;
0183 };
0184 };
0185
0186 &pinctrl {
0187 disk1_led_pin: disk1-led-pin {
0188 marvell,pins = "mpp31";
0189 marvell,function = "gpio";
0190 };
0191
0192 disk2_led_pin: disk2-led-pin {
0193 marvell,pins = "mpp32";
0194 marvell,function = "gpio";
0195 };
0196
0197 sata1_pwr_pin: sata1-pwr-pin {
0198 marvell,pins = "mpp37";
0199 marvell,function = "gpio";
0200 };
0201
0202 sata2_pwr_pin: sata2-pwr-pin {
0203 marvell,pins = "mpp62";
0204 marvell,function = "gpio";
0205 };
0206
0207 sata1_pres_pin: sata1-pres-pin {
0208 marvell,pins = "mpp60";
0209 marvell,function = "gpio";
0210 };
0211
0212 sata2_pres_pin: sata2-pres-pin {
0213 marvell,pins = "mpp48";
0214 marvell,function = "gpio";
0215 };
0216
0217 syno_id_bit0_pin: syno-id-bit0-pin {
0218 marvell,pins = "mpp55";
0219 marvell,function = "gpio";
0220 };
0221
0222 syno_id_bit1_pin: syno-id-bit1-pin {
0223 marvell,pins = "mpp56";
0224 marvell,function = "gpio";
0225 };
0226
0227 syno_id_bit2_pin: syno-id-bit2-pin {
0228 marvell,pins = "mpp57";
0229 marvell,function = "gpio";
0230 };
0231
0232 syno_id_bit3_pin: syno-id-bit3-pin {
0233 marvell,pins = "mpp58";
0234 marvell,function = "gpio";
0235 };
0236
0237 fan_ctrl_low_pin: fan-ctrl-low-pin {
0238 marvell,pins = "mpp65";
0239 marvell,function = "gpio";
0240 };
0241
0242 fan_ctrl_mid_pin: fan-ctrl-mid-pin {
0243 marvell,pins = "mpp64";
0244 marvell,function = "gpio";
0245 };
0246
0247 fan_ctrl_high_pin: fan-ctrl-high-pin {
0248 marvell,pins = "mpp63";
0249 marvell,function = "gpio";
0250 };
0251
0252 fan_alarm_pin: fan-alarm-pin {
0253 marvell,pins = "mpp38";
0254 marvell,function = "gpio";
0255 };
0256 };
0257
0258 &spi0 {
0259 status = "okay";
0260
0261 flash@0 {
0262 #address-cells = <1>;
0263 #size-cells = <1>;
0264 compatible = "micron,n25q064", "jedec,spi-nor";
0265 reg = <0>; /* Chip select 0 */
0266 spi-max-frequency = <20000000>;
0267
0268 /*
0269 * Warning!
0270 *
0271 * Synology u-boot uses its compiled-in environment
0272 * and it seems Synology did not care to change u-boot
0273 * default configuration in order to allow saving a
0274 * modified environment at a sensible location. So,
0275 * if you do a 'saveenv' under u-boot, your modified
0276 * environment will be saved at 1MB after the start
0277 * of the flash, i.e. in the middle of the uImage.
0278 * For that reason, it is strongly advised not to
0279 * change the default environment, unless you know
0280 * what you are doing.
0281 */
0282 partition@0 { /* u-boot */
0283 label = "RedBoot";
0284 reg = <0x00000000 0x000c0000>; /* 768KB */
0285 };
0286
0287 partition@c0000 { /* uImage */
0288 label = "zImage";
0289 reg = <0x000c0000 0x002d0000>; /* 2880KB */
0290 };
0291
0292 partition@390000 { /* uInitramfs */
0293 label = "rd.gz";
0294 reg = <0x00390000 0x00440000>; /* 4250KB */
0295 };
0296
0297 partition@7d0000 { /* MAC address and serial number */
0298 label = "vendor";
0299 reg = <0x007d0000 0x00010000>; /* 64KB */
0300 };
0301
0302 partition@7e0000 {
0303 label = "RedBoot config";
0304 reg = <0x007e0000 0x00010000>; /* 64KB */
0305 };
0306
0307 partition@7f0000 {
0308 label = "FIS directory";
0309 reg = <0x007f0000 0x00010000>; /* 64KB */
0310 };
0311 };
0312 };