ramips: mt7621: convert to nvmem-layout
[openwrt/openwrt.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 label = "factory";
104 reg = <0x40000 0x10000>;
105 read-only;
106
107 nvmem-layout {
108 compatible = "fixed-layout";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 eeprom_factory_0: eeprom@0 {
113 reg = <0x0 0x4da8>;
114 };
115
116 eeprom_factory_8000: eeprom@8000 {
117 reg = <0x8000 0x4da8>;
118 };
119 };
120 };
121 };
122 };
123 };
124
125 &gmac1 {
126 status = "okay";
127 label = "wan";
128 phy-handle = <&ethphy0>;
129 };
130
131 &mdio {
132 ethphy0: ethernet-phy@0 {
133 reg = <0>;
134 };
135 };
136
137 &switch0 {
138 ports {
139 port@1 {
140 status = "okay";
141 label = "lan4";
142 };
143
144 port@2 {
145 status = "okay";
146 label = "lan3";
147 };
148
149 port@3 {
150 status = "okay";
151 label = "lan2";
152 };
153
154 port@4 {
155 status = "okay";
156 label = "lan1";
157 };
158 };
159 };
160
161 &state_default {
162 gpio {
163 groups = "uart2", "uart3", "jtag", "wdt";
164 function = "gpio";
165 };
166 };
167
168 &pcie {
169 status = "okay";
170 };
171
172 &pcie0 {
173 wifi@0,0 {
174 compatible = "mediatek,mt76";
175 reg = <0x0000 0 0 0 0>;
176 nvmem-cells = <&eeprom_factory_0>;
177 nvmem-cell-names = "eeprom";
178 ieee80211-freq-limit = <2400000 2500000>;
179 };
180 };
181
182 &pcie1 {
183 wifi@0,0 {
184 compatible = "mediatek,mt76";
185 reg = <0x0000 0 0 0 0>;
186 nvmem-cells = <&eeprom_factory_8000>;
187 nvmem-cell-names = "eeprom";
188 ieee80211-freq-limit = <5000000 6000000>;
189 };
190 };
191
192 &xhci {
193 status = "disabled";
194 };