ramips: mt7621: convert to nvmem-layout
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_snr_snr-cpe-me2-lite.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 #include "mt7621.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 / {
9 compatible = "snr,snr-cpe-me2-lite", "mediatek,mt7621-soc";
10 model = "SNR-CPE-ME2-Lite";
11
12 leds {
13 compatible = "gpio-leds";
14
15 led_sys: led-0 {
16 label = "green:sys";
17 color = <LED_COLOR_ID_GREEN>;
18 function = LED_FUNCTION_STATUS;
19 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
20 };
21
22 led_vpn: led-1 {
23 label = "green:vpn";
24 color = <LED_COLOR_ID_GREEN>;
25 function = LED_FUNCTION_STATUS;
26 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
27 };
28 };
29
30 keys {
31 compatible = "gpio-keys";
32
33 reset {
34 label = "reset";
35 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_RESTART>;
37 };
38 };
39 };
40
41 &state_default {
42 gpio {
43 groups = "jtag", "wdt";
44 function = "gpio";
45 };
46 };
47
48 &gdma {
49 status = "okay";
50 };
51
52 &spi0 {
53 status = "okay";
54
55 flash@0 {
56 compatible = "jedec,spi-nor";
57 reg = <0>;
58 spi-max-frequency = <104000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 partition@0 {
66 label = "u-boot";
67 reg = <0x0 0x30000>;
68 read-only;
69 };
70
71 partition@30000 {
72 label = "config";
73 reg = <0x30000 0x10000>;
74 };
75
76 factory: partition@40000 {
77 label = "factory";
78 reg = <0x40000 0x10000>;
79 read-only;
80
81 nvmem-layout {
82 compatible = "fixed-layout";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 eeprom_factory_0: eeprom@0 {
87 reg = <0x0 0x400>;
88 };
89
90 eeprom_factory_8000: eeprom@8000 {
91 reg = <0x8000 0x4da8>;
92 };
93
94 macaddr_factory_e000: macaddr@e000 {
95 reg = <0xe000 0x6>;
96 };
97
98 macaddr_factory_e006: macaddr@e006 {
99 reg = <0xe006 0x6>;
100 };
101 };
102 };
103
104 partition@50000 {
105 compatible = "denx,uimage";
106 label = "firmware";
107 reg = <0x50000 0xfb0000>;
108 };
109 };
110 };
111 };
112
113 &sdhci {
114 status = "okay";
115 };
116
117 &mdio {
118 ethphy0: ethernet-phy@0 {
119 reg = <0>;
120 };
121 };
122
123 &gmac0 {
124 nvmem-cells = <&macaddr_factory_e000>;
125 nvmem-cell-names = "mac-address";
126 };
127
128 &gmac1 {
129 status = "okay";
130 label = "wan";
131 phy-handle = <&ethphy0>;
132
133 nvmem-cells = <&macaddr_factory_e006>;
134 nvmem-cell-names = "mac-address";
135 };
136
137 &switch0 {
138 ports {
139 port@1 {
140 status = "okay";
141 label = "lan1";
142 };
143
144 port@2 {
145 status = "okay";
146 label = "lan2";
147 };
148
149 port@3 {
150 status = "okay";
151 label = "lan3";
152 };
153
154 port@4 {
155 status = "okay";
156 label = "lan4";
157 };
158 };
159 };
160
161 &pcie {
162 status = "okay";
163 };
164
165 &pcie0 {
166 wifi@0,0 {
167 compatible = "mediatek,mt76";
168 reg = <0x0000 0 0 0 0>;
169 nvmem-cells = <&eeprom_factory_0>;
170 nvmem-cell-names = "eeprom";
171 ieee80211-freq-limit = <2400000 2500000>;
172 };
173 };
174
175 &pcie1 {
176 wifi@0,0 {
177 compatible = "mediatek,mt76";
178 reg = <0x0000 0 0 0 0>;
179 nvmem-cells = <&eeprom_factory_8000>;
180 nvmem-cell-names = "eeprom";
181 ieee80211-freq-limit = <5000000 6000000>;
182 };
183 };