ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_netis_wf2770.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "netis,wf2770", "ralink,mt7620a-soc";
10 model = "NETIS WF2770";
11
12 leds {
13 compatible = "gpio-leds";
14
15 wlan {
16 label = "blue:wlan";
17 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
18 linux,default-trigger = "phy0tpt";
19 };
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30
31 wps {
32 label = "wps";
33 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
34 linux,code = <KEY_WPS_BUTTON>;
35 };
36
37 rfkill {
38 label = "rfkill";
39 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_RFKILL>;
41 };
42
43 led-toggle {
44 label = "led-toggle";
45 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_LIGHTS_TOGGLE>;
47 };
48 };
49 };
50
51 &spi0 {
52 status = "okay";
53
54 flash@0 {
55 compatible = "jedec,spi-nor";
56 reg = <0>;
57 spi-max-frequency = <50000000>;
58
59 partitions {
60 compatible = "fixed-partitions";
61 #address-cells = <1>;
62 #size-cells = <1>;
63
64 partition@0 {
65 label = "u-boot";
66 reg = <0x0 0x30000>;
67 read-only;
68 };
69
70 partition@30000 {
71 label = "config";
72 reg = <0x30000 0x10000>;
73 read-only;
74 };
75
76 factory: partition@40000 {
77 compatible = "nvmem-cells";
78 label = "factory";
79 reg = <0x40000 0x10000>;
80 #address-cells = <1>;
81 #size-cells = <1>;
82 read-only;
83
84 eeprom_factory_0: eeprom@0 {
85 reg = <0x0 0x200>;
86 };
87
88 macaddr_factory_4: macaddr@4 {
89 reg = <0x4 0x6>;
90 };
91 };
92
93 partition@50000 {
94 compatible = "denx,uimage";
95 label = "firmware";
96 reg = <0x50000 0xfb0000>;
97 };
98 };
99 };
100 };
101
102 &state_default {
103 gpio {
104 groups = "i2c", "uartf";
105 function = "gpio";
106 };
107 };
108
109 &ethernet {
110 pinctrl-names = "default";
111 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
112
113 nvmem-cells = <&macaddr_factory_4>;
114 nvmem-cell-names = "mac-address";
115
116 port@5 {
117 status = "okay";
118 mediatek,fixed-link = <1000 1 1 1>;
119 phy-mode = "rgmii";
120 };
121
122 mdio-bus {
123 status = "okay";
124
125 ethernet-phy@0 {
126 reg = <0>;
127 phy-mode = "rgmii";
128 };
129
130 ethernet-phy@1 {
131 reg = <1>;
132 phy-mode = "rgmii";
133 };
134
135 ethernet-phy@2 {
136 reg = <2>;
137 phy-mode = "rgmii";
138 };
139
140 ethernet-phy@3 {
141 reg = <3>;
142 phy-mode = "rgmii";
143 };
144
145 ethernet-phy@4 {
146 reg = <4>;
147 phy-mode = "rgmii";
148 };
149
150 ethernet-phy@1f {
151 reg = <0x1f>;
152 phy-mode = "rgmii";
153 };
154 };
155 };
156
157 &gsw {
158 mediatek,ephy-base = /bits/ 8 <12>;
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 mediatek,mtd-eeprom = <&factory 0x8000>;
170 ieee80211-freq-limit = <5000000 6000000>;
171 };
172 };
173
174 &wmac {
175 nvmem-cells = <&eeprom_factory_0>;
176 nvmem-cell-names = "eeprom";
177 };