ramips: convert mtd-mac-address to nvmem implementation
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_totolink_a7000r.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 = "totolink,a7000r", "mediatek,mt7621-soc";
10 model = "TOTOLINK A7000R";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_sys: sys {
23 label = "blue:sys";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26 };
27
28 keys {
29 compatible = "gpio-keys";
30
31 reset {
32 label = "reset";
33 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 linux,code = <KEY_RESTART>;
36 };
37 };
38 };
39
40 &spi0 {
41 status = "okay";
42
43 flash@0 {
44 compatible = "jedec,spi-nor";
45 reg = <0>;
46 spi-max-frequency = <40000000>;
47
48 partitions {
49 compatible = "fixed-partitions";
50 #address-cells = <1>;
51 #size-cells = <1>;
52
53 partition@0 {
54 label = "u-boot";
55 reg = <0x0 0x30000>;
56 read-only;
57 };
58
59 partition@30000 {
60 label = "u-boot-env";
61 reg = <0x30000 0x10000>;
62 read-only;
63 };
64
65 factory: partition@40000 {
66 label = "factory";
67 reg = <0x40000 0x10000>;
68 read-only;
69 };
70
71 partition@50000 {
72 compatible = "denx,uimage";
73 label = "firmware";
74 reg = <0x50000 0xfb0000>;
75 };
76 };
77 };
78 };
79
80 &pcie {
81 status = "okay";
82 };
83
84 &pcie0 {
85 wifi@0,0 {
86 compatible = "mediatek,mt76";
87 reg = <0x0000 0 0 0 0>;
88 mediatek,mtd-eeprom = <&factory 0x0000>;
89 ieee80211-freq-limit = <2400000 2500000>;
90 };
91 };
92
93 &pcie1 {
94 wifi@0,0 {
95 compatible = "mediatek,mt76";
96 reg = <0x0000 0 0 0 0>;
97 mediatek,mtd-eeprom = <&factory 0x8000>;
98 ieee80211-freq-limit = <5000000 6000000>;
99 };
100 };
101
102 &gmac0 {
103 nvmem-cells = <&macaddr_factory_e000>;
104 nvmem-cell-names = "mac-address";
105 };
106
107 &switch0 {
108 ports {
109 port@0 {
110 status = "okay";
111 label = "lan1";
112 };
113
114 port@1 {
115 status = "okay";
116 label = "lan2";
117 };
118
119 port@2 {
120 status = "okay";
121 label = "lan3";
122 };
123
124 port@3 {
125 status = "okay";
126 label = "lan4";
127 };
128
129 port@4 {
130 status = "okay";
131 label = "wan";
132 nvmem-cells = <&macaddr_factory_e000>;
133 nvmem-cell-names = "mac-address";
134 mac-address-increment = <1>;
135 };
136 };
137 };
138
139 &state_default {
140 gpio {
141 groups = "i2c", "wdt";
142 function = "gpio";
143 };
144 };
145
146 &factory {
147 compatible = "nvmem-cells";
148 #address-cells = <1>;
149 #size-cells = <1>;
150
151 macaddr_factory_e000: macaddr@e000 {
152 reg = <0xe000 0x6>;
153 };
154 };