ramips: add support for Wavlink WL-WN576A2
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7628an_wavlink_wl-wn576a2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "wavlink,wl-wn576a2", "mediatek,mt7628an-soc";
10 model = "Wavlink WL-WN576A2";
11
12 aliases {
13 led-boot = &led_wps;
14 led-failsafe = &led_wps;
15 led-running = &led_wps;
16 led-upgrade = &led_wps;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "reset";
24 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27
28 wps {
29 label = "wps";
30 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33
34 ap {
35 label = "ap";
36 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
37 linux,code = <BTN_0>;
38 linux,input-type = <EV_SW>;
39 };
40
41 repeater {
42 label = "repeater";
43 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
44 linux,code = <BTN_1>;
45 linux,input-type = <EV_SW>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 wifi-high {
53 label = "blue:wifi-high";
54 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
55 };
56
57 wifi-mediumhigh {
58 label = "blue:wifi-mediumhigh";
59 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
60 };
61
62 wifi-medium {
63 label = "blue:wifi-medium";
64 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
65 };
66
67 wifi-mediumlow {
68 label = "blue:wifi-mediumlow";
69 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
70 };
71
72 wifi-low {
73 label = "blue:wifi-low";
74 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
75 };
76
77 lan {
78 label = "blue:lan";
79 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
80 };
81
82 led_wps: wps {
83 label = "blue:wps";
84 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
85 };
86 };
87 };
88
89 &state_default {
90 gpio {
91 groups = "i2c", "i2s", "wdt", "wled_an", "p0led_an", "p1led_an",
92 "p2led_an", "p3led_an", "p4led_an", "refclk", "gpio";
93 function = "gpio";
94 };
95 };
96
97 &pcie {
98 status = "okay";
99 };
100
101 &pcie0 {
102 wifi@0,0 {
103 reg = <0x0000 0 0 0 0>;
104 mediatek,mtd-eeprom = <&factory 0x8000>;
105 ieee80211-freq-limit = <5000000 6000000>;
106 };
107 };
108
109 &spi0 {
110 status = "okay";
111
112 flash@0 {
113 compatible = "jedec,spi-nor";
114 reg = <0>;
115 spi-max-frequency = <40000000>;
116
117 partitions {
118 compatible = "fixed-partitions";
119 #address-cells = <1>;
120 #size-cells = <1>;
121
122 partition@0 {
123 label = "u-boot";
124 reg = <0x0 0x30000>;
125 read-only;
126 };
127
128 partition@30000 {
129 label = "u-boot-env";
130 reg = <0x30000 0x10000>;
131 read-only;
132 };
133
134 factory: partition@40000 {
135 label = "factory";
136 reg = <0x40000 0x10000>;
137 read-only;
138 };
139
140 partition@50000 {
141 compatible = "denx,uimage";
142 label = "firmware";
143 reg = <0x50000 0x7b0000>;
144 };
145 };
146 };
147 };
148
149 &wmac {
150 status = "okay";
151
152 mediatek,mtd-eeprom = <&factory 0x0>;
153 };
154
155 &ethernet {
156 nvmem-cells = <&macaddr_factory_28>;
157 nvmem-cells-names = "max-address";
158 };
159
160 &esw {
161 mediatek,portmap = <0x3f>;
162 };
163
164 &usbphy {
165 status = "disabled";
166 };
167
168 &ehci {
169 status = "disabled";
170 };
171
172 &ohci {
173 status = "disabled";
174 };
175
176 &factory {
177 compatible = "nvmem-cells";
178 #address-cells = <1>;
179 #size-cells = <1>;
180
181 macaddr_factory_28: macaddr@28 {
182 reg = <0x28 0x6>;
183 };
184 };