ramips: add support for DomyWifi DM202/DM203/DW22D
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_domywifi.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_system_amber;
11 led-failsafe = &led_system_amber;
12 led-running = &led_system_green;
13 led-upgrade = &led_system_amber;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "reset";
21 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_RESTART>;
23 };
24 };
25
26 leds {
27 compatible = "gpio-leds";
28
29 led_system_green: system_green {
30 label = "green:system";
31 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
32 };
33
34 led_system_amber: system_amber {
35 label = "amber:system";
36 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
37 };
38
39 internet_green {
40 label = "green:internet";
41 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
42 };
43
44 internet_amber {
45 label = "amber:internet";
46 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
47 };
48
49 lan1 {
50 label = "amber:lan1";
51 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
52 };
53
54 lan2 {
55 label = "amber:lan2";
56 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
57 };
58
59 lan3 {
60 label = "amber:lan3";
61 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
62 };
63
64 lan4 {
65 label = "amber:lan4";
66 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
67 };
68
69 wan {
70 label = "amber:wan";
71 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
72 };
73
74 wlan2g {
75 label = "green:wlan2g";
76 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
77 linux,default-trigger = "phy1tpt";
78 };
79 };
80 };
81
82 &gpio1 {
83 status = "okay";
84 };
85
86 &gpio3 {
87 status = "okay";
88 };
89
90 &spi0 {
91 status = "okay";
92
93 flash@0 {
94 compatible = "jedec,spi-nor";
95 reg = <0>;
96 spi-max-frequency = <80000000>;
97 m25p,fast-read;
98
99 partitions {
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "bootloader";
106 reg = <0x0 0x30000>;
107 read-only;
108 };
109
110 partition@30000 {
111 label = "config";
112 reg = <0x30000 0x10000>;
113 read-only;
114 };
115
116 factory: partition@40000 {
117 label = "factory";
118 reg = <0x40000 0x10000>;
119 read-only;
120 };
121
122 partition@50000 {
123 compatible = "denx,uimage";
124 label = "firmware";
125 reg = <0x50000 0xfb0000>;
126 };
127 };
128 };
129 };
130
131 &state_default {
132 gpio {
133 groups = "uartf", "rgmii1", "wled";
134 function = "gpio";
135 };
136 };
137
138 &ethernet {
139 pinctrl-names = "default";
140 pinctrl-0 = <&ephy_pins>;
141
142 mediatek,portmap = "wllll";
143
144 nvmem-cells = <&macaddr_factory_28>;
145 nvmem-cell-names = "mac-address";
146 };
147
148 &sdhci {
149 status = "okay";
150 };
151
152 &ehci {
153 status = "okay";
154 };
155
156 &ohci {
157 status = "okay";
158 };
159
160 &pcie {
161 status = "okay";
162 };
163
164 &pcie0 {
165 wifi@0,0 {
166 reg = <0x0000 0 0 0 0>;
167 mediatek,mtd-eeprom = <&factory 0x8000>;
168 ieee80211-freq-limit = <5000000 6000000>;
169
170 led {
171 led-sources = <0>;
172 led-active-low;
173 };
174 };
175 };
176
177 &wmac {
178 ralink,mtd-eeprom = <&factory 0x0>;
179 };
180
181 &factory {
182 compatible = "nvmem-cells";
183 #address-cells = <1>;
184 #size-cells = <1>;
185
186 macaddr_factory_28: macaddr@28 {
187 reg = <0x28 0x6>;
188 };
189 };