ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_mercusys_mr70x-v1.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "mercusys,mr70x-v1", "mediatek,mt7621-soc";
11 model = "MERCUSYS MR70X v1";
12
13 aliases {
14 led-boot = &led_power_green;
15 led-failsafe = &led_power_orange;
16 led-running = &led_power_green;
17 led-upgrade = &led_power_orange;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 led_power_green: power-green {
39 function = LED_FUNCTION_POWER;
40 color = <LED_COLOR_ID_GREEN>;
41 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
42 };
43
44 led_power_orange: power-orange {
45 function = LED_FUNCTION_POWER;
46 color = <LED_COLOR_ID_ORANGE>;
47 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
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 = <25000000>;
59
60 partitions {
61 compatible = "fixed-partitions";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 partition@0 {
66 label = "u-boot";
67 reg = <0x000000 0x040000>;
68 read-only;
69 };
70
71 partition@40000 {
72 compatible = "denx,uimage";
73 label = "firmware";
74 reg = <0x040000 0xf60000>;
75 };
76
77 config: partition@fa0000 {
78 label = "config";
79 reg = <0xfa0000 0x010000>;
80 read-only;
81
82 nvmem-layout {
83 compatible = "fixed-layout";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 macaddr_config_8: macaddr@8 {
88 compatible = "mac-base";
89 reg = <0x8 0x6>;
90 #nvmem-cell-cells = <1>;
91 };
92 };
93 };
94
95 partition@fb0000 {
96 label = "tplink";
97 reg = <0xfb0000 0x040000>;
98 read-only;
99 };
100
101 radio: partition@ff0000 {
102 label = "radio";
103 reg = <0xff0000 0x010000>;
104 read-only;
105
106 nvmem-layout {
107 compatible = "fixed-layout";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 eeprom_radio_0: eeprom@0 {
112 reg = <0x0 0xe00>;
113 };
114 };
115 };
116 };
117 };
118 };
119
120 &pcie {
121 status = "okay";
122 };
123
124 &pcie1 {
125 wifi@0,0 {
126 compatible = "mediatek,mt76";
127 reg = <0x0000 0 0 0 0>;
128 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>;
129 nvmem-cell-names = "eeprom", "mac-address";
130 mediatek,disable-radar-background;
131 };
132 };
133
134 &gmac0 {
135 nvmem-cells = <&macaddr_config_8 0>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &gmac1 {
140 status = "okay";
141 label = "wan";
142 phy-handle = <&ethphy0>;
143
144 nvmem-cells = <&macaddr_config_8 1>;
145 nvmem-cell-names = "mac-address";
146 };
147
148 &mdio {
149 ethphy0: ethernet-phy@0 {
150 reg = <0>;
151 };
152 };
153
154 &switch0 {
155 ports {
156 port@1 {
157 status = "okay";
158 label = "lan1";
159 };
160
161 port@2 {
162 status = "okay";
163 label = "lan2";
164 };
165
166 port@3 {
167 status = "okay";
168 label = "lan3";
169 };
170 };
171 };
172
173 &state_default {
174 gpio {
175 groups = "i2c", "uart3";
176 function = "gpio";
177 };
178 };