ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_elecom_wrc-2533ghbk.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wps {
21 label = "red:wps";
22 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
23 color = <LED_COLOR_ID_RED>;
24 function = LED_FUNCTION_WPS;
25 };
26
27 led_power: power {
28 label = "white:power";
29 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
30 color = <LED_COLOR_ID_WHITE>;
31 function = LED_FUNCTION_POWER;
32 };
33
34 wlan2g {
35 label = "white:wlan2g";
36 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
37 color = <LED_COLOR_ID_WHITE>;
38 function = LED_FUNCTION_WLAN;
39 function-enumerator = <1>;
40 linux,default-trigger = "phy0tpt";
41 };
42
43 wlan5g {
44 label = "white:wlan5g";
45 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
46 color = <LED_COLOR_ID_WHITE>;
47 function = LED_FUNCTION_WLAN;
48 function-enumerator = <2>;
49 linux,default-trigger = "phy1tpt";
50 };
51 };
52
53 keys {
54 compatible = "gpio-keys";
55
56 auto {
57 label = "auto";
58 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
59 linux,code = <BTN_0>;
60 linux,input-type = <EV_SW>;
61 };
62
63 reset {
64 label = "reset";
65 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
66 linux,code = <KEY_RESTART>;
67 };
68
69 wps {
70 label = "wps";
71 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
72 linux,code = <KEY_WPS_BUTTON>;
73 };
74 };
75 };
76
77 &spi0 {
78 status = "okay";
79
80 flash@0 {
81 compatible = "jedec,spi-nor";
82 reg = <0>;
83 spi-max-frequency = <40000000>;
84
85 partitions: partitions {
86 compatible = "fixed-partitions";
87 #address-cells = <1>;
88 #size-cells = <1>;
89
90 partition@0 {
91 label = "u-boot";
92 reg = <0x0 0x30000>;
93 read-only;
94 };
95
96 partition@30000 {
97 label = "u-boot-env";
98 reg = <0x30000 0x10000>;
99 read-only;
100 };
101
102 factory: partition@40000 {
103 compatible = "nvmem-cells";
104 label = "factory";
105 reg = <0x40000 0x10000>;
106 #address-cells = <1>;
107 #size-cells = <1>;
108 read-only;
109
110 eeprom_factory_0: eeprom@0 {
111 reg = <0x0 0x4da8>;
112 };
113
114 eeprom_factory_8000: eeprom@8000 {
115 reg = <0x8000 0x4da8>;
116 };
117 };
118 };
119 };
120 };
121
122 &gmac1 {
123 status = "okay";
124 label = "wan";
125 phy-handle = <&ethphy0>;
126 };
127
128 &mdio {
129 ethphy0: ethernet-phy@0 {
130 reg = <0>;
131 };
132 };
133
134 &switch0 {
135 ports {
136 port@1 {
137 status = "okay";
138 label = "lan4";
139 };
140
141 port@2 {
142 status = "okay";
143 label = "lan3";
144 };
145
146 port@3 {
147 status = "okay";
148 label = "lan2";
149 };
150
151 port@4 {
152 status = "okay";
153 label = "lan1";
154 };
155 };
156 };
157
158 &state_default {
159 gpio {
160 groups = "uart2", "uart3", "jtag", "wdt";
161 function = "gpio";
162 };
163 };
164
165 &pcie {
166 status = "okay";
167 };
168
169 &pcie0 {
170 wifi@0,0 {
171 compatible = "mediatek,mt76";
172 reg = <0x0000 0 0 0 0>;
173 nvmem-cells = <&eeprom_factory_0>;
174 nvmem-cell-names = "eeprom";
175 ieee80211-freq-limit = <2400000 2500000>;
176 };
177 };
178
179 &pcie1 {
180 wifi@0,0 {
181 compatible = "mediatek,mt76";
182 reg = <0x0000 0 0 0 0>;
183 nvmem-cells = <&eeprom_factory_8000>;
184 nvmem-cell-names = "eeprom";
185 ieee80211-freq-limit = <5000000 6000000>;
186 };
187 };
188
189 &xhci {
190 status = "disabled";
191 };