ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_alfa-network_ax1800rm.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 = "alfa-network,ax1800rm", "mediatek,mt7621-soc";
11 model = "ALFA Network AX1800RM";
12
13 aliases {
14 label-mac-device = &wifi0;
15 led-boot = &led_power;
16 led-failsafe = &led_wan_red;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "wps";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_WPS_BUTTON>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 lan1 {
45 label = "green:lan1";
46 color = <LED_COLOR_ID_GREEN>;
47 function = LED_FUNCTION_LAN;
48 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
49 };
50
51 lan2 {
52 label = "green:lan2";
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_LAN;
55 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
56 };
57
58 lan3 {
59 label = "green:lan3";
60 color = <LED_COLOR_ID_GREEN>;
61 function = LED_FUNCTION_LAN;
62 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
63 };
64
65 led_power: power {
66 label = "green:power";
67 color = <LED_COLOR_ID_GREEN>;
68 function = LED_FUNCTION_POWER;
69 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
70 };
71
72 wan_green {
73 label = "green:wan";
74 color = <LED_COLOR_ID_GREEN>;
75 function = LED_FUNCTION_WAN;
76 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
77 };
78
79 led_wan_red: wan_red {
80 label = "red:wan";
81 color = <LED_COLOR_ID_RED>;
82 function = LED_FUNCTION_WAN;
83 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &spi0 {
89 status = "okay";
90
91 flash@0 {
92 compatible = "jedec,spi-nor";
93 reg = <0>;
94 spi-max-frequency = <50000000>;
95 m25p,fast-read;
96
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "u-boot";
104 reg = <0x0 0x30000>;
105 read-only;
106 };
107
108 partition@30000 {
109 label = "u-boot-env";
110 reg = <0x30000 0x10000>;
111 };
112
113 partition@40000 {
114 label = "boot-config";
115 reg = <0x40000 0x10000>;
116 read-only;
117 };
118
119 partition@50000 {
120 label = "factory";
121 reg = <0x50000 0x10000>;
122 read-only;
123
124 nvmem-layout {
125 compatible = "fixed-layout";
126 #address-cells = <1>;
127 #size-cells = <1>;
128
129 eeprom: eeprom@0 {
130 reg = <0x0 0xe00>;
131 };
132
133 macaddr: macaddr@4 {
134 compatible = "mac-base";
135 reg = <0x4 0x6>;
136 #nvmem-cell-cells = <1>;
137 };
138 };
139 };
140
141 partition@60000 {
142 label = "permanent_config";
143 reg = <0x60000 0x80000>;
144 read-only;
145 };
146
147 partition@e0000 {
148 compatible = "denx,fit";
149 label = "firmware";
150 reg = <0xe0000 0xf20000>;
151 };
152 };
153 };
154 };
155
156 &pcie {
157 status = "okay";
158 };
159
160 &pcie1 {
161 wifi0: wifi@0,0 {
162 compatible = "mediatek,mt76";
163 reg = <0x0000 0 0 0 0>;
164
165 nvmem-cells = <&eeprom>;
166 nvmem-cell-names = "eeprom";
167 mediatek,disable-radar-background;
168 };
169 };
170
171 &gmac0 {
172 nvmem-cells = <&macaddr 2>;
173 nvmem-cell-names = "mac-address";
174 };
175
176 &gmac1 {
177 status = "okay";
178 label = "wan";
179 phy-handle = <&ethphy4>;
180
181 nvmem-cells = <&macaddr 3>;
182 nvmem-cell-names = "mac-address";
183 };
184
185 &mdio {
186 ethphy4: ethernet-phy@4 {
187 reg = <4>;
188 };
189 };
190
191 &switch0 {
192 ports {
193 port@0 {
194 status = "okay";
195 label = "lan1";
196 };
197
198 port@1 {
199 status = "okay";
200 label = "lan2";
201 };
202
203 port@2 {
204 status = "okay";
205 label = "lan3";
206 };
207 };
208 };
209
210 &state_default {
211 gpio {
212 groups = "i2c", "jtag", "uart3", "wdt";
213 function = "gpio";
214 };
215 };