0013-ARM-dts-Add-basic-devicetree-for-D-Link-DNS-313.patch 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. From 2f08de94f207a4347053e1faa22c9a310c9c61b0 Mon Sep 17 00:00:00 2001
  2. From: Linus Walleij <[email protected]>
  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
  5. This adds a basic device tree for the D-Link DNS-313
  6. NAS enclosure. This device has a thermal sensor and a
  7. fan so we add a thermal zone for the chassis in the
  8. device tree based on information from the product.
  9. Reviewed-by: Andrew Lunn <[email protected]>
  10. Signed-off-by: Linus Walleij <[email protected]>
  11. ---
  12. arch/arm/boot/dts/Makefile | 1 +
  13. arch/arm/boot/dts/gemini-dlink-dns-313.dts | 241 +++++++++++++++++++++++++++++
  14. 2 files changed, 242 insertions(+)
  15. create mode 100644 arch/arm/boot/dts/gemini-dlink-dns-313.dts
  16. --- a/arch/arm/boot/dts/Makefile
  17. +++ b/arch/arm/boot/dts/Makefile
  18. @@ -185,6 +185,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
  19. exynos5800-peach-pi.dtb
  20. dtb-$(CONFIG_ARCH_GEMINI) += \
  21. gemini-dlink-dir-685.dtb \
  22. + gemini-dlink-dns-313.dtb \
  23. gemini-nas4220b.dtb \
  24. gemini-rut1xx.dtb \
  25. gemini-sq201.dtb \
  26. --- /dev/null
  27. +++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
  28. @@ -0,0 +1,241 @@
  29. +// SPDX-License-Identifier: GPL-2.0
  30. +/*
  31. + * Device Tree file for D-Link DNS-313 1-Bay Network Storage Enclosure
  32. + */
  33. +
  34. +/dts-v1/;
  35. +
  36. +#include "gemini.dtsi"
  37. +#include <dt-bindings/input/input.h>
  38. +#include <dt-bindings/thermal/thermal.h>
  39. +
  40. +/ {
  41. + model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
  42. + compatible = "dlink,dir-313", "cortina,gemini";
  43. + #address-cells = <1>;
  44. + #size-cells = <1>;
  45. +
  46. + memory {
  47. + /* 64 MB SDRAM in a Nanya NT5DS32M16BS-6K package */
  48. + device_type = "memory";
  49. + reg = <0x00000000 0x4000000>;
  50. + };
  51. +
  52. + aliases {
  53. + mdio-gpio0 = &mdio0;
  54. + };
  55. +
  56. + chosen {
  57. + stdout-path = "uart0:19200n8";
  58. + };
  59. +
  60. + gpio_keys {
  61. + compatible = "gpio-keys";
  62. + #address-cells = <1>;
  63. + #size-cells = <0>;
  64. + button-esc {
  65. + debounce_interval = <50>;
  66. + wakeup-source;
  67. + linux,code = <KEY_ESC>;
  68. + label = "reset";
  69. + gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
  70. + };
  71. + };
  72. +
  73. + leds {
  74. + compatible = "gpio-leds";
  75. + led-power {
  76. + label = "dns313:blue:power";
  77. + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
  78. + default-state = "on";
  79. + linux,default-trigger = "heartbeat";
  80. + };
  81. + led-disk-blue {
  82. + label = "dns313:blue:disk";
  83. + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
  84. + default-state = "off";
  85. + };
  86. + led-disk-green {
  87. + label = "dns313:green:disk";
  88. + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
  89. + default-state = "off";
  90. + linux,default-trigger = "ide-disk";
  91. + /* Ideally should activate while reading */
  92. + };
  93. + led-disk-red {
  94. + label = "dns313:red:disk";
  95. + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
  96. + default-state = "off";
  97. + /* Ideally should activate while writing */
  98. + };
  99. + };
  100. +
  101. + /*
  102. + * This is a ADDA AD0405GB-G73 fan @3000 and 6000 RPM.
  103. + */
  104. + fan0: gpio-fan {
  105. + compatible = "gpio-fan";
  106. + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
  107. + <&gpio0 12 GPIO_ACTIVE_HIGH>;
  108. + gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
  109. + cooling-min-level = <0>;
  110. + cooling-max-level = <2>;
  111. + #cooling-cells = <2>;
  112. + };
  113. +
  114. +
  115. + /* Global Mixed-Mode Technology G751 mounted on GPIO I2C */
  116. + gpio-i2c {
  117. + compatible = "i2c-gpio";
  118. + sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  119. + scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  120. + #address-cells = <1>;
  121. + #size-cells = <0>;
  122. +
  123. + g751: temperature-sensor@48 {
  124. + compatible = "gmt,g751";
  125. + reg = <0x48>;
  126. + #thermal-sensor-cells = <0>;
  127. + };
  128. + };
  129. +
  130. + thermal-zones {
  131. + chassis-thermal {
  132. + /* Poll every 20 seconds */
  133. + polling-delay = <20000>;
  134. + /* Poll every 2nd second when cooling */
  135. + polling-delay-passive = <2000>;
  136. +
  137. + thermal-sensors = <&g751>;
  138. +
  139. + /* Tripping points from the fan.script in the rootfs */
  140. + trips {
  141. + chassis_alert0: chassis-alert0 {
  142. + /* At 43 degrees turn on low speed */
  143. + temperature = <43000>;
  144. + hysteresis = <3000>;
  145. + type = "active";
  146. + };
  147. + chassis_alert1: chassis-alert1 {
  148. + /* At 47 degrees turn on high speed */
  149. + temperature = <47000>;
  150. + hysteresis = <3000>;
  151. + type = "active";
  152. + };
  153. + chassis_crit: chassis-crit {
  154. + /* Just shut down at 60 degrees */
  155. + temperature = <60000>;
  156. + hysteresis = <2000>;
  157. + type = "critical";
  158. + };
  159. + };
  160. +
  161. + cooling-maps {
  162. + map0 {
  163. + trip = <&chassis_alert0>;
  164. + cooling-device = <&fan0 1 1>;
  165. + };
  166. + map1 {
  167. + trip = <&chassis_alert1>;
  168. + cooling-device = <&fan0 2 2>;
  169. + };
  170. + };
  171. + };
  172. + };
  173. +
  174. + mdio0: ethernet-phy {
  175. + compatible = "virtual,mdio-gpio";
  176. + /* Uses MDC and MDIO */
  177. + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
  178. + <&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
  179. + #address-cells = <1>;
  180. + #size-cells = <0>;
  181. +
  182. + /* This is a Realtek RTL8211B Gigabit ethernet transceiver */
  183. + phy0: ethernet-phy@1 {
  184. + reg = <1>;
  185. + device_type = "ethernet-phy";
  186. + };
  187. + };
  188. +
  189. + soc {
  190. + flash@30000000 {
  191. + status = "okay";
  192. + /* 512KB of flash */
  193. + reg = <0x30000000 0x00080000>;
  194. +
  195. + /*
  196. + * This "RedBoot" is the Storlink derivative.
  197. + */
  198. + partition@0 {
  199. + label = "RedBoot";
  200. + reg = <0x00000000 0x00040000>;
  201. + read-only;
  202. + };
  203. + partition@40000 {
  204. + label = "MTD1";
  205. + reg = <0x00040000 0x00020000>;
  206. + read-only;
  207. + };
  208. + partition@60000 {
  209. + label = "MTD2";
  210. + reg = <0x00060000 0x00020000>;
  211. + read-only;
  212. + };
  213. + };
  214. +
  215. + syscon: syscon@40000000 {
  216. + pinctrl {
  217. + /*
  218. + */
  219. + gpio0_default_pins: pinctrl-gpio0 {
  220. + mux {
  221. + function = "gpio0";
  222. + groups =
  223. + /* Used by LEDs conflicts ICE */
  224. + "gpio0bgrp",
  225. + /* Used by ? conflicts ICE */
  226. + "gpio0cgrp",
  227. + /*
  228. + * Used by fan & G751, conflicts LPC,
  229. + * UART modem lines, SSP
  230. + */
  231. + "gpio0egrp",
  232. + /* Used by G751 */
  233. + "gpio0fgrp",
  234. + /* Used by MDIO */
  235. + "gpio0igrp";
  236. + };
  237. + };
  238. + gpio1_default_pins: pinctrl-gpio1 {
  239. + mux {
  240. + function = "gpio1";
  241. + /* Used by "reset" button */
  242. + groups = "gpio1dgrp";
  243. + };
  244. + };
  245. + };
  246. + };
  247. +
  248. + sata: sata@46000000 {
  249. + /* The ROM uses this muxmode */
  250. + cortina,gemini-ata-muxmode = <3>;
  251. + cortina,gemini-enable-sata-bridge;
  252. + status = "okay";
  253. + };
  254. +
  255. + gpio0: gpio@4d000000 {
  256. + pinctrl-names = "default";
  257. + pinctrl-0 = <&gpio0_default_pins>;
  258. + };
  259. +
  260. + gpio1: gpio@4e000000 {
  261. + pinctrl-names = "default";
  262. + pinctrl-0 = <&gpio1_default_pins>;
  263. + };
  264. +
  265. + ata@63000000 {
  266. + status = "okay";
  267. + };
  268. + };
  269. +};