ramips: mt7628: use mac-base
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_oraybox_x3a.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 = "oraybox,x3a", "mediatek,mt7621-soc";
10 model = "OrayBox X3A";
11
12 aliases {
13 led-boot = &led_status_green;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_blue;
16 led-upgrade = &led_status_green;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_red: status-red {
28 label = "red:status";
29 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
30 };
31
32 led_status_blue: status-blue {
33 label = "blue:status";
34 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_green: status-green {
38 label = "green:status";
39 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
40 };
41 };
42
43 keys {
44 compatible = "gpio-keys";
45
46 reset {
47 label = "reset";
48 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
49 linux,code = <KEY_RESTART>;
50 };
51 };
52 };
53
54 &spi0 {
55 status = "okay";
56
57 flash@0 {
58 compatible = "jedec,spi-nor";
59 reg = <0>;
60 spi-max-frequency = <30000000>;
61
62 partitions {
63 compatible = "fixed-partitions";
64 #address-cells = <1>;
65 #size-cells = <1>;
66
67 partition@0 {
68 label = "u-boot";
69 reg = <0x0 0x30000>;
70 read-only;
71 };
72
73 partition@30000 {
74 label = "u-boot-env";
75 reg = <0x30000 0x10000>;
76 read-only;
77 };
78
79 factory: partition@40000 {
80 compatible = "nvmem-cells";
81 label = "factory";
82 reg = <0x40000 0x10000>;
83 #address-cells = <1>;
84 #size-cells = <1>;
85 read-only;
86
87 eeprom_factory_0: eeprom@0 {
88 reg = <0x0 0x4da8>;
89 };
90 };
91
92 partition@50000 {
93 compatible = "denx,uimage";
94 label = "firmware";
95 reg = <0x50000 0xf00000>;
96 };
97
98 partition@fe0000 {
99 label = "bdinfo";
100 reg = <0xfe0000 0x10000>;
101 read-only;
102
103 compatible = "nvmem-cells";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 macaddr_bdinfo_9: macaddr@9 {
108 reg = <0x9 0x6>;
109 };
110 };
111
112 partition@ff0000 {
113 label = "reserve";
114 reg = <0xff0000 0x10000>;
115 read-only;
116 };
117 };
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie0 {
126 wifi@0,0 {
127 compatible = "mediatek,mt76";
128 reg = <0x0000 0 0 0 0>;
129 nvmem-cells = <&eeprom_factory_0>;
130 nvmem-cell-names = "eeprom";
131 };
132 };
133
134 &gmac0 {
135 nvmem-cells = <&macaddr_bdinfo_9>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &gmac1 {
140 status = "okay";
141 label = "wan";
142 phy-handle = <&ethphy4>;
143
144 nvmem-cells = <&macaddr_bdinfo_9>;
145 nvmem-cell-names = "mac-address";
146 mac-address-increment = <1>;
147 };
148
149 &mdio {
150 ethphy4: ethernet-phy@4 {
151 reg = <4>;
152 };
153 };
154
155 &switch0 {
156 ports {
157 port@2 {
158 status = "okay";
159 label = "lan2";
160 };
161
162 port@3 {
163 status = "okay";
164 label = "lan1";
165 };
166 };
167 };
168
169 &state_default {
170 gpio {
171 groups = "jtag", "wdt";
172 function = "gpio";
173 };
174 };