ramips: clean up useless dts partition labels
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_comfast_cf-ew72-v2.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 = "comfast,cf-ew72-v2", "mediatek,mt7621-soc";
11 model = "COMFAST CF-EW72 V2";
12
13 // There are at least two HW variants of cf-ew72-v2:
14 // With external RAM chip and with integrated RAM (RAM chip not soldered).
15 // Both act same.
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 debounce-interval = <60>;
29 };
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 // The only both visible and controllable indicator is wifi LED.
36 // CF-EW72 have 8 LEDs:
37 // "wlan" is the only LED is controllable with GPIO and have proper hole in shell.
38 // "power", "wan" and "lan" LEDs have proper holes in shell, but can not be controlled with GPIO
39 // "hidden_led_2" and "hidden_led_4" can be controlled with GPIO, but have no proper holes in shell
40 // "hidden_led_2" is between POWER and WAN LEDs
41 // "hidden_led_4" is between WAN and LAN LEDs
42 // "noconn_led_6" and "noconn_led_8" exist, but have no proper holes in shell and not controlled:
43 // "noconn_led_6" is between LAN and WLAN LEDs
44 // "noconn_led_8" is after WLAN LED
45
46 // LED "hidden_led_2" between POWER and WAN LEDs is controllable with GPIO, but it has no proper hole in shell;
47 // LED "hidden_led_4" between WAN and LAN LEDs is controllable with GPIO, but it has no proper hole in shell;
48
49 // TABLE of LEDs. All leds are blue.
50 //
51 // Place (WAN->ANT) | Num | GPIO | LED name (LuCI) | Note
52 // -----------------|-----|-----------------------------------------------------------------------------------------
53 // power | 1 | | | POWER LED. Not controlled with GPIO.
54 // hidden_led_2 | 2 | 13 | blue:hidden_led_2 | This LED does not have proper hole in shell.
55 // wan | 3 | | | WAN LED. Not controlled with GPIO.
56 // hidden_led_4 | 4 | 16 | blue:hidden_led_4 | This LED does not have proper hole in shell.
57 // lan | 5 | | | LAN LED. Not controlled with GPIO.
58 // noconn_led_6 | 6 | | | Not controlled with GPIO, possibly not connected
59 // wlan | 7 | 15 | blue:wlan | WLAN LED. Wireless indicator.
60 // noconn_led_8 | 8 | | | Not controlled with GPIO, possibly not connected
61
62 hidden_led_2_blue {
63 label = "blue:hidden_led_2";
64 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
65 };
66
67 hidden_led_4_blue {
68 label = "blue:hidden_led_4";
69 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
70 };
71
72 wlan_blue {
73 function = LED_FUNCTION_WLAN;
74 color = <LED_COLOR_ID_BLUE>;
75 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
76 };
77 };
78
79 aliases {
80 label-mac-device = &wan;
81 };
82 };
83
84 &spi0 {
85 status = "okay";
86
87 flash@0 {
88 compatible = "w25q128";
89 reg = <0>;
90 spi-max-frequency = <10000000>;
91 m25p,fast-read;
92 partitions {
93 compatible = "fixed-partitions";
94 #address-cells = <1>;
95 #size-cells = <1>;
96
97 partition@0 {
98 label = "Bootloader";
99 reg = <0x0 0x30000>;
100 read-only;
101 };
102
103 partition@30000 {
104 label = "Config";
105 reg = <0x30000 0x10000>;
106 read-only;
107 };
108
109 partition@40000 {
110 label = "factory";
111 reg = <0x40000 0x10000>;
112 read-only;
113
114 nvmem-layout {
115 compatible = "fixed-layout";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 eeprom_factory_0: eeprom@0 {
120 reg = <0x0 0x400>;
121 };
122
123 eeprom_factory_8000: eeprom@8000 {
124 reg = <0x8000 0x4da8>;
125 };
126
127 macaddr_factory_e000: macaddr@e000 {
128 compatible = "mac-base";
129 reg = <0xe000 0x6>;
130 #nvmem-cell-cells = <1>;
131 };
132
133 // Serial number can be found in "factory" at 0xE100.
134 // it starts and ends with double quotes `"` and is ASCII string
135 };
136 };
137
138 partition@50000 {
139 label = "firmware";
140 compatible = "denx,uimage";
141 reg = <0x50000 0xfb0000>;
142 };
143 };
144 };
145 };
146
147 &gpio {
148 groups = "i2c", "uart2", "uart3", "sdhci", "jtag";
149 function = "gpio";
150 };
151
152 &gmac0 {
153 nvmem-cells = <&macaddr_factory_e000 0>;
154 nvmem-cell-names = "mac-address";
155 };
156
157 &pcie {
158 status = "okay";
159 };
160
161 &pcie0 {
162 wifi_2_4_ghz: wifi@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_factory_0>;
166 nvmem-cell-names = "eeprom";
167 // Wi-Fi device reads it's MAC address from EEPROM (&factory + 4)
168 // adding anything related to mac-address here will cause use random MAC
169 };
170 };
171
172 &pcie1 {
173 wifi_5_0_ghz: wifi@0,0 {
174 compatible = "mediatek,mt76";
175 reg = <0x0000 0 0 0 0>;
176 nvmem-cells = <&eeprom_factory_8000>;
177 nvmem-cell-names = "eeprom";
178 // Wi-Fi device reads it's MAC address from EEPROM, (&factory + 0x8000 + 4)
179 // adding anything related to mac-address here will cause use random MAC.
180 };
181 };
182
183 &pcie2 {
184 status = "disabled";
185 };
186
187 &switch0 {
188 mediatek,mcm;
189 ports {
190 wan: port@0 {
191 status = "okay";
192 label = "wan";
193 nvmem-cells = <&macaddr_factory_e000 1>;
194 nvmem-cell-names = "mac-address";
195 };
196
197 lan: port@1 {
198 status = "okay";
199 label = "lan";
200 nvmem-cells = <&macaddr_factory_e000 0>;
201 nvmem-cell-names = "mac-address";
202 };
203 };
204 };