tools/zstd: enable position independent code compilation
[openwrt/openwrt.git] / target / linux / oxnas / files / arch / arm / boot / dts / ox820-shuttle-kd20.dts
index 1984e446b263fdf4e24e8d1513eea7905e43db88..2cff439c25964faccf135e4e12a8616906e6018c 100644 (file)
@@ -2,7 +2,9 @@
 
 #include "ox820.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        model = "Shuttle KD20";
                serial0 = &uart0;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
+               led-boot = &led_status;
+               led-failsafe = &led_warn;
+               led-running = &led_status;
+               led-upgrade = &led_warn;
+       };
+
+       thermal-zones {
+               chassis-thermal {
+                       /* Poll every 20 seconds */
+                       polling-delay = <20000>;
+                       /* Poll every 2nd second when cooling */
+                       polling-delay-passive = <2000>;
+
+                       thermal-sensors = <&hdd0_temp>, <&hdd1_temp>;
+
+                       trips {
+                               chassis_alert0: chassis-alert0 {
+                                       /* At 43 degrees turn on fan */
+                                       temperature = <43000>;
+                                       hysteresis = <3000>;
+                                       type = "active";
+                               };
+
+                               chassis_alert1: chassis-alert1 {
+                                       /* At 60 degrees emergency shutdown */
+                                       temperature = <60000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&chassis_alert0>;
+                                       cooling-device = <&system_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
        };
 
        i2c-gpio {
                compatible = "i2c-gpio";
-               gpios = <&gpio1 9 0 &gpio1 10 0>;
+               sda-gpios = <&gpio1 9 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+               sck-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
                i2c-gpio,delay-us = <10>;
                #address-cells = <1>;
                #size-cells = <0>;
+
                rtc0: rtc@51 {
                        compatible = "nxp,pcf8563";
                        reg = <0x51>;
 
                power {
                        label = "power";
-                       gpios = <&gpio0 10 1>;
+                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                };
                reset {
                        label = "reset";
-                       gpios = <&gpio0 11 1>;
+                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
                eject1 {
                        label = "eject1";
-                       gpios = <&gpio0 5 1>;
+                       gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_EJECTCD>;
                };
                eject2 {
                        label = "eject2";
-                       gpios = <&gpio0 6 1>;
+                       gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
                        linux,code = <162>;
                };
        };
 
        leds {
                compatible = "gpio-leds";
-               status {
+               led_status: status {
                        label = "kd20:blue:status";
-                       gpios = <&gpio1 16 0>;
+                       gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
                };
-               status2 {
+               led_warn: status2 {
                        label = "kd20:red:status";
-                       gpios = <&gpio1 17 0>;
+                       gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
                };
                hdd1blue {
                        label = "kd20:blue:hdd1";
-                       gpios = <&gpio0 27 0>;
+                       gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "ata1";
                };
                hdd1red {
                        label = "kd20:red:hdd1";
-                       gpios = <&gpio1 4 0>;
+                       gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                };
                hdd2blue {
                        label = "kd20:blue:hdd2";
-                       gpios = <&gpio1 6 0>;
+                       gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "ata2";
                };
                hdd2red {
                        label = "kd20:red:hdd2";
-                       gpios = <&gpio1 7 0>;
+                       gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
                };
                usb {
                        label = "kd20:blue:usb";
-                       gpios = <&gpio1 8 0>;
+                       gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
                        trigger-sources = <&ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
        beeper: beeper {
                compatible = "gpio-beeper";
-               gpios = <&gpio1 11 0>;
+               gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
        };
 
-       gpio-fan {
+       system_fan: gpio-fan {
                compatible = "gpio-fan";
-               gpios = <&gpio0 2 1>;
+               gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
                gpio-fan,speed-map = <0    0
                                      3000 1>;
+               #cooling-cells = <2>;
        };
 
        gpio-poweroff {
                compatible = "gpio-poweroff";
-               gpios = <&gpio0 9 0>;
+               gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
        };
 };
 
 &sata {
        status = "okay";
        nr-ports = <2>;
+
+       hdd0_temp: sata-port@0 {
+               reg = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
+       hdd1_temp: sata-port@1 {
+               reg = <1>;
+               #thermal-sensor-cells = <0>;
+       };
+};
+
+&pcie_phy {
+       status = "okay";
 };
 
 &pcie0 {