eb21ff7d6f9676e2cc404c32519b89fb3342fbce
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_ew-747x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 compatible = "ralink,mt7620a-soc";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset_wps {
23 label = "reset_wps";
24 gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27 };
28
29 leds {
30 compatible = "gpio-leds";
31
32 led_power: power {
33 label = "green:power";
34 gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
35 };
36
37 lan {
38 label = "green:lan";
39 gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
40 };
41
42 wps {
43 label = "green:wps";
44 gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
45 };
46 };
47 };
48
49 &gpio1 {
50 status = "okay";
51 };
52
53 &gpio2 {
54 status = "okay";
55 };
56
57 &spi0 {
58 status = "okay";
59
60 flash@0 {
61 compatible = "jedec,spi-nor";
62 reg = <0>;
63 spi-max-frequency = <10000000>;
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x30000>;
73 read-only;
74 };
75
76 partition@30000 {
77 label = "u-boot-env";
78 reg = <0x30000 0x10000>;
79 read-only;
80 };
81
82 factory: partition@40000 {
83 label = "factory";
84 reg = <0x40000 0x10000>;
85 read-only;
86
87 nvmem-layout {
88 compatible = "fixed-layout";
89 #address-cells = <1>;
90 #size-cells = <1>;
91
92 eeprom_factory_0: eeprom@0 {
93 reg = <0x0 0x200>;
94 };
95
96 eeprom_factory_8000: eeprom@8000 {
97 reg = <0x8000 0x200>;
98 };
99
100 macaddr_factory_4: macaddr@4 {
101 compatible = "mac-base";
102 reg = <0x4 0x6>;
103 #nvmem-cell-cells = <1>;
104 };
105 };
106 };
107
108 partition@50000 {
109 label = "cimage";
110 reg = <0x50000 0x20000>;
111 read-only;
112 };
113
114 partition@70000 {
115 compatible = "openwrt,uimage", "denx,uimage";
116 openwrt,offset = <FW_EDIMAX_OFFSET>;
117 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
118 label = "firmware";
119 reg = <0x00070000 0x00790000>;
120 };
121 };
122 };
123 };
124
125 &state_default {
126 gpio {
127 groups = "i2c", "uartf", "nd_sd", "rgmii2";
128 function = "gpio";
129 };
130 };
131
132 &pinctrl {
133 phy_reset_pins: phy-reset {
134 gpio {
135 groups = "spi refclk";
136 function = "gpio";
137 };
138 };
139 };
140
141 &ethernet {
142 pinctrl-names = "default";
143 pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>;
144
145 nvmem-cells = <&macaddr_factory_4 0>;
146 nvmem-cell-names = "mac-address";
147
148 phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
149 phy-reset-duration = <30>;
150
151 port@5 {
152 status = "okay";
153 mediatek,fixed-link = <1000 1 1 1>;
154 phy-mode = "rgmii";
155 };
156
157 mdio-bus {
158 status = "okay";
159
160 phy0: ethernet-phy@0 {
161 status = "disabled";
162 reg = <0>;
163 phy-mode = "rgmii";
164 };
165
166 phy1: ethernet-phy@1 {
167 status = "disabled";
168 reg = <1>;
169 phy-mode = "rgmii";
170 };
171
172 phy2: ethernet-phy@2 {
173 status = "disabled";
174 reg = <2>;
175 phy-mode = "rgmii";
176 };
177
178 phy3: ethernet-phy@3 {
179 status = "disabled";
180 reg = <3>;
181 phy-mode = "rgmii";
182 };
183
184 phy4: ethernet-phy@4 {
185 status = "disabled";
186 reg = <4>;
187 phy-mode = "rgmii";
188 };
189 };
190 };
191
192 &gsw {
193 mediatek,ephy-base = /bits/ 8 <8>;
194 };
195
196 &wmac {
197 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>;
198 nvmem-cell-names = "eeprom", "mac-address";
199 };
200
201 &pcie {
202 status = "okay";
203 };
204
205 &pcie0 {
206 wifi@0,0 {
207 reg = <0x0000 0 0 0 0>;
208 ieee80211-freq-limit = <5000000 6000000>;
209 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4 2>;
210 nvmem-cell-names = "eeprom", "mac-address";
211 };
212 };