ramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_ampedwireless_ally.dtsi
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 aliases {
10 led-boot = &led_status_amber;
11 led-failsafe = &led_status_amber;
12 led-running = &led_status_green;
13 led-upgrade = &led_status_red;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 led_switch {
20 label = "led_switch";
21 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
22 linux,code = <KEY_LIGHTS_TOGGLE>;
23 linux,input-type = <EV_SW>;
24 };
25
26 reset {
27 label = "reset";
28 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31
32 wps {
33 label = "wps";
34 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
35 linux,code = <KEY_WPS_BUTTON>;
36 };
37 };
38
39 leds {
40 compatible = "gpio-leds";
41
42 led_status_green: status_green {
43 label = "green:status";
44 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
45 };
46
47 led_status_red: status_red {
48 label = "red:status";
49 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
50 };
51
52 led_status_amber: status_amber {
53 label = "amber:status";
54 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
55 };
56 };
57 };
58
59 &pcie {
60 status = "okay";
61 };
62
63 &pcie0 {
64 wifi@0,0 {
65 compatible = "pci14c3,7615";
66 reg = <0x0000 0 0 0 0>;
67 mediatek,mtd-eeprom = <&factory 0x0000>;
68 ieee80211-freq-limit = <2400000 2500000>;
69 };
70 };
71
72 &pcie1 {
73 wifi@0,0 {
74 compatible = "pci14c3,7615";
75 reg = <0x0000 0 0 0 0>;
76 mediatek,mtd-eeprom = <&factory 0x8000>;
77 ieee80211-freq-limit = <5000000 6000000>;
78 };
79 };
80
81 &state_default {
82 gpio {
83 groups = "uart2", "uart3", "jtag", "wdt";
84 function = "gpio";
85 };
86 };
87
88 &nand {
89 status = "okay";
90
91 partitions {
92 compatible = "fixed-partitions";
93 #address-cells = <1>;
94 #size-cells = <1>;
95
96 partition@0 {
97 label = "u-boot";
98 reg = <0x0 0x80000>;
99 read-only;
100 };
101
102 partition@80000 {
103 label = "u-boot-env";
104 reg = <0x80000 0x80000>;
105 };
106
107 factory: partition@100000 {
108 label = "factory";
109 reg = <0x100000 0x40000>;
110 read-only;
111 };
112
113 /*
114 * uboot expects to find kernels at 0x140000 & 0x2140000,
115 * referred to as Uimage & Uimage1 in factory FW, respectively.
116 * U-boot variable 'bootImage' controls which is booted;
117 * 0 for the first, 1 for the 2nd.
118 * There's a 3rd partition, Uimage2 (0x4140000), which
119 * I expected to be a recovery image, but is actually blank.
120 *
121 * A kernel is considered suitable for handing control over
122 * if its linux magic number exists & uImage CRC are correct.
123 * If either of those conditions fail, 'bootImage' value
124 * is toggled in uboot env & a restart performed in the hope that the
125 * alternate kernel is okay.
126 *
127 * Note uboot's tftp flash install writes the transferred
128 * image to the active kernel partition.
129 */
130
131 partition@140000 {
132 label = "kernel";
133 reg = <0x140000 0x400000>;
134 };
135
136 partition@540000 {
137 label = "ubi";
138 reg = <0x540000 0x1c00000>;
139 };
140
141 partition@2140000 {
142 label = "oem";
143 reg = <0x2140000 0x2000000>;
144 };
145
146 partition@4140000 {
147 label = "backup";
148 reg = <0x4140000 0x2000000>;
149 };
150
151 partition@6140000 {
152 label = "chime";
153 reg = <0x6140000 0xa00000>;
154 };
155
156 partition@6b40000 {
157 label = "data";
158 reg = <0x6b40000 0xa00000>;
159 };
160
161 partition@7540000 {
162 label = "reserved";
163 reg = <0x7540000 0x840000>;
164 read-only;
165 };
166
167 partition@7d80000 {
168 label = "nvram";
169 reg = <0x7d80000 0x100000>;
170 read-only;
171 };
172
173 partition@7e80000 {
174 label = "hwconfig";
175 reg = <0x7e80000 0x100000>;
176 read-only;
177 };
178 };
179 };