ramips: mt7621: convert GPIO dts refs
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mir3p.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10 compatible = "xiaomi,mir3p", "mediatek,mt7621-soc";
11 model = "Xiaomi Mi Router 3 Pro";
12
13 aliases {
14 led-boot = &led_status_yellow;
15 led-failsafe = &led_status_red;
16 led-running = &led_status_blue;
17 led-upgrade = &led_status_yellow;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200n8";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_red: status_red {
28 label = "mir3p:red:status";
29 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
30 };
31
32 led_status_blue: status_blue {
33 label = "mir3p:blue:status";
34 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_yellow: status_yellow {
38 label = "mir3p:yellow:status";
39 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
40 };
41
42 wan_amber {
43 label = "mir3p:amber:wan";
44 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
45 };
46
47 lan3_amber {
48 label = "mir3p:amber:lan3";
49 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
50 };
51
52 lan2_amber {
53 label = "mir3p:amber:lan2";
54 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
55 };
56
57 lan1_amber {
58 label = "mir3p:amber:lan1";
59 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
60 };
61 };
62
63 keys {
64 compatible = "gpio-keys";
65
66 reset {
67 label = "reset";
68 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_RESTART>;
70 };
71 };
72
73 reg_usb_vbus: regulator {
74 compatible = "regulator-fixed";
75 regulator-name = "usb_vbus";
76 regulator-min-microvolt = <5000000>;
77 regulator-max-microvolt = <5000000>;
78 gpio = <&gpio 12 GPIO_ACTIVE_HIGH>;
79 enable-active-high;
80 };
81 };
82
83 &xhci {
84 vbus-supply = <&reg_usb_vbus>;
85 };
86
87 &nand {
88 status = "okay";
89
90 partitions {
91 compatible = "fixed-partitions";
92 #address-cells = <1>;
93 #size-cells = <1>;
94
95 partition@0 {
96 label = "Bootloader";
97 reg = <0x0 0x40000>;
98 read-only;
99 };
100
101 partition@40000 {
102 label = "Config";
103 reg = <0x40000 0x40000>;
104 };
105
106 partition@80000 {
107 label = "Bdata";
108 reg = <0x80000 0x40000>;
109 read-only;
110 };
111
112 factory: partition@c0000 {
113 label = "factory";
114 reg = <0x0c0000 0x40000>;
115 read-only;
116 };
117
118 partition@100000 {
119 label = "crash";
120 reg = <0x100000 0x40000>;
121 };
122
123 partition@140000 {
124 label = "crash_syslog";
125 reg = <0x140000 0x80000>;
126 };
127
128 partition@1c0000 {
129 label = "reserved0";
130 reg = <0x1c0000 0x40000>;
131 read-only;
132 };
133
134 /* We keep stock xiaomi firmware (kernel0) here */
135 partition@200000 {
136 label = "kernel_stock";
137 reg = <0x200000 0x400000>;
138 };
139
140 partition@600000 {
141 label = "kernel";
142 reg = <0x600000 0x400000>;
143 };
144
145 partition@a00000 {
146 label = "ubi";
147 reg = <0xa00000 0xf580000>;
148 };
149 };
150 };
151
152 &pcie {
153 status = "okay";
154 };
155
156 &pcie0 {
157 wifi@0,0 {
158 compatible = "mediatek,mt76";
159 reg = <0x0000 0 0 0 0>;
160 mediatek,mtd-eeprom = <&factory 0x0000>;
161 ieee80211-freq-limit = <2400000 2500000>;
162 };
163 };
164
165 &pcie1 {
166 wifi@0,0 {
167 compatible = "mediatek,mt76";
168 reg = <0x0000 0 0 0 0>;
169 mediatek,mtd-eeprom = <&factory 0x8000>;
170 ieee80211-freq-limit = <5000000 6000000>;
171 };
172 };
173
174 &ethernet {
175 mtd-mac-address = <&factory 0xe000>;
176 mediatek,portmap = "llllw";
177 };
178
179 &state_default {
180 gpio {
181 ralink,group = "jtag", "uart2", "uart3", "wdt";
182 ralink,function = "gpio";
183 };
184 };