ramips: set usb led trigger via devicetree
[oweals/openwrt.git] / target / linux / ramips / dts / DIR-645.dts
1 /dts-v1/;
2
3 #include "rt3883.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "dlink,dir-645", "ralink,rt3883-soc";
10         model = "D-Link DIR-645";
11
12         aliases {
13                 led-status = &led_wps;
14         };
15
16         rtl8367b {
17                 compatible = "realtek,rtl8367b";
18                 gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
19                 gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
20                 realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
21         };
22
23         gpio-keys-polled {
24                 compatible = "gpio-keys-polled";
25                 poll-interval = <100>;
26
27                 reset {
28                         label = "reset";
29                         gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
30                         linux,code = <KEY_RESTART>;
31                 };
32
33                 wps {
34                         label = "wps";
35                         gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
36                         linux,code = <KEY_WPS_BUTTON>;
37                 };
38         };
39
40         gpio-leds {
41                 compatible = "gpio-leds";
42
43                 inet {
44                         label = "dir-645:green:inet";
45                         gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
46                 };
47
48                 led_wps: wps {
49                         label = "dir-645:green:wps";
50                         gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
51                 };
52         };
53
54         gpio_export {
55                 compatible = "gpio-export";
56                 #size-cells = <0>;
57
58                 usb {
59                         gpio-export,name = "usb";
60                         gpio-export,output = <1>;
61                         gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
62                 };
63         };
64 };
65
66 &gpio1 {
67         status = "okay";
68 };
69
70 &spi0 {
71         status = "okay";
72
73         m25p80@0 {
74                 compatible = "jedec,spi-nor";
75                 reg = <0>;
76                 spi-max-frequency = <25000000>;
77
78                 partitions {
79                         compatible = "fixed-partitions";
80                         #address-cells = <1>;
81                         #size-cells = <1>;
82
83                         partition@0 {
84                                 label = "uboot";
85                                 reg = <0x0 0x30000>;
86                                 read-only;
87                         };
88
89                         partition@30000 {
90                                 label = "uboot-env";
91                                 reg = <0x30000 0x4000>;
92                                 read-only;
93                         };
94
95                         factory: partition@34000 {
96                                 label = "factory";
97                                 reg = <0x34000 0x4000>;
98                                 read-only;
99                         };
100
101                         partition@38000 {
102                                 label = "nvram";
103                                 reg = <0x38000 0x8000>;
104                                 read-only;
105                         };
106
107                         partition@40000 {
108                                 label = "devdata";
109                                 reg = <0x40000 0x10000>;
110                         };
111
112                         partition@50000 {
113                                 label = "firmware";
114                                 reg = <0x50000 0x7b0000>;
115                         };
116                 };
117         };
118 };
119
120 &pinctrl {
121         state_default: pinctrl0 {
122                 gpio {
123                         ralink,group = "i2c", "jtag", "uartf";
124                         ralink,function = "gpio";
125                 };
126         };
127 };
128
129 &ethernet {
130         mtd-mac-address = <&factory 0x4>;
131
132         port@0 {
133                 mediatek,fixed-link = <1000 1 1 0>;
134         };
135 };
136
137 &wmac {
138         ralink,5ghz = <0>;
139         ralink,mtd-eeprom = <&factory 0>;
140 };
141
142 &ehci {
143         status = "okay";
144 };
145
146 &ohci {
147         status = "okay";
148 };