1724ba675SRob Herring// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2724ba675SRob Herring/* 3724ba675SRob Herring * Device Tree file for Synology DS213j 4724ba675SRob Herring * 5724ba675SRob Herring * Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org> 6724ba675SRob Herring * 7724ba675SRob Herring * Note: this Device Tree assumes that the bootloader has remapped the 8724ba675SRob Herring * internal registers to 0xf1000000 (instead of the old 0xd0000000). 9724ba675SRob Herring * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot 10724ba675SRob Herring * bootloaders provided by Marvell. It is used in recent versions of 11724ba675SRob Herring * DSM software provided by Synology. Nonetheless, some earlier boards 12724ba675SRob Herring * were delivered with an older version of u-boot that left internal 13724ba675SRob Herring * registers mapped at 0xd0000000. If you have such a device you will 14724ba675SRob Herring * not be able to directly boot a kernel based on this Device Tree. In 15724ba675SRob Herring * that case, the preferred solution is to update your bootloader (e.g. 16724ba675SRob Herring * by upgrading to latest version of DSM, or building a new one and 17724ba675SRob Herring * installing it from u-boot prompt) or adjust the Devive Tree 18724ba675SRob Herring * (s/0xf1000000/0xd0000000/ in 'ranges' below). 19724ba675SRob Herring */ 20724ba675SRob Herring 21724ba675SRob Herring/dts-v1/; 22724ba675SRob Herring 23724ba675SRob Herring#include <dt-bindings/input/input.h> 24724ba675SRob Herring#include <dt-bindings/gpio/gpio.h> 25724ba675SRob Herring#include "armada-370.dtsi" 26724ba675SRob Herring 27724ba675SRob Herring/ { 28724ba675SRob Herring model = "Synology DS213j"; 29724ba675SRob Herring compatible = "synology,ds213j", "marvell,armada370", 30724ba675SRob Herring "marvell,armada-370-xp"; 31724ba675SRob Herring 32724ba675SRob Herring chosen { 33724ba675SRob Herring stdout-path = "serial0:115200n8"; 34724ba675SRob Herring }; 35724ba675SRob Herring 36724ba675SRob Herring memory@0 { 37724ba675SRob Herring device_type = "memory"; 38724ba675SRob Herring reg = <0x00000000 0x20000000>; /* 512 MB */ 39724ba675SRob Herring }; 40724ba675SRob Herring 41724ba675SRob Herring soc { 42724ba675SRob Herring ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 43724ba675SRob Herring MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000 44724ba675SRob Herring MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>; 45724ba675SRob Herring 46724ba675SRob Herring internal-regs { 47724ba675SRob Herring 48724ba675SRob Herring /* RTC provided by Seiko S-35390A I2C RTC chip below */ 49724ba675SRob Herring rtc@10300 { 50724ba675SRob Herring status = "disabled"; 51724ba675SRob Herring }; 52724ba675SRob Herring 53724ba675SRob Herring i2c@11000 { 54724ba675SRob Herring compatible = "marvell,mv64xxx-i2c"; 55724ba675SRob Herring pinctrl-0 = <&i2c0_pins>; 56724ba675SRob Herring pinctrl-names = "default"; 57724ba675SRob Herring clock-frequency = <400000>; 58724ba675SRob Herring status = "okay"; 59724ba675SRob Herring 60724ba675SRob Herring /* Main device RTC chip */ 61724ba675SRob Herring s35390a: s35390a@30 { 62724ba675SRob Herring compatible = "sii,s35390a"; 63724ba675SRob Herring reg = <0x30>; 64724ba675SRob Herring }; 65724ba675SRob Herring }; 66724ba675SRob Herring 67724ba675SRob Herring /* Connected to a header on device's PCB */ 68724ba675SRob Herring serial@12000 { 69724ba675SRob Herring status = "okay"; 70724ba675SRob Herring }; 71724ba675SRob Herring 72724ba675SRob Herring /* Connected to a TI MSP430F2111 for power control */ 73724ba675SRob Herring serial@12100 { 74724ba675SRob Herring status = "okay"; 75724ba675SRob Herring }; 76724ba675SRob Herring 77724ba675SRob Herring poweroff@12100 { 78724ba675SRob Herring compatible = "synology,power-off"; 79724ba675SRob Herring reg = <0x12100 0x100>; 80724ba675SRob Herring clocks = <&coreclk 0>; 81724ba675SRob Herring }; 82724ba675SRob Herring 83724ba675SRob Herring /* rear USB port, near reset button */ 84724ba675SRob Herring usb@50000 { 85724ba675SRob Herring status = "okay"; 86724ba675SRob Herring }; 87724ba675SRob Herring 88724ba675SRob Herring /* rear USB port, near RJ45 port */ 89724ba675SRob Herring usb@51000 { 90724ba675SRob Herring status = "okay"; 91724ba675SRob Herring }; 92724ba675SRob Herring 93724ba675SRob Herring ethernet@70000 { 94724ba675SRob Herring status = "okay"; 95724ba675SRob Herring phy = <&phy1>; 96724ba675SRob Herring phy-mode = "sgmii"; 97724ba675SRob Herring }; 98724ba675SRob Herring 99724ba675SRob Herring sata@a0000 { 100724ba675SRob Herring nr-ports = <2>; 101724ba675SRob Herring status = "okay"; 102724ba675SRob Herring }; 103724ba675SRob Herring }; 104724ba675SRob Herring }; 105724ba675SRob Herring 106724ba675SRob Herring gpio-fan-32-38 { 107724ba675SRob Herring status = "okay"; 108724ba675SRob Herring compatible = "gpio-fan"; 109724ba675SRob Herring pinctrl-0 = <&fan_ctrl_low_pin &fan_ctrl_mid_pin 110724ba675SRob Herring &fan_ctrl_high_pin &fan_alarm_pin>; 111724ba675SRob Herring pinctrl-names = "default"; 112724ba675SRob Herring gpios = <&gpio1 31 GPIO_ACTIVE_HIGH 113724ba675SRob Herring &gpio2 0 GPIO_ACTIVE_HIGH 114724ba675SRob Herring &gpio2 1 GPIO_ACTIVE_HIGH>; 115724ba675SRob Herring alarm-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; 116*62f34e3eSDavid Heidelberg gpio-fan,speed-map = < 0 0>, 117*62f34e3eSDavid Heidelberg <1000 1>, 118*62f34e3eSDavid Heidelberg <1150 2>, 119*62f34e3eSDavid Heidelberg <1350 4>, 120*62f34e3eSDavid Heidelberg <1500 3>, 121*62f34e3eSDavid Heidelberg <1650 5>, 122*62f34e3eSDavid Heidelberg <1750 6>, 123*62f34e3eSDavid Heidelberg <1900 7>; 124724ba675SRob Herring }; 125724ba675SRob Herring 126724ba675SRob Herring gpio-leds { 127724ba675SRob Herring compatible = "gpio-leds"; 128724ba675SRob Herring pinctrl-0 = <&disk1_led_pin 129724ba675SRob Herring &disk2_led_pin>; 130724ba675SRob Herring pinctrl-names = "default"; 131724ba675SRob Herring 132724ba675SRob Herring disk1-led-amber { 133724ba675SRob Herring label = "synology:amber:disk1"; 134724ba675SRob Herring gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; 135724ba675SRob Herring default-state = "keep"; 136724ba675SRob Herring }; 137724ba675SRob Herring 138724ba675SRob Herring disk2-led-amber { 139724ba675SRob Herring label = "synology:amber:disk2"; 140724ba675SRob Herring gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; 141724ba675SRob Herring default-state = "keep"; 142724ba675SRob Herring }; 143724ba675SRob Herring }; 144724ba675SRob Herring 145afa6b4f3SKrzysztof Kozlowski sata1_regulator: sata1-regulator-1 { 146724ba675SRob Herring compatible = "regulator-fixed"; 147724ba675SRob Herring regulator-name = "SATA1 Power"; 148724ba675SRob Herring regulator-min-microvolt = <5000000>; 149724ba675SRob Herring regulator-max-microvolt = <5000000>; 150724ba675SRob Herring startup-delay-us = <2000000>; 151724ba675SRob Herring enable-active-high; 152724ba675SRob Herring regulator-always-on; 153724ba675SRob Herring regulator-boot-on; 154724ba675SRob Herring gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; 155afa6b4f3SKrzysztof Kozlowski pinctrl-0 = <&sata1_pwr_pin>; 156afa6b4f3SKrzysztof Kozlowski pinctrl-names = "default"; 157724ba675SRob Herring }; 158724ba675SRob Herring 159afa6b4f3SKrzysztof Kozlowski sata2_regulator: sata2-regulator-2 { 160724ba675SRob Herring compatible = "regulator-fixed"; 161724ba675SRob Herring regulator-name = "SATA2 Power"; 162724ba675SRob Herring regulator-min-microvolt = <5000000>; 163724ba675SRob Herring regulator-max-microvolt = <5000000>; 164724ba675SRob Herring startup-delay-us = <4000000>; 165724ba675SRob Herring enable-active-high; 166724ba675SRob Herring regulator-always-on; 167724ba675SRob Herring regulator-boot-on; 168724ba675SRob Herring gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>; 169afa6b4f3SKrzysztof Kozlowski pinctrl-0 = <&sata2_pwr_pin>; 170afa6b4f3SKrzysztof Kozlowski pinctrl-names = "default"; 171724ba675SRob Herring }; 172724ba675SRob Herring}; 173724ba675SRob Herring 174724ba675SRob Herring&mdio { 175724ba675SRob Herring phy1: ethernet-phy@1 { /* Marvell 88E1512 */ 176724ba675SRob Herring reg = <1>; 177724ba675SRob Herring }; 178724ba675SRob Herring}; 179724ba675SRob Herring 180724ba675SRob Herring&pinctrl { 181724ba675SRob Herring disk1_led_pin: disk1-led-pin { 182724ba675SRob Herring marvell,pins = "mpp31"; 183724ba675SRob Herring marvell,function = "gpio"; 184724ba675SRob Herring }; 185724ba675SRob Herring 186724ba675SRob Herring disk2_led_pin: disk2-led-pin { 187724ba675SRob Herring marvell,pins = "mpp32"; 188724ba675SRob Herring marvell,function = "gpio"; 189724ba675SRob Herring }; 190724ba675SRob Herring 191724ba675SRob Herring sata1_pwr_pin: sata1-pwr-pin { 192724ba675SRob Herring marvell,pins = "mpp37"; 193724ba675SRob Herring marvell,function = "gpio"; 194724ba675SRob Herring }; 195724ba675SRob Herring 196724ba675SRob Herring sata2_pwr_pin: sata2-pwr-pin { 197724ba675SRob Herring marvell,pins = "mpp62"; 198724ba675SRob Herring marvell,function = "gpio"; 199724ba675SRob Herring }; 200724ba675SRob Herring 201724ba675SRob Herring sata1_pres_pin: sata1-pres-pin { 202724ba675SRob Herring marvell,pins = "mpp60"; 203724ba675SRob Herring marvell,function = "gpio"; 204724ba675SRob Herring }; 205724ba675SRob Herring 206724ba675SRob Herring sata2_pres_pin: sata2-pres-pin { 207724ba675SRob Herring marvell,pins = "mpp48"; 208724ba675SRob Herring marvell,function = "gpio"; 209724ba675SRob Herring }; 210724ba675SRob Herring 211724ba675SRob Herring syno_id_bit0_pin: syno-id-bit0-pin { 212724ba675SRob Herring marvell,pins = "mpp55"; 213724ba675SRob Herring marvell,function = "gpio"; 214724ba675SRob Herring }; 215724ba675SRob Herring 216724ba675SRob Herring syno_id_bit1_pin: syno-id-bit1-pin { 217724ba675SRob Herring marvell,pins = "mpp56"; 218724ba675SRob Herring marvell,function = "gpio"; 219724ba675SRob Herring }; 220724ba675SRob Herring 221724ba675SRob Herring syno_id_bit2_pin: syno-id-bit2-pin { 222724ba675SRob Herring marvell,pins = "mpp57"; 223724ba675SRob Herring marvell,function = "gpio"; 224724ba675SRob Herring }; 225724ba675SRob Herring 226724ba675SRob Herring syno_id_bit3_pin: syno-id-bit3-pin { 227724ba675SRob Herring marvell,pins = "mpp58"; 228724ba675SRob Herring marvell,function = "gpio"; 229724ba675SRob Herring }; 230724ba675SRob Herring 231724ba675SRob Herring fan_ctrl_low_pin: fan-ctrl-low-pin { 232724ba675SRob Herring marvell,pins = "mpp65"; 233724ba675SRob Herring marvell,function = "gpio"; 234724ba675SRob Herring }; 235724ba675SRob Herring 236724ba675SRob Herring fan_ctrl_mid_pin: fan-ctrl-mid-pin { 237724ba675SRob Herring marvell,pins = "mpp64"; 238724ba675SRob Herring marvell,function = "gpio"; 239724ba675SRob Herring }; 240724ba675SRob Herring 241724ba675SRob Herring fan_ctrl_high_pin: fan-ctrl-high-pin { 242724ba675SRob Herring marvell,pins = "mpp63"; 243724ba675SRob Herring marvell,function = "gpio"; 244724ba675SRob Herring }; 245724ba675SRob Herring 246724ba675SRob Herring fan_alarm_pin: fan-alarm-pin { 247724ba675SRob Herring marvell,pins = "mpp38"; 248724ba675SRob Herring marvell,function = "gpio"; 249724ba675SRob Herring }; 250724ba675SRob Herring}; 251724ba675SRob Herring 252724ba675SRob Herring&spi0 { 253724ba675SRob Herring status = "okay"; 254724ba675SRob Herring 255724ba675SRob Herring flash@0 { 256724ba675SRob Herring #address-cells = <1>; 257724ba675SRob Herring #size-cells = <1>; 258724ba675SRob Herring compatible = "micron,n25q064", "jedec,spi-nor"; 259724ba675SRob Herring reg = <0>; /* Chip select 0 */ 260724ba675SRob Herring spi-max-frequency = <20000000>; 261724ba675SRob Herring 262724ba675SRob Herring /* 263724ba675SRob Herring * Warning! 264724ba675SRob Herring * 265724ba675SRob Herring * Synology u-boot uses its compiled-in environment 266724ba675SRob Herring * and it seems Synology did not care to change u-boot 267724ba675SRob Herring * default configuration in order to allow saving a 268724ba675SRob Herring * modified environment at a sensible location. So, 269724ba675SRob Herring * if you do a 'saveenv' under u-boot, your modified 270724ba675SRob Herring * environment will be saved at 1MB after the start 271724ba675SRob Herring * of the flash, i.e. in the middle of the uImage. 272724ba675SRob Herring * For that reason, it is strongly advised not to 273724ba675SRob Herring * change the default environment, unless you know 274724ba675SRob Herring * what you are doing. 275724ba675SRob Herring */ 276724ba675SRob Herring partition@0 { /* u-boot */ 277724ba675SRob Herring label = "RedBoot"; 278724ba675SRob Herring reg = <0x00000000 0x000c0000>; /* 768KB */ 279724ba675SRob Herring }; 280724ba675SRob Herring 281724ba675SRob Herring partition@c0000 { /* uImage */ 282724ba675SRob Herring label = "zImage"; 283724ba675SRob Herring reg = <0x000c0000 0x002d0000>; /* 2880KB */ 284724ba675SRob Herring }; 285724ba675SRob Herring 286724ba675SRob Herring partition@390000 { /* uInitramfs */ 287724ba675SRob Herring label = "rd.gz"; 288724ba675SRob Herring reg = <0x00390000 0x00440000>; /* 4250KB */ 289724ba675SRob Herring }; 290724ba675SRob Herring 291724ba675SRob Herring partition@7d0000 { /* MAC address and serial number */ 292724ba675SRob Herring label = "vendor"; 293724ba675SRob Herring reg = <0x007d0000 0x00010000>; /* 64KB */ 294724ba675SRob Herring }; 295724ba675SRob Herring 296724ba675SRob Herring partition@7e0000 { 297724ba675SRob Herring label = "RedBoot config"; 298724ba675SRob Herring reg = <0x007e0000 0x00010000>; /* 64KB */ 299724ba675SRob Herring }; 300724ba675SRob Herring 301724ba675SRob Herring partition@7f0000 { 302724ba675SRob Herring label = "FIS directory"; 303724ba675SRob Herring reg = <0x007f0000 0x00010000>; /* 64KB */ 304724ba675SRob Herring }; 305724ba675SRob Herring }; 306724ba675SRob Herring}; 307