000657c8667e8156f7b756725a5d29f79f9e66b8
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_iptime_a3004t.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,a3004t", "mediatek,mt7621-soc";
11 model = "ipTIME A3004T";
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 leds {
21 compatible = "gpio-leds";
22
23 led_cpu: led-0 {
24 label = "amber:cpu";
25 color = <LED_COLOR_ID_AMBER>;
26 function = LED_FUNCTION_CPU;
27 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
28 };
29
30 led-1 {
31 color = <LED_COLOR_ID_AMBER>;
32 function = LED_FUNCTION_WLAN;
33 function-enumerator = <0>;
34 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
35 linux,default-trigger = "phy0radio";
36 };
37
38 led-2 {
39 color = <LED_COLOR_ID_AMBER>;
40 function = LED_FUNCTION_WLAN;
41 function-enumerator = <1>;
42 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
43 linux,default-trigger = "phy1radio";
44 };
45 };
46
47 keys {
48 compatible = "gpio-keys";
49
50 reset {
51 label = "reset";
52 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_RESTART>;
54 };
55 };
56 };
57
58 &nand {
59 status = "okay";
60
61 partitions {
62 compatible = "fixed-partitions";
63 #address-cells = <1>;
64 #size-cells = <1>;
65
66 partition@0 {
67 label = "u-boot";
68 reg = <0x0 0x80000>;
69 read-only;
70 };
71
72 partition@80000 {
73 label = "config";
74 reg = <0x80000 0x20000>;
75 read-only;
76 };
77
78 factory: partition@a0000 {
79 compatible = "nvmem-cells";
80 label = "factory";
81 reg = <0xa0000 0x20000>;
82 #address-cells = <1>;
83 #size-cells = <1>;
84 read-only;
85
86 eeprom_factory_0: eeprom@0 {
87 reg = <0x0 0x4da8>;
88 };
89
90 macaddr_factory_4: macaddr@4 {
91 reg = <0x4 0x6>;
92 };
93
94 macaddr_factory_8004: macaddr@8004 {
95 reg = <0x8004 0x6>;
96 };
97 };
98
99 partition@140000 {
100 label = "firmware";
101 reg = <0x140000 0x7e40000>;
102
103 compatible = "fixed-partitions";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 partition@0 {
108 label = "kernel";
109 reg = <0x0 0x400000>;
110 };
111
112 partition@400000 {
113 label = "ubi";
114 reg = <0x400000 0x7a40000>;
115 };
116 };
117 };
118 };
119
120 &gmac0 {
121 nvmem-cells = <&macaddr_factory_4>;
122 nvmem-cell-names = "mac-address";
123 mac-address-increment = <(3)>;
124 };
125
126 &gmac1 {
127 status = "okay";
128 label = "wan";
129 phy-handle = <&ethphy0>;
130
131 nvmem-cells = <&macaddr_factory_4>;
132 nvmem-cell-names = "mac-address";
133 mac-address-increment = <(1)>;
134 };
135
136 &mdio {
137 ethphy0: ethernet-phy@0 {
138 reg = <0>;
139 };
140 };
141
142 &switch0 {
143 ports {
144 port@1 {
145 status = "okay";
146 label = "lan4";
147 };
148
149 port@2 {
150 status = "okay";
151 label = "lan3";
152 };
153
154 port@3 {
155 status = "okay";
156 label = "lan2";
157 };
158
159 port@4 {
160 status = "okay";
161 label = "lan1";
162 };
163 };
164 };
165
166 &pcie {
167 status = "okay";
168 };
169
170 &pcie0 {
171 wifi@0,0 {
172 compatible = "mediatek,mt76";
173 reg = <0x0000 0 0 0 0>;
174 nvmem-cells = <&eeprom_factory_0>;
175 nvmem-cell-names = "eeprom";
176 };
177 };
178
179 &state_default {
180 gpio {
181 groups = "i2c", "jtag", "wdt";
182 function = "gpio";
183 };
184 };