ramips: fix switch setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / rt3883_trendnet_tew-692gr.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 = "trendnet,tew-692gr", "ralink,rt3883-soc";
10         model = "TRENDnet TEW-692GR";
11
12         aliases {
13                 led-boot = &led_wps_green;
14                 led-failsafe = &led_wps_green;
15                 led-running = &led_wps_green;
16                 led-upgrade = &led_wps_green;
17         };
18
19         nor-flash@1c000000 {
20                 compatible = "cfi-flash";
21                 reg = <0x1c000000 0x800000>;
22                 bank-width = <2>;
23
24                 partitions {
25                         compatible = "fixed-partitions";
26                         #address-cells = <1>;
27                         #size-cells = <1>;
28
29                         partition@0 {
30                                 reg = <0x0 0x0030000>;
31                                 label = "u-boot";
32                                 read-only;
33                         };
34
35                         partition@30000 {
36                                 reg = <0x00030000 0x00010000>;
37                                 label = "u-boot-env";
38                                 read-only;
39                         };
40
41                         factory: partition@40000 {
42                                 reg = <0x00040000 0x00010000>;
43                                 label = "factory";
44                                 read-only;
45                         };
46
47                         partition@50000 {
48                                 compatible = "denx,uimage";
49                                 reg = <0x00050000 0x007b0000>;
50                                 label = "firmware";
51                         };
52                 };
53         };
54
55         keys {
56                 compatible = "gpio-keys-polled";
57                 poll-interval = <100>;
58
59                 reset {
60                         label = "reset";
61                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
62                         linux,code = <KEY_RESTART>;
63                 };
64
65                 wps {
66                         label = "wps";
67                         gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
68                         linux,code = <KEY_WPS_BUTTON>;
69                 };
70         };
71
72         leds {
73                 compatible = "gpio-leds";
74
75                 wps {
76                         label = "tew-692gr:orange:wps";
77                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
78                 };
79
80                 led_wps_green: wps2 {
81                         label = "tew-692gr:green:wps";
82                         gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
83                 };
84         };
85 };
86
87 &gpio1 {
88         status = "okay";
89 };
90
91 &state_default {
92         gpio {
93                 ralink,group = "spi", "i2c", "jtag", "uartf";
94                 ralink,function = "gpio";
95         };
96 };
97
98 &ethernet {
99         status = "okay";
100         mtd-mac-address = <&factory 0x4>;
101
102         port@0 {
103                 phy-handle = <&phy0>;
104                 phy-mode = "rgmii";
105         };
106
107         mdio-bus {
108                 status = "okay";
109
110                 phy0: ethernet-phy@0 {
111                         reg = <0>;
112                         phy-mode = "rgmii";
113
114                         qca,ar8327-initvals = <
115                                 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
116                                 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
117                                 0x10 0x40000000 /* Power-on Strapping: 176-pin interface configuration */
118                                 0x50 0xc437c437 /* LED Control Register 0 */
119                                 0x54 0xc337c337 /* LED Control Register 1 */
120                                 0x58 0x00000000 /* LED Control Register 2 */
121                                 0x5c 0x03ffff00 /* LED Control Register 3 */
122                                 0x7c 0x0000007e /* PORT0_STATUS */
123                                 0x94 0x0000007e /* PORT6 STATUS */
124                         >;
125                 };
126         };
127 };
128
129 &pci {
130         status = "okay";
131 };
132
133 &pci1 {
134         status = "okay";
135
136         wifi@0,0 {
137                 compatible = "pci0,0";
138                 reg = < 0x10000 0 0 0 0 >;
139                 ralink,2ghz = <0>;
140         };
141 };
142
143 &wmac {
144         status = "okay";
145         ralink,mtd-eeprom = <&factory 0x0>;
146         ralink,5ghz = <0>;
147         mtd-mac-address = <&factory 0x4>;
148         mtd-mac-address-increment = <3>;
149 };