ramips: add support for D-Link DIR-878 A1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dlink_dir-878-a1.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 = "dlink,dir-878-a1", "mediatek,mt7621-soc";
11 model = "D-Link DIR-878 A1";
12
13 aliases {
14 led-boot = &led_power_orange;
15 led-failsafe = &led_power_green;
16 led-running = &led_power_green;
17 led-upgrade = &led_net_orange;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,57600";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led_power_orange: power_orange {
29 label = "dir-878-a1:orange:power";
30 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
31 };
32
33 led_power_green: power_green {
34 label = "dir-878-a1:green:power";
35 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
36 };
37
38 led_net_orange: net_orange {
39 label = "dir-878-a1:orange:net";
40 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
41 };
42
43 net_green {
44 label = "dir-878-a1:green:net";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 };
47 };
48
49 keys {
50 compatible = "gpio-keys";
51
52 reset {
53 label = "reset";
54 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_RESTART>;
56 };
57
58 wps {
59 label = "wps";
60 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_WPS_BUTTON>;
62 };
63
64 wifi {
65 label = "wifi";
66 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
67 linux,code = <KEY_RFKILL>;
68 };
69 };
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <50000000>;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "u-boot-env";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x20000>;
100 read-only;
101 };
102
103 partition@60000 {
104 compatible = "sge,uimage";
105 label = "firmware";
106 reg = <0x60000 0xfa0000>;
107 };
108 };
109 };
110 };
111
112 &pcie {
113 status = "okay";
114 };
115
116 &pcie0 {
117 wifi@0,0 {
118 compatible = "mediatek,mt76";
119 reg = <0x0000 0 0 0 0>;
120 mediatek,mtd-eeprom = <&factory 0x0000>;
121 ieee80211-freq-limit = <2400000 2500000>;
122
123 led {
124 led-active-low;
125 };
126 };
127 };
128
129 &pcie1 {
130 wifi@0,0 {
131 compatible = "mediatek,mt76";
132 reg = <0x0000 0 0 0 0>;
133 mediatek,mtd-eeprom = <&factory 0x8000>;
134 ieee80211-freq-limit = <5000000 6000000>;
135
136 led {
137 led-active-low;
138 };
139 };
140 };
141
142 &gmac0 {
143 mtd-mac-address = <&factory 0xe000>;
144 };
145
146 &switch0 {
147 ports {
148 port@0 {
149 status = "okay";
150 label = "lan4";
151 };
152
153 port@1 {
154 status = "okay";
155 label = "lan3";
156 };
157
158 port@2 {
159 status = "okay";
160 label = "lan2";
161 };
162
163 port@3 {
164 status = "okay";
165 label = "lan1";
166 };
167
168 port@4 {
169 status = "okay";
170 label = "wan";
171 mtd-mac-address = <&factory 0xe006>;
172 };
173 };
174 };
175
176 &state_default {
177 gpio {
178 groups = "i2c", "uart3", "jtag", "wdt";
179 function = "gpio";
180 };
181 };