ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_jcg_jhr-ac876m.dts
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 compatible = "jcg,jhr-ac876m", "mediatek,mt7621-soc";
10 model = "JCG JHR-AC876M";
11
12 aliases {
13 led-boot = &led_wps;
14 led-failsafe = &led_wps;
15 led-running = &led_wps;
16 led-upgrade = &led_wps;
17 label-mac-device = &gmac1;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 usb3 {
24 label = "blue:usb3";
25 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
26 trigger-sources = <&xhci_ehci_port1>;
27 linux,default-trigger = "usbport";
28 };
29
30 usb2 {
31 label = "blue:usb2";
32 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
33 trigger-sources = <&ehci_port2>;
34 linux,default-trigger = "usbport";
35 };
36
37 led_wps: wps {
38 label = "blue:wps";
39 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
40 };
41 };
42
43 keys {
44 compatible = "gpio-keys";
45
46 reset {
47 label = "reset";
48 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
49 linux,code = <KEY_RESTART>;
50 };
51
52 wps {
53 label = "wps";
54 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_WPS_BUTTON>;
56 };
57 };
58 };
59
60 &spi0 {
61 status = "okay";
62
63 flash@0 {
64 compatible = "jedec,spi-nor";
65 reg = <0>;
66 spi-max-frequency = <80000000>;
67 m25p,fast-read;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "u-boot";
76 reg = <0x0 0x30000>;
77 read-only;
78 };
79
80 partition@30000 {
81 label = "u-boot-env";
82 reg = <0x30000 0x10000>;
83 read-only;
84 };
85
86 factory: partition@40000 {
87 compatible = "nvmem-cells";
88 label = "factory";
89 reg = <0x40000 0x10000>;
90 #address-cells = <1>;
91 #size-cells = <1>;
92 read-only;
93
94 eeprom_factory_0: eeprom@0 {
95 reg = <0x0 0x4da8>;
96 };
97
98 eeprom_factory_8000: eeprom@8000 {
99 reg = <0x8000 0x4da8>;
100 };
101
102 macaddr_factory_4: macaddr@4 {
103 reg = <0x4 0x6>;
104 };
105
106 macaddr_factory_e000: macaddr@e000 {
107 reg = <0xe000 0x6>;
108 };
109 };
110
111 partition@50000 {
112 compatible = "denx,uimage";
113 label = "firmware";
114 reg = <0x50000 0xfb0000>;
115 };
116 };
117 };
118 };
119
120 &pcie {
121 status = "okay";
122 };
123
124 &pcie0 {
125 wifi@0,0 {
126 compatible = "mediatek,mt76";
127 reg = <0x0000 0 0 0 0>;
128 nvmem-cells = <&eeprom_factory_0>;
129 nvmem-cell-names = "eeprom";
130 ieee80211-freq-limit = <2400000 2500000>;
131
132 led {
133 led-active-low;
134 };
135 };
136 };
137
138 &pcie1 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 nvmem-cells = <&eeprom_factory_8000>;
143 nvmem-cell-names = "eeprom";
144 ieee80211-freq-limit = <5000000 6000000>;
145
146 led {
147 led-active-low;
148 };
149 };
150 };
151
152 &gmac0 {
153 nvmem-cells = <&macaddr_factory_e000>;
154 nvmem-cell-names = "mac-address";
155 };
156
157 &gmac1 {
158 status = "okay";
159 label = "wan";
160 phy-handle = <&ethphy4>;
161
162 nvmem-cells = <&macaddr_factory_4>;
163 nvmem-cell-names = "mac-address";
164 };
165
166 &mdio {
167 ethphy4: ethernet-phy@4 {
168 reg = <4>;
169 };
170 };
171
172 &switch0 {
173 ports {
174 port@0 {
175 status = "okay";
176 label = "lan1";
177 };
178
179 port@1 {
180 status = "okay";
181 label = "lan2";
182 };
183
184 port@2 {
185 status = "okay";
186 label = "lan3";
187 };
188
189 port@3 {
190 status = "okay";
191 label = "lan4";
192 };
193 };
194 };
195
196 &state_default {
197 gpio {
198 groups = "i2c", "uart3", "jtag", "wdt";
199 function = "gpio";
200 };
201 };