286c4dda49ac64bdcf14e04be1faa8ebe885f76d
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_iptime_a3002mesh.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,a3002mesh", "mediatek,mt7621-soc";
11 model = "ipTIME A3002MESH";
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 color = <LED_COLOR_ID_AMBER>;
25 function = LED_FUNCTION_CPU;
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 };
28
29 led-1 {
30 color = <LED_COLOR_ID_AMBER>;
31 function = LED_FUNCTION_WLAN;
32 function-enumerator = <0>;
33 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
34 linux,default-trigger = "phy0radio";
35 };
36
37 led-2 {
38 color = <LED_COLOR_ID_AMBER>;
39 function = LED_FUNCTION_WLAN;
40 function-enumerator = <1>;
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 &spi0 {
58 status = "okay";
59
60 flash@0 {
61 compatible = "jedec,spi-nor";
62 reg = <0>;
63 spi-max-frequency = <50000000>;
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 0x20000>;
73 read-only;
74
75 nvmem-layout {
76 compatible = "fixed-layout";
77 #address-cells = <1>;
78 #size-cells = <1>;
79
80 macaddr_uboot_1fc40: macaddr@1fc40 {
81 compatible = "mac-base";
82 reg = <0x1fc40 0x6>;
83 #nvmem-cell-cells = <1>;
84 };
85 };
86 };
87
88 partition@20000 {
89 label = "config";
90 reg = <0x20000 0x10000>;
91 read-only;
92 };
93
94 factory: partition@30000 {
95 label = "factory";
96 reg = <0x30000 0x10000>;
97 read-only;
98
99 nvmem-layout {
100 compatible = "fixed-layout";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 eeprom_factory_0: eeprom@0 {
105 reg = <0x0 0x4da8>;
106 };
107 };
108 };
109
110 partition@40000 {
111 compatible = "denx,uimage";
112 label = "firmware";
113 reg = <0x40000 0xfc0000>;
114 };
115 };
116 };
117 };
118
119 &gmac0 {
120 nvmem-cells = <&macaddr_uboot_1fc40 2>;
121 nvmem-cell-names = "mac-address";
122 };
123
124 &gmac1 {
125 status = "okay";
126 label = "wan";
127 phy-handle = <&ethphy0>;
128
129 nvmem-cells = <&macaddr_uboot_1fc40 0>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &mdio {
134 ethphy0: ethernet-phy@0 {
135 reg = <0>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@3 {
142 status = "okay";
143 label = "lan1";
144 };
145
146 port@4 {
147 status = "okay";
148 label = "lan2";
149 };
150 };
151 };
152
153 &pcie {
154 status = "okay";
155 };
156
157 &pcie0 {
158 wifi@0,0 {
159 compatible = "mediatek,mt76";
160 reg = <0x0000 0 0 0 0>;
161 nvmem-cells = <&eeprom_factory_0>;
162 nvmem-cell-names = "eeprom";
163 };
164 };
165
166 &state_default {
167 gpio {
168 groups = "i2c", "jtag", "wdt";
169 function = "gpio";
170 };
171 };