80a271f6e33d4a6472a4c43f68cc96710ec46edf
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_edimax_re23s.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/mtd/partitions/uimage.h>
8
9 / {
10 compatible = "edimax,re23s", "mediatek,mt7621-soc";
11 model = "Edimax RE23S";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_wifi_red;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_power: power {
25 label = "green:power";
26 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
27 };
28
29 wifi_green {
30 label = "green:wifi";
31 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
32 };
33
34 wifi_amber {
35 label = "amber:wifi";
36 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
37 };
38
39 led_wifi_red: wifi_red {
40 label = "red:wifi";
41 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
42 };
43 };
44
45 keys {
46 compatible = "gpio-keys";
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53
54 wps {
55 label = "wps";
56 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_WPS_BUTTON>;
58 };
59 };
60 };
61
62 &spi0 {
63 status = "okay";
64
65 flash@0 {
66 compatible = "jedec,spi-nor";
67 reg = <0>;
68 spi-max-frequency = <50000000>;
69 m25p,fast-read;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "bootloader";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "config";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 read-only;
92
93 nvmem-layout {
94 compatible = "fixed-layout";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0x4da8>;
100 };
101
102 eeprom_factory_8000: eeprom@8000 {
103 reg = <0x8000 0x4da8>;
104 };
105
106 macaddr_factory_8004: macaddr@8004 {
107 reg = <0x8004 0x6>;
108 };
109 };
110 };
111
112 partition@50000 {
113 label = "cimage";
114 reg = <0x50000 0x20000>;
115 read-only;
116 };
117
118 partition@70000 {
119 compatible = "openwrt,uimage", "denx,uimage";
120 openwrt,offset = <FW_EDIMAX_OFFSET>;
121 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
122 label = "firmware";
123 reg = <0x70000 0xf50000>;
124 };
125
126 partition@fc0000 {
127 label = "freespace";
128 reg = <0xfc0000 0x40000>;
129 read-only;
130 };
131 };
132 };
133 };
134
135 &pcie {
136 status = "okay";
137 };
138
139 &pcie0 {
140 wifi@0,0 {
141 compatible = "mediatek,mt76";
142 reg = <0x0000 0 0 0 0>;
143 nvmem-cells = <&eeprom_factory_0>;
144 nvmem-cell-names = "eeprom";
145 ieee80211-freq-limit = <2400000 2500000>;
146 };
147 };
148
149 &pcie1 {
150 wifi@0,0 {
151 compatible = "mediatek,mt76";
152 reg = <0x0000 0 0 0 0>;
153 nvmem-cells = <&eeprom_factory_8000>;
154 nvmem-cell-names = "eeprom";
155 ieee80211-freq-limit = <5000000 6000000>;
156 };
157 };
158
159 &gmac0 {
160 nvmem-cells = <&macaddr_factory_8004>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &switch0 {
165 ports {
166 port@4 {
167 status = "okay";
168 label = "lan";
169 };
170 };
171 };
172
173 &state_default {
174 gpio {
175 groups = "uart3", "uart2", "jtag", "wdt";
176 function = "gpio";
177 };
178 };
179
180 &xhci {
181 status = "disabled";
182 };