ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7620a_netis_wf2770.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.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 = "netis,wf2770", "ralink,mt7620a-soc";
11 model = "NETIS WF2770";
12
13 leds {
14 compatible = "gpio-leds";
15
16 wlan {
17 function = LED_FUNCTION_WLAN;
18 color = <LED_COLOR_ID_BLUE>;
19 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
20 linux,default-trigger = "phy0tpt";
21 };
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38
39 rfkill {
40 label = "rfkill";
41 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
42 linux,code = <KEY_RFKILL>;
43 };
44
45 led-toggle {
46 label = "led-toggle";
47 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_LIGHTS_TOGGLE>;
49 };
50 };
51 };
52
53 &spi0 {
54 status = "okay";
55
56 flash@0 {
57 compatible = "jedec,spi-nor";
58 reg = <0>;
59 spi-max-frequency = <50000000>;
60
61 partitions {
62 compatible = "fixed-partitions";
63 #address-cells = <1>;
64 #size-cells = <1>;
65
66 partition@0 {
67 label = "u-boot";
68 reg = <0x0 0x30000>;
69 read-only;
70 };
71
72 partition@30000 {
73 label = "config";
74 reg = <0x30000 0x10000>;
75 read-only;
76 };
77
78 factory: partition@40000 {
79 label = "factory";
80 reg = <0x40000 0x10000>;
81 read-only;
82
83 nvmem-layout {
84 compatible = "fixed-layout";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 eeprom_factory_0: eeprom@0 {
89 reg = <0x0 0x200>;
90 };
91
92 eeprom_factory_8000: eeprom@8000 {
93 reg = <0x8000 0x200>;
94 };
95
96 macaddr_factory_4: macaddr@4 {
97 reg = <0x4 0x6>;
98 };
99 };
100 };
101
102 partition@50000 {
103 compatible = "denx,uimage";
104 label = "firmware";
105 reg = <0x50000 0xfb0000>;
106 };
107 };
108 };
109 };
110
111 &state_default {
112 gpio {
113 groups = "i2c", "uartf";
114 function = "gpio";
115 };
116 };
117
118 &ethernet {
119 pinctrl-names = "default";
120 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
121
122 nvmem-cells = <&macaddr_factory_4>;
123 nvmem-cell-names = "mac-address";
124
125 port@5 {
126 status = "okay";
127 mediatek,fixed-link = <1000 1 1 1>;
128 phy-mode = "rgmii";
129 };
130
131 mdio-bus {
132 status = "okay";
133
134 ethernet-phy@0 {
135 reg = <0>;
136 phy-mode = "rgmii";
137 };
138
139 ethernet-phy@1 {
140 reg = <1>;
141 phy-mode = "rgmii";
142 };
143
144 ethernet-phy@2 {
145 reg = <2>;
146 phy-mode = "rgmii";
147 };
148
149 ethernet-phy@3 {
150 reg = <3>;
151 phy-mode = "rgmii";
152 };
153
154 ethernet-phy@4 {
155 reg = <4>;
156 phy-mode = "rgmii";
157 };
158
159 ethernet-phy@1f {
160 reg = <0x1f>;
161 phy-mode = "rgmii";
162 };
163 };
164 };
165
166 &gsw {
167 mediatek,ephy-base = /bits/ 8 <12>;
168 };
169
170 &pcie {
171 status = "okay";
172 };
173
174 &pcie0 {
175 wifi@0,0 {
176 compatible = "mediatek,mt76";
177 reg = <0x0000 0 0 0 0>;
178 nvmem-cells = <&eeprom_factory_8000>;
179 nvmem-cell-names = "eeprom";
180 ieee80211-freq-limit = <5000000 6000000>;
181 };
182 };
183
184 &wmac {
185 nvmem-cells = <&eeprom_factory_0>;
186 nvmem-cell-names = "eeprom";
187 };