ramips: add TP-LINK TL-WR902AC v4
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620n_snr_cpe-w4n-mt.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620n.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 = "snr,cpe-w4n-mt", "ralink,mt7620n-soc";
11 model = "SNR-CPE-W4N (rev.M)";
12
13 aliases {
14 led-boot = &led_wps;
15 led-failsafe = &led_sys;
16 led-running = &led_wps;
17 led-upgrade = &led_sys;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_sys: sys {
24 label = "green:sys";
25 color = <LED_COLOR_ID_GREEN>;
26 function = LED_FUNCTION_STATUS;
27 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; // GPIO#38
28 panic-indicator;
29 };
30
31 led_wps: wps {
32 label = "green:wps";
33 color = <LED_COLOR_ID_GREEN>;
34 function = LED_FUNCTION_WPS;
35 gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; // GPIO#39
36 };
37
38 wlan {
39 label = "green:wlan";
40 color = <LED_COLOR_ID_GREEN>;
41 function = LED_FUNCTION_WLAN;
42 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; // GPIO#72
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 reset {
50 label = "Reset Button";
51 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; // GPIO#1
52 linux,code = <KEY_RESTART>;
53 };
54 };
55 };
56
57 &gpio0 {
58 status = "okay";
59 };
60
61 &gpio1 {
62 status = "okay";
63 };
64
65 &gpio3 {
66 status = "okay";
67 };
68
69 &spi0 {
70 status = "okay";
71
72 flash@0 {
73 compatible = "jedec,spi-nor";
74 reg = <0>;
75 spi-max-frequency = <48000000>;
76
77 partitions {
78 compatible = "fixed-partitions";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 partition@0 {
83 label = "Bootloader";
84 reg = <0x0 0x30000>;
85 read-only;
86 };
87
88 partition@30000 {
89 label = "Config";
90 reg = <0x30000 0x10000>;
91 };
92
93 factory: partition@40000 {
94 label = "Factory";
95 reg = <0x40000 0x10000>;
96 read-only;
97
98 nvmem-layout {
99 compatible = "fixed-layout";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 eeprom_factory_0: eeprom@0 {
104 reg = <0x0 0x200>;
105 };
106 };
107 };
108
109 partition@50000 {
110 compatible = "denx,uimage";
111 label = "firmware";
112 reg = <0x50000 0x7b0000>;
113 };
114
115 partition@30000_1 {
116 label = "uboot-env";
117 reg = <0x30000 0x1000>;
118 };
119 };
120 };
121 };
122
123 &state_default {
124 gpio {
125 groups = "i2c", "spi refclk";
126 function = "gpio";
127 };
128 };
129
130 &wmac {
131 nvmem-cells = <&eeprom_factory_0>;
132 nvmem-cell-names = "eeprom";
133 };