5f1c01b35e9090634f7bfd8c8863bfd280a21bca
[openwrt/staging/wigyori.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 label = "green:power";
41 color = <LED_COLOR_ID_GREEN>;
42 function = LED_FUNCTION_POWER;
43 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
44 };
45
46 // RALINK_REG_PIO3924DATA 39-24
47 led_internet: internet {
48 label = "green:internet";
49 color = <LED_COLOR_ID_GREEN>;
50 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
51 };
52
53 // RALINK_REG_PIO7140DATA 44-40
54 led_wlan_2_4ghz: wlan_2_4ghz {
55 label = "green:wlan2g";
56 color = <LED_COLOR_ID_GREEN>;
57 function = LED_FUNCTION_WLAN;
58 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
59 linux,default-trigger = "phy1tpt";
60 };
61
62 // RALINK_REG_PIO7140DATA 43-40
63 led_wlan_5ghz: wlan_5ghz {
64 label = "green:wlan5g";
65 color = <LED_COLOR_ID_GREEN>;
66 function = LED_FUNCTION_WLAN;
67 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
68 linux,default-trigger = "phy0tpt";
69 };
70
71 // RALINK_REG_PIO7140DATA 42-40
72 led_firmware: firmware {
73 label = "green:firmware";
74 color = <LED_COLOR_ID_GREEN>;
75 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
76 // default-state = "keep";
77 };
78
79 // RALINK_REG_PIO7140DATA 41-40
80 led_vpn: vpn {
81 label = "green:vpn";
82 color = <LED_COLOR_ID_GREEN>;
83 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &gdma {
89 status = "okay";
90 };
91
92 // Vendor firmware: RALINK_REG_PIO7140 - gpio0: gpio@600
93 // Vendor firmware: RALINK_REG_PIO3924 - gpio1: gpio@638
94 // Vendor firmware: RALINK_REG_PIO7140 - gpio2: gpio@660
95 // Vendor firmware: RALINK_REG_PIO72 - gpio3: gpio@688
96
97 &gpio1 {
98 status = "okay";
99 };
100
101 &gpio2 {
102 status = "okay";
103 };
104
105 &spi0 {
106 status = "okay";
107
108 flash@0 {
109 compatible = "jedec,spi-nor";
110 reg = <0>;
111 spi-max-frequency = <10000000>;
112
113 partitions {
114 compatible = "fixed-partitions";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 // Vendor partitions:
119 // 0x000000000000-0x000000030000 : "Bootloader"
120 // 0x000000030000-0x000000040000 : "Config"
121 // 0x000000040000-0x000000050000 : "Factory"
122 // 0x000000050000-0x000000070000 : "Cimage"
123 // 0x000000070000-0x000000fe0000 : "Uimage"
124 // 0x000000070000-0x000000190000 : "Kernel"
125 // 0x000000190000-0x000000fe0000 : "RootFS"
126 // 0x000000fe0000-0x000001000000 : "FreeSpace"
127
128 // Bootloader
129 partition@0 {
130 label = "u-boot";
131 reg = <0x0 0x30000>;
132 read-only;
133 };
134
135 // Config
136 partition@30000 {
137 label = "u-boot-env";
138 reg = <0x30000 0x10000>;
139 read-only;
140 };
141
142 // Factory
143 factory: partition@40000 {
144 label = "factory";
145 reg = <0x40000 0x10000>;
146 read-only;
147 };
148
149 // Cimage
150 partition@50000 {
151 label = "cimage";
152 reg = <0x50000 0x20000>;
153 read-only;
154 };
155
156 partition@70000 {
157 compatible = "openwrt,uimage", "denx,uimage";
158 openwrt,offset = <FW_EDIMAX_OFFSET>;
159 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
160 label = "firmware";
161 reg = <0x00070000 0x00f70000>;
162 };
163
164 // FreeSpace
165 partition@fe0000 {
166 label = "freespace";
167 reg = <0xfe0000 0x20000>;
168 read-only;
169 };
170 };
171 };
172 };
173
174 &state_default {
175 gpio {
176 // TODO: "spi refclk"?
177 groups = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
178 function = "gpio";
179 };
180 };
181
182 &ethernet {
183 nvmem-cells = <&macaddr_factory_2e>;
184 nvmem-cell-names = "mac-address";
185
186 mediatek,portmap = "llllw";
187 };
188
189 &wmac {
190 ralink,mtd-eeprom = <&factory 0x0>;
191 };
192
193 &pcie {
194 status = "okay";
195 };
196
197 &pcie0 {
198 wifi@0,0 {
199 reg = <0x0000 0 0 0 0>;
200 mediatek,mtd-eeprom = <&factory 0x8000>;
201 ieee80211-freq-limit = <5000000 6000000>;
202 };
203 };
204
205 &factory {
206 compatible = "nvmem-cells";
207 #address-cells = <1>;
208 #size-cells = <1>;
209
210 macaddr_factory_4: macaddr@4 {
211 reg = <0x4 0x6>;
212 };
213
214 macaddr_factory_2e: macaddr@2e {
215 reg = <0x2e 0x6>;
216 };
217 };