ramips: mt7621-dts: add pinctrl properties for ethernet
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_wavlink_wl-wn531a6.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 = "wavlink,wl-wn531a6", "mediatek,mt7621-soc";
10 model = "Wavlink WL-WN531A6";
11
12 aliases {
13 led-boot = &led_status_red;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_blue;
16 led-upgrade = &led_status_red;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "Reset Button";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27
28 touch { /* RH6015C touch sensor -> GPIO 14 */
29 label = "Touch Button";
30 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
31 linux,code = <BTN_0>;
32 };
33
34 turbo {
35 label = "Turbo Button";
36 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
37 linux,code = <BTN_1>;
38 };
39
40 wps {
41 label = "WPS Button";
42 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
43 linux,code = <KEY_WPS_BUTTON>;
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led_status_blue: status_blue {
51 label = "blue:power";
52 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
53 };
54
55 led_status_red: status_red {
56 label = "red:power";
57 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
58 };
59
60 wifi2g {
61 label = "blue:wifi2g";
62 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "phy0tpt";
64 };
65 };
66 };
67
68 &i2c {
69 status = "okay";
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <40000000>;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "config";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101 };
102
103 partition@50000 {
104 compatible = "denx,uimage";
105 label = "firmware";
106 reg = <0x50000 0xeb0000>;
107 };
108
109 partition@f00000 {
110 label = "vendor";
111 reg = <0xf00000 0x100000>;
112 read-only;
113 };
114 };
115 };
116 };
117
118 &pcie {
119 status = "okay";
120 };
121
122 &pcie0 {
123 mt76@0,0 {
124 compatible = "mediatek,mt76";
125 reg = <0x0000 0 0 0 0>;
126 mediatek,mtd-eeprom = <&factory 0x0>;
127 ieee80211-freq-limit = <2400000 2500000>;
128 };
129 };
130
131 &pcie1 {
132 mt76@0,0 {
133 compatible = "mediatek,mt76";
134 reg = <0x0000 0 0 0 0>;
135 mediatek,mtd-eeprom = <&factory 0x8000>;
136 ieee80211-freq-limit = <5000000 6000000>;
137 };
138 };
139
140 &ethernet {
141 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
142 };
143
144 &gmac0 {
145 nvmem-cells = <&macaddr_factory_e000>;
146 nvmem-cell-names = "mac-address";
147 };
148
149 &switch0 {
150 ports {
151 port@0 {
152 status = "okay";
153 label = "lan1";
154 };
155
156 port@1 {
157 status = "okay";
158 label = "lan2";
159 };
160
161 port@2 {
162 status = "okay";
163 label = "lan3";
164 };
165
166 port@3 {
167 status = "okay";
168 label = "lan4";
169 };
170
171 port@4 {
172 status = "okay";
173 label = "wan";
174 nvmem-cells = <&macaddr_factory_e006>;
175 nvmem-cell-names = "mac-address";
176 };
177 };
178 };
179
180 &state_default {
181 gpio {
182 groups = "rgmii2", "jtag", "wdt";
183 function = "gpio";
184 };
185 };
186
187 &uartlite2 {
188 status = "okay";
189 };
190
191 &factory {
192 compatible = "nvmem-cells";
193 #address-cells = <1>;
194 #size-cells = <1>;
195
196 macaddr_factory_e000: macaddr@e000 {
197 reg = <0xe000 0x6>;
198 };
199
200 macaddr_factory_e006: macaddr@e006 {
201 reg = <0xe006 0x6>;
202 };
203 };