ramips: fix EEPROM size for I-O DATA WN-DEAX1800GR
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_rexx0-v1.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 label-mac-device = &gmac0;
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 wps {
21 label = "wps";
22 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
23 debounce-interval = <60>;
24 linux,code = <KEY_WPS_BUTTON>;
25 };
26
27 power {
28 label = "power";
29 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
30 debounce-interval = <60>;
31 linux,code = <KEY_POWER>;
32 };
33
34 led {
35 label = "led";
36 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
37 debounce-interval = <60>;
38 linux,code = <KEY_LIGHTS_TOGGLE>;
39 };
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
44 debounce-interval = <60>;
45 linux,code = <KEY_RESTART>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 led_power: power {
53 label = "blue:power";
54 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
55 };
56
57 wifi2g {
58 label = "blue:wifi2g";
59 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy0tpt";
61 };
62
63 wifi5g {
64 label = "blue:wifi5g";
65 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
66 linux,default-trigger = "phy1tpt";
67 };
68
69 wps_red {
70 label = "red:wps";
71 gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
72 };
73
74 wps_blue {
75 label = "blue:wps";
76 gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
77 };
78
79 eth_act {
80 label = "green:eth_act";
81 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
82 };
83
84 eth_link {
85 label = "green:eth_link";
86 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
87 };
88 };
89 };
90
91 &spi0 {
92 status = "okay";
93
94 flash@0 {
95 compatible = "jedec,spi-nor";
96 reg = <0>;
97 spi-max-frequency = <40000000>;
98
99 partitions {
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "u-boot";
106 reg = <0x0 0x20000>;
107 read-only;
108 };
109
110 partition@20000 {
111 compatible = "tplink,firmware";
112 label = "firmware";
113 reg = <0x20000 0xde0000>;
114 };
115
116 config: partition@e00000 {
117 label = "config";
118 reg = <0xe00000 0x50000>;
119 read-only;
120 };
121
122 /* range 0xe50000 to 0xff0000 is empty in vendor
123 * firmware, so we do not use it either
124 */
125
126 radio: partition@ff0000 {
127 label = "radio";
128 reg = <0xff0000 0x10000>;
129 read-only;
130 };
131 };
132 };
133 };
134
135 &state_default {
136 gpio {
137 groups = "rgmii2", "wdt";
138 function = "gpio";
139 };
140 };
141
142 &pcie {
143 status = "okay";
144 };
145
146 &pcie0 {
147 wifi@0,0 {
148 compatible = "mediatek,mt76";
149 reg = <0x0000 0 0 0 0>;
150 mediatek,mtd-eeprom = <&radio 0x0>;
151 nvmem-cells = <&macaddr_config_10008>;
152 nvmem-cell-names = "mac-address";
153 mac-address-increment = <1>;
154 ieee80211-freq-limit = <2400000 2500000>;
155 };
156 };
157
158 &pcie1 {
159 wifi@0,0 {
160 compatible = "mediatek,mt76";
161 reg = <0x0000 0 0 0 0>;
162 mediatek,mtd-eeprom = <&radio 0x8000>;
163 nvmem-cells = <&macaddr_config_10008>;
164 nvmem-cell-names = "mac-address";
165 mac-address-increment = <2>;
166 ieee80211-freq-limit = <5000000 6000000>;
167 };
168 };
169
170 &ethernet {
171 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
172 };
173
174 &gmac0 {
175 nvmem-cells = <&macaddr_config_10008>;
176 nvmem-cell-names = "mac-address";
177 };
178
179 &switch0 {
180 ports {
181 port@0 {
182 status = "okay";
183 label = "lan";
184 };
185 };
186 };
187
188 &config {
189 compatible = "nvmem-cells";
190 #address-cells = <1>;
191 #size-cells = <1>;
192
193 macaddr_config_10008: macaddr@10008 {
194 reg = <0x10008 0x6>;
195 };
196 };