ramips: add support for Z-ROUTER ZR-2660
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iptime_ax2004m.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "iptime,ax2004m", "mediatek,mt7621-soc";
11 model = "ipTIME AX2004M";
12
13 aliases {
14 led-boot = &led_cpu;
15 led-failsafe = &led_cpu;
16 led-running = &led_cpu;
17 led-upgrade = &led_cpu;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_cpu: cpu {
28 function = LED_FUNCTION_CPU;
29 color = <LED_COLOR_ID_AMBER>;
30 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31 };
32
33 wlan2g {
34 label = "amber:wlan2g";
35 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
36 linux,default-trigger = "phy0radio";
37 };
38
39 wlan5g {
40 label = "amber:wlan5g";
41 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
42 linux,default-trigger = "phy1radio";
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 reset {
50 label = "reset";
51 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_RESTART>;
53 };
54 };
55 };
56
57 &nand {
58 status = "okay";
59
60 mediatek,nmbm;
61 mediatek,bmt-max-ratio = <1>;
62 mediatek,bmt-max-reserved-blocks = <64>;
63 mediatek,bmt-remap-range = <0x000000 0x580000>;
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x80000>;
73 read-only;
74 };
75
76 partition@80000 {
77 label = "u-boot-env";
78 reg = <0x80000 0x80000>;
79 };
80
81 partition@100000 {
82 label = "factory";
83 reg = <0x100000 0x80000>;
84 read-only;
85
86 nvmem-layout {
87 compatible = "fixed-layout";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0xe00>;
93 };
94
95 macaddr_factory_4: macaddr@4 {
96 compatible = "mac-base";
97 reg = <0x4 0x6>;
98 #nvmem-cell-cells = <1>;
99 };
100
101 precal_factory_e10: precal@e10 {
102 reg = <0xe10 0x19c10>;
103 };
104 };
105 };
106
107 partition@180000 {
108 label = "firmware";
109 reg = <0x180000 0x7680000>;
110
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "kernel";
117 reg = <0x0 0x400000>;
118 };
119
120 partition@400000 {
121 label = "ubi";
122 reg = <0x400000 0x7280000>;
123 };
124 };
125
126 /* last 8 MiB is reserved for NMBM bad block table */
127 };
128 };
129
130 &state_default {
131 gpio {
132 groups = "i2c", "jtag", "wdt";
133 function = "gpio";
134 };
135 };
136
137 &gmac0 {
138 nvmem-cells = <&macaddr_factory_4 3>;
139 nvmem-cell-names = "mac-address";
140 };
141
142 &gmac1 {
143 status = "okay";
144 label = "wan";
145 phy-handle = <&ethphy0>;
146
147 nvmem-cells = <&macaddr_factory_4 1>;
148 nvmem-cell-names = "mac-address";
149 };
150
151 &mdio {
152 ethphy0: ethernet-phy@0 {
153 reg = <0>;
154 };
155 };
156
157 &switch0 {
158 ports {
159 port@1 {
160 status = "okay";
161 label = "lan4";
162 };
163
164 port@2 {
165 status = "okay";
166 label = "lan3";
167 };
168
169 port@3 {
170 status = "okay";
171 label = "lan2";
172 };
173
174 port@4 {
175 status = "okay";
176 label = "lan1";
177 };
178 };
179 };
180
181 &pcie {
182 status = "okay";
183 };
184
185 &pcie1 {
186 wifi@0,0 {
187 compatible = "mediatek,mt76";
188 reg = <0x0000 0 0 0 0>;
189 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
190 nvmem-cell-names = "eeprom", "precal";
191 };
192 };