717609f6a77335f7ddf874ac4c6a619ff5292fc6
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7620a_edimax_br-6208ac-v2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2023 Stefan Weil <sw@weilnetz.de>
4 */
5
6 #include "mt7620a.dtsi"
7
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/leds/common.h>
11 #include <dt-bindings/mtd/partitions/uimage.h>
12
13 / {
14 compatible = "edimax,br-6208ac-v2", "ralink,mt7620a-soc";
15 model = "Edimax BR-6208AC v2";
16
17 aliases {
18 led-boot = &led_power;
19 led-failsafe = &led_power;
20 led-running = &led_power;
21 led-upgrade = &led_firmware;
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 // Vendor firmware: /proc/RESET_BUTTON
28 reset_wps {
29 label = "reset_wps";
30 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 // Vendor firmware: /proc/driver/led
36 leds {
37 compatible = "gpio-leds";
38
39 led_power: power {
40 color = <LED_COLOR_ID_GREEN>;
41 function = LED_FUNCTION_POWER;
42 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
43 };
44
45 // RALINK_REG_PIO3924DATA 39-24
46 led_internet: internet {
47 color = <LED_COLOR_ID_GREEN>;
48 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
49 };
50
51 // RALINK_REG_PIO7140DATA 44-40
52 led_wlan_2_4ghz: wlan_2_4ghz {
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_WLAN;
55 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
56 linux,default-trigger = "phy1tpt";
57 };
58
59 // RALINK_REG_PIO7140DATA 43-40
60 led_wlan_5ghz: wlan_5ghz {
61 color = <LED_COLOR_ID_GREEN>;
62 function = LED_FUNCTION_WLAN;
63 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
64 linux,default-trigger = "phy0tpt";
65 };
66
67 // RALINK_REG_PIO7140DATA 42-40
68 led_firmware: firmware {
69 color = <LED_COLOR_ID_GREEN>;
70 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
71 // default-state = "keep";
72 };
73
74 // RALINK_REG_PIO7140DATA 41-40
75 led_vpn: vpn {
76 color = <LED_COLOR_ID_GREEN>;
77 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
78 };
79 };
80 };
81
82 &gdma {
83 status = "okay";
84 };
85
86 // Vendor firmware: RALINK_REG_PIO7140 - gpio0: gpio@600
87 // Vendor firmware: RALINK_REG_PIO3924 - gpio1: gpio@638
88 // Vendor firmware: RALINK_REG_PIO7140 - gpio2: gpio@660
89 // Vendor firmware: RALINK_REG_PIO72 - gpio3: gpio@688
90
91 &gpio1 {
92 status = "okay";
93 };
94
95 &gpio2 {
96 status = "okay";
97 };
98
99 &spi0 {
100 status = "okay";
101
102 flash@0 {
103 compatible = "jedec,spi-nor";
104 reg = <0>;
105 spi-max-frequency = <10000000>;
106
107 partitions {
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 // Vendor partitions:
113 // 0x000000000000-0x000000030000 : "Bootloader"
114 // 0x000000030000-0x000000040000 : "Config"
115 // 0x000000040000-0x000000050000 : "Factory"
116 // 0x000000050000-0x000000070000 : "Cimage"
117 // 0x000000070000-0x000000fe0000 : "Uimage"
118 // 0x000000070000-0x000000190000 : "Kernel"
119 // 0x000000190000-0x000000fe0000 : "RootFS"
120 // 0x000000fe0000-0x000001000000 : "FreeSpace"
121
122 // Bootloader
123 partition@0 {
124 label = "u-boot";
125 reg = <0x0 0x30000>;
126 read-only;
127 };
128
129 // Config
130 partition@30000 {
131 label = "u-boot-env";
132 reg = <0x30000 0x10000>;
133 read-only;
134 };
135
136 // Factory
137 factory: partition@40000 {
138 label = "factory";
139 reg = <0x40000 0x10000>;
140 read-only;
141
142 nvmem-layout {
143 compatible = "fixed-layout";
144 #address-cells = <1>;
145 #size-cells = <1>;
146
147 eeprom_factory_0: eeprom@0 {
148 reg = <0x0 0x200>;
149 };
150
151 eeprom_factory_8000: eeprom@8000 {
152 reg = <0x8000 0x200>;
153 };
154
155 macaddr_factory_4: macaddr@4 {
156 reg = <0x4 0x6>;
157 };
158
159 macaddr_factory_2e: macaddr@2e {
160 reg = <0x2e 0x6>;
161 };
162 };
163 };
164
165 // Cimage
166 partition@50000 {
167 label = "cimage";
168 reg = <0x50000 0x20000>;
169 read-only;
170 };
171
172 partition@70000 {
173 compatible = "openwrt,uimage", "denx,uimage";
174 openwrt,offset = <FW_EDIMAX_OFFSET>;
175 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
176 label = "firmware";
177 reg = <0x00070000 0x00f70000>;
178 };
179
180 // FreeSpace
181 partition@fe0000 {
182 label = "freespace";
183 reg = <0xfe0000 0x20000>;
184 read-only;
185 };
186 };
187 };
188 };
189
190 &state_default {
191 gpio {
192 // TODO: "spi refclk"?
193 groups = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
194 function = "gpio";
195 };
196 };
197
198 &ethernet {
199 nvmem-cells = <&macaddr_factory_2e>;
200 nvmem-cell-names = "mac-address";
201
202 mediatek,portmap = "llllw";
203 };
204
205 &wmac {
206 nvmem-cells = <&eeprom_factory_0>;
207 nvmem-cell-names = "eeprom";
208 };
209
210 &pcie {
211 status = "okay";
212 };
213
214 &pcie0 {
215 wifi@0,0 {
216 reg = <0x0000 0 0 0 0>;
217 nvmem-cells = <&eeprom_factory_8000>;
218 nvmem-cell-names = "eeprom";
219 ieee80211-freq-limit = <5000000 6000000>;
220 };
221 };