ramips: mt7628: use nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7628an_wavlink_wl-wn578a2.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-wn578a2", "mediatek,mt7628an-soc";
10 model = "Wavlink WL-WN578A2";
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 = "green:wifi-high";
54 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
55 };
56
57 wifi-med {
58 label = "green:wifi-med";
59 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
60 };
61
62 wifi-low {
63 label = "green:wifi-low";
64 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
65 };
66
67 lan {
68 label = "green:lan";
69 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
70 };
71
72 wan {
73 label = "green:wan";
74 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
75 };
76
77 led_wps: wps {
78 label = "green:wps";
79 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
80 };
81 };
82 };
83
84 &state_default {
85 gpio {
86 groups = "i2c", "wdt", "wled_an", "p0led_an", "p1led_an",
87 "p2led_an", "p3led_an", "p4led_an", "refclk", "gpio";
88 function = "gpio";
89 };
90 };
91
92 &pcie {
93 status = "okay";
94 };
95
96 &pcie0 {
97 wifi@0,0 {
98 reg = <0x0000 0 0 0 0>;
99 nvmem-cells = <&eeprom_factory_8000>;
100 nvmem-cell-names = "eeprom";
101 ieee80211-freq-limit = <5000000 6000000>;
102 };
103 };
104
105 &spi0 {
106 status = "okay";
107
108 flash@0 {
109 compatible = "jedec,spi-nor";
110 reg = <0>;
111 spi-max-frequency = <40000000>;
112
113 partitions {
114 compatible = "fixed-partitions";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 partition@0 {
119 label = "u-boot";
120 reg = <0x0 0x30000>;
121 read-only;
122 };
123
124 partition@30000 {
125 label = "u-boot-env";
126 reg = <0x30000 0x10000>;
127 read-only;
128 };
129
130 factory: partition@40000 {
131 label = "factory";
132 reg = <0x40000 0x10000>;
133 read-only;
134
135 nvmem-layout {
136 compatible = "fixed-layout";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 eeprom_factory_0: eeprom@0 {
141 reg = <0x0 0x400>;
142 };
143
144 eeprom_factory_8000: eeprom@8000 {
145 reg = <0x8000 0x200>;
146 };
147
148 macaddr_factory_28: macaddr@28 {
149 reg = <0x28 0x6>;
150 };
151 };
152 };
153
154 partition@50000 {
155 compatible = "denx,uimage";
156 label = "firmware";
157 reg = <0x50000 0x7b0000>;
158 };
159 };
160 };
161 };
162
163 &wmac {
164 status = "okay";
165
166 nvmem-cells = <&eeprom_factory_0>;
167 nvmem-cell-names = "eeprom";
168 };
169
170 &ethernet {
171 nvmem-cells = <&macaddr_factory_28>;
172 nvmem-cell-names = "mac-address";
173 };
174
175 &esw {
176 mediatek,portmap = <0x2f>;
177 };
178
179 &usbphy {
180 status = "disabled";
181 };
182
183 &ehci {
184 status = "disabled";
185 };
186
187 &ohci {
188 status = "disabled";
189 };