78f81314fc1274b6ede246ac8a076f221010c92d
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_winstars_ws-wn583a6.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 = "winstars,ws-wn583a6", "mediatek,mt7621-soc";
10 model = "Winstars WS-WN583A6";
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 leds {
20 compatible = "gpio-leds";
21
22 night_light_white {
23 label = "white:night_light";
24 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
25 };
26
27 led_status_blue: status_blue {
28 label = "blue:status";
29 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
30 };
31
32 status_amber {
33 label = "amber:status";
34 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_red: status_red {
38 label = "red:status";
39 gpios = <&gpio 25 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 wps {
53 label = "wps";
54 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_WPS_BUTTON>;
56 };
57 };
58 };
59
60 &spi0 {
61 status = "okay";
62
63 flash@0 {
64 compatible = "jedec,spi-nor";
65 reg = <0>;
66 spi-max-frequency = <104000000>;
67 m25p,fast-read;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "bootloader";
76 reg = <0x0 0x30000>;
77 read-only;
78 };
79
80 partition@30000 {
81 label = "config";
82 reg = <0x30000 0x10000>;
83 read-only;
84 };
85
86 factory: partition@40000 {
87 label = "factory";
88 reg = <0x40000 0x10000>;
89 read-only;
90
91 nvmem-layout {
92 compatible = "fixed-layout";
93 #address-cells = <1>;
94 #size-cells = <1>;
95
96 eeprom_factory_0: eeprom@0 {
97 reg = <0x0 0x400>;
98 };
99
100 eeprom_factory_8000: eeprom@8000 {
101 reg = <0x8000 0x4da8>;
102 };
103
104 macaddr_factory_e000: macaddr@e000 {
105 reg = <0xe000 0x6>;
106 };
107
108 macaddr_factory_e006: macaddr@e006 {
109 reg = <0xe006 0x6>;
110 };
111 };
112 };
113
114 partition@50000 {
115 compatible = "denx,uimage";
116 label = "firmware";
117 reg = <0x50000 0x7b0000>;
118 };
119 };
120 };
121 };
122
123 &pcie {
124 status = "okay";
125 };
126
127 &pcie0 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 nvmem-cells = <&eeprom_factory_0>;
132 nvmem-cell-names = "eeprom";
133 };
134 };
135
136 &pcie1 {
137 wifi@0,0 {
138 compatible = "mediatek,mt76";
139 reg = <0x0000 0 0 0 0>;
140 nvmem-cells = <&eeprom_factory_8000>;
141 nvmem-cell-names = "eeprom";
142 };
143 };
144
145 &ethernet {
146 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
147 };
148
149 &gmac0 {
150 nvmem-cells = <&macaddr_factory_e000>;
151 nvmem-cell-names = "mac-address";
152 };
153
154 &switch0 {
155 ports {
156 port@0 {
157 status = "okay";
158 label = "wan";
159 nvmem-cells = <&macaddr_factory_e006>;
160 nvmem-cell-names = "mac-address";
161 };
162
163 port@1 {
164 status = "okay";
165 label = "lan";
166 };
167 };
168 };
169
170 &state_default {
171 gpio {
172 groups = "jtag", "wdt", "rgmii2";
173 function = "gpio";
174 };
175 };
176
177 &xhci {
178 status = "disabled";
179 };