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