oxnas: some improvements for Shuttle KD20
[openwrt/openwrt.git] / target / linux / oxnas / files / arch / arm / boot / dts / ox820-shuttle-kd20.dts
1 /dts-v1/;
2
3 #include "ox820.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/thermal/thermal.h>
8
9 / {
10 model = "Shuttle KD20";
11
12 compatible = "shuttle,kd20", "oxsemi,ox820";
13
14 chosen {
15 bootargs = "earlyprintk console=ttyS0,115200";
16 stdout-path = "serial0:115200n8";
17 };
18
19 memory {
20 /* 256Mbytes DDR */
21 reg = <0x60000000 0x10000000>;
22 };
23
24 aliases {
25 serial0 = &uart0;
26 gpio0 = &gpio0;
27 gpio1 = &gpio1;
28 led-boot = &led_status;
29 led-failsafe = &led_warn;
30 led-running = &led_status;
31 led-upgrade = &led_warn;
32 };
33
34 thermal_zones {
35 chassis-thermal {
36 /* Poll every 20 seconds */
37 polling-delay = <20000>;
38 /* Poll every 2nd second when cooling */
39 polling-delay-passive = <2000>;
40
41 thermal-sensors = <&hdd0_temp>, <&hdd1_temp>;
42
43 trips {
44 chassis_alert0: chassis-alert0 {
45 /* At 43 degrees turn on fan */
46 temperature = <43000>;
47 hysteresis = <3000>;
48 type = "active";
49 };
50
51 chassis_alert1: chassis-alert1 {
52 /* At 60 degrees emergency shutdown */
53 temperature = <60000>;
54 hysteresis = <2000>;
55 type = "critical";
56 };
57 };
58
59 cooling-maps {
60 map0 {
61 trip = <&chassis_alert0>;
62 cooling-device = <&system_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
63 };
64 };
65 };
66 };
67
68 i2c-gpio {
69 compatible = "i2c-gpio";
70 sda-gpios = <&gpio1 9 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
71 sck-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
72 i2c-gpio,delay-us = <10>;
73 #address-cells = <1>;
74 #size-cells = <0>;
75
76 rtc0: rtc@51 {
77 compatible = "nxp,pcf8563";
78 reg = <0x51>;
79 };
80 };
81
82 keys {
83 compatible = "gpio-keys-polled";
84 #address-cells = <1>;
85 #size-cells = <0>;
86 poll-interval = <100>;
87
88 power {
89 label = "power";
90 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
91 linux,code = <KEY_POWER>;
92 };
93 reset {
94 label = "reset";
95 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
96 linux,code = <KEY_RESTART>;
97 };
98 eject1 {
99 label = "eject1";
100 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
101 linux,code = <KEY_EJECTCD>;
102 };
103 eject2 {
104 label = "eject2";
105 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
106 linux,code = <162>;
107 };
108 };
109
110 leds {
111 compatible = "gpio-leds";
112 led_status: status {
113 label = "kd20:blue:status";
114 gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
115 };
116 led_warn: status2 {
117 label = "kd20:red:status";
118 gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
119 };
120 hdd1blue {
121 label = "kd20:blue:hdd1";
122 gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
123 linux,default-trigger = "ata1";
124 };
125 hdd1red {
126 label = "kd20:red:hdd1";
127 gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
128 };
129 hdd2blue {
130 label = "kd20:blue:hdd2";
131 gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
132 linux,default-trigger = "ata2";
133 };
134 hdd2red {
135 label = "kd20:red:hdd2";
136 gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
137 };
138 usb {
139 label = "kd20:blue:usb";
140 gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
141 trigger-sources = <&ehci_port1>, <&ehci_port2>;
142 linux,default-trigger = "usbport";
143 };
144 };
145
146 beeper: beeper {
147 compatible = "gpio-beeper";
148 gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
149 };
150
151 system_fan: gpio-fan {
152 compatible = "gpio-fan";
153 gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
154 gpio-fan,speed-map = <0 0
155 3000 1>;
156 };
157
158 gpio-poweroff {
159 compatible = "gpio-poweroff";
160 gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
161 };
162 };
163
164 &uart0 {
165 status = "okay";
166
167 pinctrl-names = "default";
168 pinctrl-0 = <&pinctrl_uart0>;
169 };
170
171 &nandc {
172 status = "okay";
173
174 pinctrl-names = "default";
175 pinctrl-0 = <&pinctrl_nand>;
176
177 nand@0 {
178 reg = <0>;
179 #address-cells = <1>;
180 #size-cells = <1>;
181 nand-ecc-mode = "soft";
182 nand-ecc-algo = "hamming";
183
184 partition@0 {
185 label = "stage1";
186 reg = <0x00000000 0x00040000>;
187 read-only;
188 };
189
190 partition@40000 {
191 label = "u-boot";
192 reg = <0x00040000 0x001e0000>;
193 read-only;
194 };
195
196 partition@220000 {
197 label = "u-boot-env";
198 reg = <0x00220000 0x00020000>;
199 };
200
201 partition@240000 {
202 label = "initrd";
203 reg = <0x00240000 0x00600000>;
204 };
205
206 partition@840000 {
207 label = "kernel";
208 reg = <0x00840000 0x007C0000>;
209 };
210
211 partition@e00000 {
212 label = "ubi";
213 reg = <0x01000000 0x07000000>;
214 };
215 };
216 };
217
218 &etha {
219 status = "okay";
220
221 pinctrl-names = "default";
222 pinctrl-0 = <&pinctrl_etha_mdio>;
223 };
224
225 &ehci {
226 status = "okay";
227 };
228
229 &sata {
230 status = "okay";
231 nr-ports = <2>;
232
233 hdd0_temp: sata-port@0 {
234 reg = <0>;
235 #thermal-sensor-cells = <0>;
236 };
237
238 hdd1_temp: sata-port@1 {
239 reg = <1>;
240 #thermal-sensor-cells = <0>;
241 };
242 };
243
244 &pcie_phy {
245 status = "okay";
246 };
247
248 &pcie0 {
249 status = "okay";
250 };