ramips: add support for ipTIME A3004T
[openwrt/staging/mkresin.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 label = "factory";
80 reg = <0xa0000 0x20000>;
81 read-only;
82
83 compatible = "nvmem-cells";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 macaddr_factory_4: macaddr@4 {
88 reg = <0x4 0x6>;
89 };
90
91 macaddr_factory_8004: macaddr@8004 {
92 reg = <0x8004 0x6>;
93 };
94 };
95
96 partition@140000 {
97 label = "firmware";
98 reg = <0x140000 0x7e40000>;
99
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "kernel";
106 reg = <0x0 0x400000>;
107 };
108
109 partition@400000 {
110 label = "ubi";
111 reg = <0x400000 0x7a40000>;
112 };
113 };
114 };
115 };
116
117 &gmac0 {
118 nvmem-cells = <&macaddr_factory_4>;
119 nvmem-cell-names = "mac-address";
120 mac-address-increment = <(3)>;
121 };
122
123 &switch0 {
124 ports {
125 port@0 {
126 status = "okay";
127 label = "wan";
128 nvmem-cells = <&macaddr_factory_4>;
129 nvmem-cell-names = "mac-address";
130 mac-address-increment = <(1)>;
131 };
132
133 port@1 {
134 status = "okay";
135 label = "lan4";
136 };
137
138 port@2 {
139 status = "okay";
140 label = "lan3";
141 };
142
143 port@3 {
144 status = "okay";
145 label = "lan2";
146 };
147
148 port@4 {
149 status = "okay";
150 label = "lan1";
151 };
152 };
153 };
154
155 &pcie {
156 status = "okay";
157 };
158
159 &pcie0 {
160 wifi@0,0 {
161 compatible = "mediatek,mt76";
162 reg = <0x0000 0 0 0 0>;
163 mediatek,mtd-eeprom = <&factory 0x0>;
164 };
165 };
166
167 &state_default {
168 gpio {
169 groups = "i2c", "jtag", "wdt";
170 function = "gpio";
171 };
172 };