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