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