ramips: add support for Sercomm CPJ routers
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dual-q_h721.dts
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 compatible = "dual-q,h721", "mediatek,mt7621-soc";
10 model = "Dual-Q H721";
11
12 aliases {
13 led-boot = &led_status;
14 led-failsafe = &led_status;
15 led-running = &led_status;
16 led-upgrade = &led_status;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 gpio-export {
24 compatible = "gpio-export";
25 #size-cells = <0>;
26
27 usb-30-power {
28 gpio-export,name = "usb-30-power";
29 gpio-export,output = <0>;
30 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
31 };
32
33 usb-20-power {
34 gpio-export,name = "usb-20-power";
35 gpio-export,output = <0>;
36 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48 };
49
50 leds {
51 compatible = "gpio-leds";
52
53 usb1 {
54 label = "green:usb1";
55 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
56 };
57
58 sig1 {
59 label = "green:sig1";
60 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
61 };
62
63 usb2 {
64 label = "green:usb2";
65 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
66 };
67
68 sig2 {
69 label = "green:sig2";
70 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
71 };
72
73 tf {
74 label = "green:tf";
75 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
76 };
77
78 wifi1 {
79 label = "green:wifi1";
80 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
81 };
82
83 wifi2 {
84 label = "green:wifi2";
85 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
86 };
87
88 led_status: status {
89 label = "green:status";
90 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
91 };
92 };
93 };
94
95 &spi0 {
96 status = "okay";
97
98 flash@0 {
99 compatible = "jedec,spi-nor";
100 reg = <0>;
101 spi-max-frequency = <40000000>;
102
103 partitions {
104 compatible = "fixed-partitions";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 partition@0 {
109 label = "bootloader";
110 reg = <0x0 0x30000>;
111 read-only;
112 };
113
114 partition@30000 {
115 label = "config";
116 reg = <0x30000 0x10000>;
117 read-only;
118 };
119
120 partition@40000 {
121 label = "factory";
122 reg = <0x40000 0x10000>;
123 read-only;
124
125 compatible = "nvmem-cells";
126 #address-cells = <1>;
127 #size-cells = <1>;
128
129 macaddr_factory_e000: macaddr@e000 {
130 reg = <0xe000 0x6>;
131 };
132 };
133
134 partition@50000 {
135 compatible = "denx,uimage";
136 label = "firmware";
137 reg = <0x50000 0xfb0000>;
138 };
139 };
140 };
141 };
142
143 &sdhci {
144 status = "okay";
145 };
146
147 &pcie {
148 status = "okay";
149 };
150
151 &switch0 {
152 ports {
153 port@0 {
154 status = "okay";
155 label = "lan1";
156 };
157
158 port@1 {
159 status = "okay";
160 label = "lan2";
161 };
162
163 port@2 {
164 status = "okay";
165 label = "lan3";
166 };
167
168 port@3 {
169 status = "okay";
170 label = "lan4";
171 };
172
173 port@4 {
174 status = "okay";
175 label = "wan";
176
177 nvmem-cells = <&macaddr_factory_e000>;
178 nvmem-cell-names = "mac-address";
179 mac-address-increment = <1>;
180 };
181 };
182 };
183
184 &ethernet {
185 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
186 };
187
188 &gmac0 {
189 nvmem-cells = <&macaddr_factory_e000>;
190 nvmem-cell-names = "mac-address";
191 };
192
193 &state_default {
194 gpio {
195 groups = "jtag", "wdt", "rgmii2";
196 function = "gpio";
197 };
198 };