ramips: improve support for STORYLiNK SAP-G3200U3
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_yuncore_ax820.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/leds/common.h>
8
9 / {
10 compatible = "yuncore,ax820", "mediatek,mt7621-soc";
11 model = "YunCore AX820";
12
13 aliases {
14 led-boot = &led_system;
15 led-failsafe = &led_system;
16 led-running = &led_system;
17 led-upgrade = &led_system;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 /* At least 2 AX820 variants are known and cannot be distinguished (same hw rev):
28 - System LED green GPIO 15; red and blue apparently not connected
29 - System LED red GPIO 15, WLAN2G LED green GPIO 14, WLAN5G LED blue GPIO 16
30 The canonical values taken from a Yuncore datasheet are:
31 - System LED green GPIO 15, WLAN2G LED blue GPIO 14, WLAN5G LED red GPIO 16
32 All 3 colors relate to the same single RGB LED showing up on the front lightpipe.
33 As a result, all 3 LEDs are defined even if only one may be available, and
34 the color information is absent as it is not reliable */
35 wlan2g {
36 label = "wlan2g";
37 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
38 linux,default-trigger = "phy0radio";
39 };
40
41 led_system: system {
42 label = "system";
43 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
44 };
45
46 wlan5g {
47 label = "wlan5g";
48 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
49 linux,default-trigger = "phy1radio";
50 };
51
52 wan {
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_WAN;
55 gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
56 };
57
58 lan {
59 color = <LED_COLOR_ID_GREEN>;
60 function = LED_FUNCTION_LAN;
61 gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
62 };
63 };
64
65 watchdog {
66 compatible = "linux,wdt-gpio";
67 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
68 hw_algo = "toggle";
69 hw_margin_ms = <200>;
70 always-running;
71 };
72
73 keys {
74 compatible = "gpio-keys";
75
76 reset {
77 label = "reset";
78 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
79 linux,code = <KEY_RESTART>;
80 };
81 };
82 };
83
84 &spi0 {
85 status = "okay";
86
87 flash@0 {
88 compatible = "jedec,spi-nor";
89 reg = <0>;
90 spi-max-frequency = <80000000>;
91 m25p,fast-read;
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "Bootloader";
100 reg = <0x0 0x30000>;
101 read-only;
102 };
103
104 partition@30000 {
105 label = "Config";
106 reg = <0x30000 0x10000>;
107 read-only;
108 };
109
110 /* range 0x40000 to 0x50000 is empty in vendor
111 * firmware, so we do not use it either
112 */
113
114 partition@50000 {
115 label = "Factory";
116 reg = <0x50000 0x40000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 eeprom_factory_0: eeprom@0 {
125 reg = <0x0 0xe00>;
126 };
127
128 precal_factory_e10: precal@e10 {
129 reg = <0xe10 0x19c10>;
130 };
131
132 macaddr_factory_e000: macaddr@e000 {
133 compatible = "mac-base";
134 reg = <0xe000 0x6>;
135 #nvmem-cell-cells = <1>;
136 };
137 };
138 };
139
140 partition@90000 {
141 compatible = "denx,uimage";
142 label = "firmware";
143 reg = <0x90000 0xf70000>;
144 };
145 };
146 };
147 };
148
149 &pcie {
150 status = "okay";
151 };
152
153 &pcie1 {
154 wifi@0,0 {
155 compatible = "mediatek,mt76";
156 reg = <0x0000 0 0 0 0>;
157 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
158 nvmem-cell-names = "eeprom", "precal";
159 mediatek,disable-radar-background;
160 };
161 };
162
163 &gmac0 {
164 nvmem-cells = <&macaddr_factory_e000 0>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &gmac1 {
169 status = "okay";
170 label = "wan";
171 phy-handle = <&ethphy0>;
172
173 nvmem-cells = <&macaddr_factory_e000 1>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &mdio {
178 ethphy0: ethernet-phy@0 {
179 reg = <0>;
180 };
181 };
182
183 &switch0 {
184 gpio-controller;
185 #gpio-cells = <2>;
186
187 ports {
188 port@1 {
189 status = "okay";
190 label = "lan";
191 };
192 };
193 };
194
195 &state_default {
196 gpio {
197 groups = "jtag", "wdt";
198 function = "gpio";
199 };
200 };