ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_iptime_a6ns-m.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 = "iptime,a6ns-m", "mediatek,mt7621-soc";
10 model = "ipTIME A6ns-M";
11
12 aliases {
13 led-boot = &led_cpu;
14 led-failsafe = &led_cpu;
15 led-running = &led_cpu;
16 led-upgrade = &led_cpu;
17 label-mac-device = &gmac0;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 usb {
24 label = "blue:usb";
25 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
26 trigger-sources = <&xhci_ehci_port1>;
27 linux,default-trigger = "usbport";
28 };
29
30 wlan5g {
31 label = "blue:wlan5g";
32 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
33 linux,default-trigger = "phy0radio";
34 };
35
36 wlan2g {
37 label = "blue:wlan2g";
38 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
39 linux,default-trigger = "phy1radio";
40 };
41
42 led_cpu: cpu {
43 label = "blue:cpu";
44 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
45 };
46 };
47
48 keys {
49 compatible = "gpio-keys";
50
51 wps {
52 label = "wps";
53 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_WPS_BUTTON>;
55 };
56
57 reset {
58 label = "reset";
59 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_RESTART>;
61 };
62 };
63 };
64
65 &spi0 {
66 status = "okay";
67
68 flash@0 {
69 compatible = "jedec,spi-nor";
70 reg = <0>;
71 spi-max-frequency = <80000000>;
72 m25p,fast-read;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 uboot: partition@0 {
80 label = "u-boot";
81 reg = <0x0 0x20000>;
82 read-only;
83 };
84
85 partition@20000 {
86 label = "config";
87 reg = <0x20000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@30000 {
92 label = "factory";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 partition@40000 {
98 compatible = "denx,uimage";
99 label = "firmware";
100 reg = <0x40000 0xfc0000>;
101 };
102 };
103 };
104 };
105
106 &state_default {
107 gpio {
108 groups = "i2c", "uart3", "jtag", "wdt";
109 function = "gpio";
110 };
111 };
112
113 &gmac0 {
114 nvmem-cells = <&macaddr_uboot_1fc20>;
115 nvmem-cell-names = "mac-address";
116 };
117
118 &switch0 {
119 ports {
120 port@0 {
121 status = "okay";
122 label = "wan";
123 nvmem-cells = <&macaddr_uboot_1fc40>;
124 nvmem-cell-names = "mac-address";
125 };
126
127 port@1 {
128 status = "okay";
129 label = "lan1";
130 };
131
132 port@2 {
133 status = "okay";
134 label = "lan2";
135 };
136
137 port@3 {
138 status = "okay";
139 label = "lan3";
140 };
141
142 port@4 {
143 status = "okay";
144 label = "lan4";
145 };
146 };
147 };
148
149 &pcie {
150 status = "okay";
151 };
152
153 &pcie0 {
154 wifi@0,0 {
155 compatible = "mediatek,mt76";
156 reg = <0x0000 0 0 0 0>;
157 mediatek,mtd-eeprom = <&factory 0x0>;
158 ieee80211-freq-limit = <5000000 6000000>;
159 };
160 };
161
162 &pcie1 {
163 wifi@0,0 {
164 compatible = "mediatek,mt76";
165 reg = <0x0000 0 0 0 0>;
166 mediatek,mtd-eeprom = <&factory 0x8000>;
167 ieee80211-freq-limit = <2400000 2500000>;
168 };
169 };
170
171 &uboot {
172 compatible = "nvmem-cells";
173 #address-cells = <1>;
174 #size-cells = <1>;
175
176 macaddr_uboot_1fc20: macaddr@1fc20 {
177 reg = <0x1fc20 0x6>;
178 };
179
180 macaddr_uboot_1fc40: macaddr@1fc40 {
181 reg = <0x1fc40 0x6>;
182 };
183 };