ramips: add support for indicating the boot state using multiple leds
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / D240.dts
index ef45d38e619f258cf36fdc413366125952db2fd7..134ebdda559b6e8d2784f52c9dad317a857554b5 100644 (file)
 #include <dt-bindings/input/input.h>
 
 / {
-       compatible = "d240", "ralink,mt7620a-soc";
+       compatible = "sanlinking,d240", "ralink,mt7620a-soc";
        model = "Sanlinking Technologies D240";
 
+       aliases {
+               led-boot = &led_power;
+               led-failsafe = &led_power;
+               led-running = &led_power;
+               led-upgrade = &led_power;
+       };
+
        chosen {
                bootargs = "console=ttyS0,115200";
        };
 
+       gpio-export {
+               compatible = "gpio-export";
+               #size-cells = <0>;
+
+               power_mpcie2 {
+                       gpio-export,name = "power_mpcie2";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
+               };
+
+               power_mpcie1 {
+                       gpio-export,name = "power_mpcie1";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
        gpio-leds {
                compatible = "gpio-leds";
 
-               power {
+               led_power: power {
                        label = "d240:blue:power";
                        gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
                };
@@ -57,6 +81,8 @@
                usb {
                        label = "d240:blue:usb";
                        gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&ohci_port1>, <&ehci_port1>;
+                       linux,default-trigger = "usbport";
                };
 
                air {
@@ -67,8 +93,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <20>;
 
                reset {
        status = "okay";
 };
 
+&gpio2 {
+       status = "okay";
+};
+
 &gpio3 {
        status = "okay";
 };
        status = "okay";
 
        en25q128@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
 
-               partition@0 {
-                       label = "u-boot";
-                       reg = <0x0 0x30000>;
-                       read-only;
-               };
-
-               partition@30000 {
-                       label = "u-boot-env";
-                       reg = <0x30000 0x10000>;
-                       read-only;
-               };
-
-               factory: partition@40000 {
-                       label = "factory";
-                       reg = <0x40000 0x10000>;
-                       read-only;
-               };
-
-               partition@50000 {
-                       label = "firmware";
-                       reg = <0x50000 0xfb0000>;
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@50000 {
+                               label = "firmware";
+                               reg = <0x50000 0xfb0000>;
+                       };
                };
        };
 };