ramips: mt7628: use nvmem-layout
[openwrt/staging/hauke.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 nvmem-cells = <&eeprom_factory_8000>;
105 nvmem-cell-names = "eeprom";
106 ieee80211-freq-limit = <5000000 6000000>;
107 };
108 };
109
110 &spi0 {
111 status = "okay";
112
113 flash@0 {
114 compatible = "jedec,spi-nor";
115 reg = <0>;
116 spi-max-frequency = <40000000>;
117
118 partitions {
119 compatible = "fixed-partitions";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 partition@0 {
124 label = "u-boot";
125 reg = <0x0 0x30000>;
126 read-only;
127 };
128
129 partition@30000 {
130 label = "u-boot-env";
131 reg = <0x30000 0x10000>;
132 read-only;
133 };
134
135 factory: partition@40000 {
136 label = "factory";
137 reg = <0x40000 0x10000>;
138 read-only;
139
140 nvmem-layout {
141 compatible = "fixed-layout";
142 #address-cells = <1>;
143 #size-cells = <1>;
144
145 eeprom_factory_0: eeprom@0 {
146 reg = <0x0 0x400>;
147 };
148
149 eeprom_factory_8000: eeprom@8000 {
150 reg = <0x8000 0x200>;
151 };
152
153 macaddr_factory_28: macaddr@28 {
154 reg = <0x28 0x6>;
155 };
156 };
157 };
158
159 partition@50000 {
160 compatible = "denx,uimage";
161 label = "firmware";
162 reg = <0x50000 0x7b0000>;
163 };
164 };
165 };
166 };
167
168 &wmac {
169 status = "okay";
170
171 nvmem-cells = <&eeprom_factory_0>;
172 nvmem-cell-names = "eeprom";
173 };
174
175 &ethernet {
176 nvmem-cells = <&macaddr_factory_28>;
177 nvmem-cells-names = "max-address";
178 };
179
180 &esw {
181 mediatek,portmap = <0x3f>;
182 };
183
184 &usbphy {
185 status = "disabled";
186 };
187
188 &ehci {
189 status = "disabled";
190 };
191
192 &ohci {
193 status = "disabled";
194 };