1 From 2f08de94f207a4347053e1faa22c9a310c9c61b0 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Fri, 17 Nov 2017 16:36:32 +0100
4 Subject: [PATCH 13/31] ARM: dts: Add basic devicetree for D-Link DNS-313
6 This adds a basic device tree for the D-Link DNS-313
7 NAS enclosure. This device has a thermal sensor and a
8 fan so we add a thermal zone for the chassis in the
9 device tree based on information from the product.
11 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
14 arch/arm/boot/dts/Makefile | 1 +
15 arch/arm/boot/dts/gemini-dlink-dns-313.dts | 241 +++++++++++++++++++++++++++++
16 2 files changed, 242 insertions(+)
17 create mode 100644 arch/arm/boot/dts/gemini-dlink-dns-313.dts
19 --- a/arch/arm/boot/dts/Makefile
20 +++ b/arch/arm/boot/dts/Makefile
21 @@ -185,6 +185,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
22 exynos5800-peach-pi.dtb
23 dtb-$(CONFIG_ARCH_GEMINI) += \
24 gemini-dlink-dir-685.dtb \
25 + gemini-dlink-dns-313.dtb \
30 +++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
32 +// SPDX-License-Identifier: GPL-2.0
34 + * Device Tree file for D-Link DNS-313 1-Bay Network Storage Enclosure
39 +#include "gemini.dtsi"
40 +#include <dt-bindings/input/input.h>
41 +#include <dt-bindings/thermal/thermal.h>
44 + model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
45 + compatible = "dlink,dns-313", "cortina,gemini";
46 + #address-cells = <1>;
50 + /* 64 MB SDRAM in a Nanya NT5DS32M16BS-6K package */
51 + device_type = "memory";
52 + reg = <0x00000000 0x4000000>;
56 + mdio-gpio0 = &mdio0;
60 + stdout-path = "uart0:19200n8";
64 + compatible = "gpio-keys";
65 + #address-cells = <1>;
68 + debounce_interval = <50>;
70 + linux,code = <KEY_ESC>;
72 + gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
77 + compatible = "gpio-leds";
79 + label = "dns313:blue:power";
80 + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
81 + default-state = "on";
82 + linux,default-trigger = "heartbeat";
85 + label = "dns313:blue:disk";
86 + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
87 + default-state = "off";
90 + label = "dns313:green:disk";
91 + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
92 + default-state = "off";
93 + linux,default-trigger = "ide-disk";
94 + /* Ideally should activate while reading */
97 + label = "dns313:red:disk";
98 + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
99 + default-state = "off";
100 + /* Ideally should activate while writing */
105 + * This is a ADDA AD0405GB-G73 fan @3000 and 6000 RPM.
108 + compatible = "gpio-fan";
109 + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
110 + <&gpio0 12 GPIO_ACTIVE_HIGH>;
111 + gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
112 + cooling-min-level = <0>;
113 + cooling-max-level = <2>;
114 + #cooling-cells = <2>;
118 + /* Global Mixed-Mode Technology G751 mounted on GPIO I2C */
120 + compatible = "i2c-gpio";
121 + sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
122 + scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
123 + #address-cells = <1>;
126 + g751: temperature-sensor@48 {
127 + compatible = "gmt,g751";
129 + #thermal-sensor-cells = <0>;
135 + /* Poll every 20 seconds */
136 + polling-delay = <20000>;
137 + /* Poll every 2nd second when cooling */
138 + polling-delay-passive = <2000>;
140 + thermal-sensors = <&g751>;
142 + /* Tripping points from the fan.script in the rootfs */
144 + chassis_alert0: chassis-alert0 {
145 + /* At 43 degrees turn on low speed */
146 + temperature = <43000>;
147 + hysteresis = <3000>;
150 + chassis_alert1: chassis-alert1 {
151 + /* At 47 degrees turn on high speed */
152 + temperature = <47000>;
153 + hysteresis = <3000>;
156 + chassis_crit: chassis-crit {
157 + /* Just shut down at 60 degrees */
158 + temperature = <60000>;
159 + hysteresis = <2000>;
166 + trip = <&chassis_alert0>;
167 + cooling-device = <&fan0 1 1>;
170 + trip = <&chassis_alert1>;
171 + cooling-device = <&fan0 2 2>;
177 + mdio0: ethernet-phy {
178 + compatible = "virtual,mdio-gpio";
179 + /* Uses MDC and MDIO */
180 + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
181 + <&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
182 + #address-cells = <1>;
185 + /* This is a Realtek RTL8211B Gigabit ethernet transceiver */
186 + phy0: ethernet-phy@1 {
188 + device_type = "ethernet-phy";
195 + /* 512KB of flash */
196 + reg = <0x30000000 0x00080000>;
199 + * This "RedBoot" is the Storlink derivative.
203 + reg = <0x00000000 0x00040000>;
208 + reg = <0x00040000 0x00020000>;
213 + reg = <0x00060000 0x00020000>;
218 + syscon: syscon@40000000 {
222 + gpio0_default_pins: pinctrl-gpio0 {
224 + function = "gpio0";
226 + /* Used by LEDs conflicts ICE */
228 + /* Used by ? conflicts ICE */
231 + * Used by fan & G751, conflicts LPC,
232 + * UART modem lines, SSP
241 + gpio1_default_pins: pinctrl-gpio1 {
243 + function = "gpio1";
244 + /* Used by "reset" button */
245 + groups = "gpio1dgrp";
251 + sata: sata@46000000 {
252 + /* The ROM uses this muxmode */
253 + cortina,gemini-ata-muxmode = <3>;
254 + cortina,gemini-enable-sata-bridge;
258 + gpio0: gpio@4d000000 {
259 + pinctrl-names = "default";
260 + pinctrl-0 = <&gpio0_default_pins>;
263 + gpio1: gpio@4e000000 {
264 + pinctrl-names = "default";
265 + pinctrl-0 = <&gpio1_default_pins>;