acaffecf8ddf9cf1d8d08d514d3682543850d3a9
[oweals/openwrt.git] / target / linux / ramips / dts / mt7628an_cudy_wr1000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7628an.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "cudy,wr1000", "mediatek,mt7628an-soc";
11         model = "Cudy WR1000";
12
13         aliases {
14                 led-boot = &led_wps;
15                 led-failsafe = &led_wps;
16                 led-upgrade = &led_wps;
17                 label-mac-device = &wmac;
18         };
19
20         keys {
21                 compatible = "gpio-keys";
22
23                 reset {
24                         label = "reset";
25                         gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
26                         linux,code = <KEY_RESTART>;
27                 };
28
29                 wps {
30                         label = "rfkill";
31                         gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
32                         linux,code = <KEY_WPS_BUTTON>;
33                 };
34         };
35
36         leds {
37                 compatible = "gpio-leds";
38
39                 lan1 {
40                         label = "wr1000:blue:lan1";
41                         gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
42                 };
43
44                 lan2 {
45                         label = "wr1000:blue:lan2";
46                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
47                 };
48
49                 wan {
50                         label = "wr1000:blue:wan";
51                         gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
52                 };
53
54                 wlan2g {
55                         label = "wr1000:blue:wlan2g";
56                         gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
57                         linux,default-trigger = "phy0tpt";
58                 };
59
60                 led_wps: wps {
61                         label = "wr1000:blue:wps";
62                         gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
63                 };
64         };
65 };
66
67 &spi0 {
68         status = "okay";
69
70         flash@0 {
71                 compatible = "jedec,spi-nor";
72                 reg = <0>;
73                 spi-max-frequency = <10000000>;
74
75                 partitions {
76                         compatible = "fixed-partitions";
77                         #address-cells = <1>;
78                         #size-cells = <1>;
79
80                         partition@0 {
81                                 label = "u-boot";
82                                 reg = <0x0 0x30000>;
83                                 read-only;
84                         };
85
86                         partition@30000 {
87                                 label = "u-boot-env";
88                                 reg = <0x30000 0x10000>;
89                                 read-only;
90                         };
91
92                         factory: partition@40000 {
93                                 label = "factory";
94                                 reg = <0x40000 0x10000>;
95                                 read-only;
96                         };
97
98                         partition@50000 {
99                                 compatible = "denx,uimage";
100                                 label = "firmware";
101                                 reg = <0x50000 0x7b0000>;
102                         };
103                 };
104         };
105 };
106
107 &state_default {
108         gpio {
109                 ralink,group = "i2s", "refclk", "wdt", "p4led_an",
110                                 "p3led_an", "p2led_an", "wled_an";
111                 ralink,function = "gpio";
112         };
113 };
114
115 &pcie {
116         status = "okay";
117 };
118
119 &pcie0 {
120         wifi@0,0 {
121                 compatible = "mediatek,mt76";
122                 reg = <0x0000 0 0 0 0>;
123                 mediatek,mtd-eeprom = <&factory 0x8000>;
124                 ieee80211-freq-limit = <5000000 6000000>;
125
126                 led {
127                         led-sources = <2>;
128                         led-active-low;
129                 };
130         };
131 };
132
133 &wmac {
134         status = "okay";
135 };
136
137 &ethernet {
138         mtd-mac-address = <&factory 0x28>;
139         mediatek,portmap = "llllw";
140 };