ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.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 label = "factory";
88 reg = <0x40000 0x10000>;
89 read-only;
90
91 nvmem-layout {
92 compatible = "fixed-layout";
93 #address-cells = <1>;
94 #size-cells = <1>;
95
96 eeprom_factory_0: eeprom@0 {
97 reg = <0x0 0x4da8>;
98 };
99
100 eeprom_factory_8000: eeprom@8000 {
101 reg = <0x8000 0x4da8>;
102 };
103
104 macaddr_factory_4: macaddr@4 {
105 reg = <0x4 0x6>;
106 };
107
108 macaddr_factory_e000: macaddr@e000 {
109 reg = <0xe000 0x6>;
110 };
111 };
112 };
113
114 partition@50000 {
115 compatible = "denx,uimage";
116 label = "firmware";
117 reg = <0x50000 0xfb0000>;
118 };
119 };
120 };
121 };
122
123 &pcie {
124 status = "okay";
125 };
126
127 &pcie0 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 nvmem-cells = <&eeprom_factory_0>;
132 nvmem-cell-names = "eeprom";
133 ieee80211-freq-limit = <2400000 2500000>;
134
135 led {
136 led-active-low;
137 };
138 };
139 };
140
141 &pcie1 {
142 wifi@0,0 {
143 compatible = "mediatek,mt76";
144 reg = <0x0000 0 0 0 0>;
145 nvmem-cells = <&eeprom_factory_8000>;
146 nvmem-cell-names = "eeprom";
147 ieee80211-freq-limit = <5000000 6000000>;
148
149 led {
150 led-active-low;
151 };
152 };
153 };
154
155 &gmac0 {
156 nvmem-cells = <&macaddr_factory_e000>;
157 nvmem-cell-names = "mac-address";
158 };
159
160 &gmac1 {
161 status = "okay";
162 label = "wan";
163 phy-handle = <&ethphy4>;
164
165 nvmem-cells = <&macaddr_factory_4>;
166 nvmem-cell-names = "mac-address";
167 };
168
169 &mdio {
170 ethphy4: ethernet-phy@4 {
171 reg = <4>;
172 };
173 };
174
175 &switch0 {
176 ports {
177 port@0 {
178 status = "okay";
179 label = "lan1";
180 };
181
182 port@1 {
183 status = "okay";
184 label = "lan2";
185 };
186
187 port@2 {
188 status = "okay";
189 label = "lan3";
190 };
191
192 port@3 {
193 status = "okay";
194 label = "lan4";
195 };
196 };
197 };
198
199 &state_default {
200 gpio {
201 groups = "i2c", "uart3", "jtag", "wdt";
202 function = "gpio";
203 };
204 };