ramips: mt7621: add support for Xiaomi Mi Router 4A Gigabit v2
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-4a-common.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_yellow;
11 led-failsafe = &led_status_yellow;
12 led-running = &led_status_blue;
13 led-upgrade = &led_status_yellow;
14 };
15
16 chosen {
17 bootargs = "console=ttyS0,115200n8";
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28 };
29 };
30
31 &spi0 {
32 status = "okay";
33
34 flash@0 {
35 compatible = "jedec,spi-nor";
36 reg = <0>;
37 spi-max-frequency = <50000000>;
38 m25p,fast-read;
39
40 partitions: partitions {
41 compatible = "fixed-partitions";
42 #address-cells = <1>;
43 #size-cells = <1>;
44
45 partition@0 {
46 label = "u-boot";
47 reg = <0x0 0x30000>;
48 read-only;
49 };
50
51 partition@30000 {
52 label = "u-boot-env";
53 reg = <0x30000 0x10000>;
54 read-only;
55 };
56
57 partition@40000 {
58 label = "Bdata";
59 reg = <0x40000 0x10000>;
60 read-only;
61 };
62
63 factory: partition@50000 {
64 label = "factory";
65 reg = <0x50000 0x10000>;
66 read-only;
67 };
68
69 partition@60000 {
70 label = "crash";
71 reg = <0x60000 0x10000>;
72 read-only;
73 };
74
75 partition@70000 {
76 label = "cfg_bak";
77 reg = <0x70000 0x10000>;
78 read-only;
79 };
80
81 partition@80000 {
82 label = "overlay";
83 reg = <0x80000 0x100000>;
84 read-only;
85 };
86
87 firmware: partition@180000 {
88 compatible = "denx,uimage";
89 label = "firmware";
90 reg = <0x180000 0xe80000>;
91 };
92 };
93 };
94 };
95
96 &pcie {
97 status = "okay";
98 };
99
100 &pcie0 {
101 wifi0: wifi@0,0 {
102 compatible = "mediatek,mt76";
103 reg = <0x0000 0 0 0 0>;
104 };
105 };
106
107 &pcie1 {
108 wifi1: wifi@0,0 {
109 compatible = "mediatek,mt76";
110 reg = <0x0000 0 0 0 0>;
111 };
112 };
113
114 &gmac0 {
115 nvmem-cells = <&macaddr_factory_e000>;
116 nvmem-cell-names = "mac-address";
117 };
118
119 &state_default {
120 gpio {
121 groups = "jtag", "uart2", "uart3", "wdt";
122 function = "gpio";
123 };
124 };
125
126 &factory {
127 compatible = "nvmem-cells";
128 #address-cells = <1>;
129 #size-cells = <1>;
130
131 macaddr_factory_e000: macaddr@e000 {
132 reg = <0xe000 0x6>;
133 };
134
135 macaddr_factory_e006: macaddr@e006 {
136 reg = <0xe006 0x6>;
137 };
138 };