ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_wavlink_ws-wn572hp3-4g.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 = "wavlink,ws-wn572hp3-4g", "mediatek,mt7621-soc";
10 model = "Wavlink WS-WN572HP3 4G";
11
12 chosen {
13 bootargs = "console=ttyS0,115200";
14 };
15
16 aliases {
17 label-mac-device = &wifi1;
18 led-boot = &led_status_blue;
19 led-failsafe = &led_status_blue;
20 led-running = &led_status_blue;
21 led-upgrade = &led_status_blue;
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "Reset Button";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 rssihigh {
38 label = "blue:rssihigh";
39 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
40 };
41
42 rssimedium {
43 label = "blue:rssimedium";
44 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
45 };
46
47 rssilow {
48 label = "blue:rssilow";
49 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
50 };
51
52 led_status_blue: status_blue {
53 label = "blue:status";
54 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
55 };
56
57 // gpio 15 would be Quectels PWRKEY if used
58 };
59 };
60
61 &spi0 {
62 status = "okay";
63
64 flash@0 {
65 compatible = "jedec,spi-nor";
66 reg = <0>;
67 spi-max-frequency = <40000000>;
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 = "config";
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 0x400>;
98 };
99
100 eeprom_factory_8000: eeprom@8000 {
101 reg = <0x8000 0x4da8>;
102 };
103
104 macaddr_factory_e000: macaddr@e000 {
105 reg = <0xe000 0x6>;
106 };
107
108 macaddr_factory_e006: macaddr@e006 {
109 reg = <0xe006 0x6>;
110 };
111 };
112 };
113
114 partition@50000 {
115 compatible = "denx,fit";
116 label = "firmware";
117 reg = <0x50000 0xf30000>;
118 };
119
120 partition@f00000 {
121 label = "vendor";
122 reg = <0xf80000 0x80000>;
123 read-only;
124 };
125 };
126 };
127 };
128
129 &pcie {
130 status = "okay";
131 };
132
133 &pcie0 {
134 mt76@0,0 {
135 compatible = "mediatek,mt76";
136 reg = <0x0000 0 0 0 0>;
137 ieee80211-freq-limit = <2400000 2500000>;
138 nvmem-cells = <&eeprom_factory_0>;
139 nvmem-cell-names = "eeprom";
140 };
141 };
142
143 &pcie1 {
144 wifi1: mt76@0,0 {
145 compatible = "mediatek,mt76";
146 reg = <0x0000 0 0 0 0>;
147 ieee80211-freq-limit = <5000000 6000000>;
148 nvmem-cells = <&eeprom_factory_8000>;
149 nvmem-cell-names = "eeprom";
150 };
151 };
152
153 &gmac0 {
154 nvmem-cells = <&macaddr_factory_e000>;
155 nvmem-cell-names = "mac-address";
156 };
157
158 &gmac1 {
159 status = "okay";
160 label = "wan";
161 phy-handle = <&ethphy4>;
162
163 nvmem-cells = <&macaddr_factory_e006>;
164 nvmem-cell-names = "mac-address";
165 };
166
167 &mdio {
168 ethphy4: ethernet-phy@4 {
169 reg = <4>;
170 };
171 };
172
173 &switch0 {
174 ports {
175 port@1 {
176 status = "okay";
177 label = "lan";
178 };
179 };
180 };
181
182 &state_default {
183 gpio {
184 groups = "wdt";
185 function = "gpio";
186 };
187 };