ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7621_netgear_sercomm_chj.dtsi
1 // SPDX-License-Identifier: GPL-2.0-only
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "mediatek,mt7621-soc";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 label-mac-device = &gmac0;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 label = "green:power";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 label = "green:usb";
29 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
30 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
31 linux,default-trigger = "usbport";
32 };
33
34 internet {
35 label = "green:wan";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 };
38
39 wifi {
40 label = "green:wifi";
41 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
42 linux,default-trigger = "phy0tpt";
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 wps {
50 label = "wps";
51 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_WPS_BUTTON>;
53 };
54
55 reset {
56 label = "reset";
57 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RESTART>;
59 };
60 };
61
62 reg_usb_vbus: regulator {
63 compatible = "regulator-fixed";
64 regulator-name = "usb_vbus";
65 regulator-min-microvolt = <5000000>;
66 regulator-max-microvolt = <5000000>;
67 gpio = <&gpio 10 GPIO_ACTIVE_HIGH>;
68 enable-active-high;
69 };
70 };
71
72 &xhci {
73 vbus-supply = <&reg_usb_vbus>;
74 };
75
76 &pcie {
77 status = "okay";
78 };
79
80 &pcie0 {
81 wifi@0,0 {
82 compatible = "mediatek,mt76";
83 reg = <0x0 0 0 0 0>;
84 mediatek,mtd-eeprom = <&factory 0x8000>;
85 ieee80211-freq-limit = <5000000 6000000>;
86 };
87 };
88
89 &pcie1 {
90 wifi@0,0 {
91 compatible = "mediatek,mt76";
92 reg = <0x0 0 0 0 0>;
93 mediatek,mtd-eeprom = <&factory 0x0>;
94 ieee80211-freq-limit = <2400000 2500000>;
95 };
96 };
97
98 &gmac0 {
99 nvmem-cells = <&macaddr_factory_4>;
100 nvmem-cell-names = "mac-address";
101 };
102
103 &switch0 {
104 ports {
105 port@0 {
106 status = "okay";
107 label = "lan4";
108 };
109
110 port@1 {
111 status = "okay";
112 label = "lan3";
113 };
114
115 port@2 {
116 status = "okay";
117 label = "lan2";
118 };
119
120 port@3 {
121 status = "okay";
122 label = "lan1";
123 };
124
125 port@4 {
126 status = "okay";
127 label = "wan";
128 nvmem-cells = <&macaddr_factory_4>;
129 nvmem-cell-names = "mac-address";
130 mac-address-increment = <2>;
131 };
132 };
133 };
134
135 &state_default {
136 gpio {
137 groups = "uart3", "uart2", "jtag", "wdt";
138 function = "gpio";
139 };
140 };
141
142 &nand {
143 status = "okay";
144
145 partitions {
146 compatible = "fixed-partitions";
147 #address-cells = <1>;
148 #size-cells = <1>;
149
150 partition@0 {
151 label = "u-boot";
152 reg = <0x0 0x100000>;
153 read-only;
154 };
155
156 partition@100000 {
157 label = "SC PART_MAP";
158 reg = <0x100000 0x100000>;
159 read-only;
160 };
161
162 partition@200000 {
163 label = "kernel";
164 reg = <0x200000 0x400000>;
165 };
166
167 partition@600000 {
168 label = "ubi";
169 reg = <0x600000 0x2800000>;
170 };
171
172 partition@2e00000 {
173 label = "reserved0";
174 reg = <0x2e00000 0x1800000>;
175 read-only;
176 };
177
178 factory: partition@4600000 {
179 label = "factory";
180 reg = <0x4600000 0x200000>;
181 read-only;
182 };
183
184 partition@4800000 {
185 label = "reserved1";
186 reg = <0x4800000 0x3800000>;
187 read-only;
188 };
189 };
190 };
191
192 &factory {
193 compatible = "nvmem-cells";
194 #address-cells = <1>;
195 #size-cells = <1>;
196
197 macaddr_factory_4: macaddr@4 {
198 reg = <0x4 0x6>;
199 };
200 };