ramips: set usb led trigger via devicetree
[openwrt/openwrt.git] / target / linux / ramips / dts / ki_rb.dts
1 /dts-v1/;
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "zyxel,keenetic-extra-ii", "mediatek,mt7628an-soc";
10 model = "ZyXEL Keenetic Extra II";
11
12 aliases {
13 led-status = &led_power;
14 };
15
16 memory@0 {
17 device_type = "memory";
18 reg = <0x0 0x8000000>;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,57600n8";
23 };
24
25 gpio-keys-polled {
26 compatible = "gpio-keys-polled";
27 poll-interval = <20>;
28
29 reset {
30 label = "reset";
31 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 };
34
35 wps {
36 label = "wps";
37 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
38 linux,code = <KEY_WPS_BUTTON>;
39 };
40
41 fn {
42 label = "fn";
43 gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
44 linux,code = <BTN_0>;
45 };
46 };
47
48 gpio-leds {
49 compatible = "gpio-leds";
50
51 led_power: power {
52 label = "keenetic-extra-ii:green:power";
53 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
54 default-state = "keep";
55 };
56
57 internet {
58 label = "keenetic-extra-ii:green:internet";
59 gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
60 };
61
62 wifi {
63 label = "keenetic-extra-ii:green:wifi";
64 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
65 };
66
67 usb {
68 label = "keenetic-extra-ii:green:usb";
69 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
70 trigger-sources = <&ohci_port1>, <&ehci_port1>;
71 linux,default-trigger = "usbport";
72 };
73 };
74
75 gpio_export {
76 compatible = "gpio-export";
77 #size-cells = <0>;
78
79 usbpower {
80 gpio-export,name = "usbpower";
81 gpio-export,output = <1>;
82 gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
83 };
84 };
85 };
86
87 &spi0 {
88 status = "okay";
89
90 m25p80@0 {
91 compatible = "jedec,spi-nor";
92 reg = <0>;
93 spi-max-frequency = <10000000>;
94 m25p,chunked-io = <32>;
95
96 partitions {
97 compatible = "fixed-partitions";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 partition@0 {
102 label = "u-boot";
103 reg = <0x0 0x30000>;
104 read-only;
105 };
106
107 partition@30000 {
108 label = "u-config";
109 reg = <0x30000 0x10000>;
110 read-only;
111 };
112
113 factory: partition@40000 {
114 label = "rf-eeprom";
115 reg = <0x40000 0x10000>;
116 read-only;
117 };
118
119 partition@50000 {
120 label = "firmware";
121 reg = <0x50000 0xe90000>;
122 };
123
124 partition@ee0000 {
125 label = "config_1";
126 reg = <0xee0000 0x10000>;
127 read-only;
128 };
129
130 partition@ef0000 {
131 label = "storage";
132 reg = <0xef0000 0x100000>;
133 read-only;
134 };
135
136 partition@ff0000 {
137 label = "dump";
138 reg = <0xff0000 0x10000>;
139 read-only;
140 };
141
142 partition@1000000 {
143 label = "u-state";
144 reg = <0x1000000 0x30000>;
145 read-only;
146 };
147
148 partition@1030000 {
149 label = "u-config_res";
150 reg = <0x1030000 0x10000>;
151 read-only;
152 };
153
154 partition@1040000 {
155 label = "rf-eeprom_res";
156 reg = <0x1040000 0x10000>;
157 read-only;
158 };
159
160 partition@1050000 {
161 label = "firmware_2";
162 reg = <0x1050000 0xe90000>;
163 read-only;
164 };
165
166 partition@1ee0000 {
167 label = "config_2";
168 reg = <0x1ee0000 0x10000>;
169 read-only;
170 };
171 };
172 };
173 };
174
175 &ehci {
176 status = "okay";
177 };
178
179 &ohci {
180 status = "okay";
181 };
182
183 &ethernet {
184 mtd-mac-address = <&factory 0x4>;
185 mediatek,portmap = "wllll";
186 };
187
188 &wmac {
189 status = "okay";
190 mediatek,mtd-eeprom = <&factory 0x0>;
191 };
192
193 &pcie {
194 status = "okay";
195 };
196
197 &pcie0 {
198 mt76@0,0 {
199 reg = <0x0000 0 0 0 0>;
200 mediatek,mtd-eeprom = <&factory 0x8000>;
201 ieee80211-freq-limit = <5000000 6000000>;
202 mtd-mac-address = <&factory 0x8004>;
203 };
204 };
205
206 &pinctrl {
207 state_default: pinctrl0 {
208 gpio {
209 ralink,group = "gpio", "i2s", "refclk", "spi cs1", "uart1", "wled_an";
210 ralink,function = "gpio";
211 };
212 };
213 };