ramips: add support for SNR-CPE-W4N-MT router
[openwrt/staging/pepe2k.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 0x100000>;
96 read-only;
97 };
98
99 partition@50000 {
100 compatible = "denx,uimage";
101 label = "firmware";
102 reg = <0x50000 0x7b0000>;
103 };
104
105 partition@30000_1 {
106 label = "uboot-env";
107 reg = <0x30000 0x1000>;
108 };
109 };
110 };
111 };
112
113 &state_default {
114 gpio {
115 groups = "i2c", "spi refclk";
116 function = "gpio";
117 };
118 };
119
120 &wmac {
121 ralink,mtd-eeprom = <&factory 0x0>;
122 };