ramips: add support for Amped Wireless B1200EX
[openwrt/staging/jow.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
88 partition@50000 {
89 label = "cimage";
90 reg = <0x50000 0x20000>;
91 read-only;
92 };
93
94 partition@70000 {
95 compatible = "openwrt,uimage", "denx,uimage";
96 openwrt,offset = <FW_EDIMAX_OFFSET>;
97 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
98 label = "firmware";
99 reg = <0x00070000 0x00790000>;
100 };
101 };
102 };
103 };
104
105 &state_default {
106 gpio {
107 groups = "i2c", "uartf", "nd_sd", "rgmii2";
108 function = "gpio";
109 };
110 };
111
112 &pinctrl {
113 phy_reset_pins: phy-reset {
114 gpio {
115 groups = "spi refclk";
116 function = "gpio";
117 };
118 };
119 };
120
121 &ethernet {
122 pinctrl-names = "default";
123 pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>;
124
125 nvmem-cells = <&macaddr_factory_4>;
126 nvmem-cell-names = "mac-address";
127
128 phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
129 phy-reset-duration = <30>;
130
131 port@5 {
132 status = "okay";
133 mediatek,fixed-link = <1000 1 1 1>;
134 phy-mode = "rgmii";
135 };
136
137 mdio-bus {
138 status = "okay";
139
140 phy0: ethernet-phy@0 {
141 status = "disabled";
142 reg = <0>;
143 phy-mode = "rgmii";
144 };
145
146 phy1: ethernet-phy@1 {
147 status = "disabled";
148 reg = <1>;
149 phy-mode = "rgmii";
150 };
151
152 phy2: ethernet-phy@2 {
153 status = "disabled";
154 reg = <2>;
155 phy-mode = "rgmii";
156 };
157
158 phy3: ethernet-phy@3 {
159 status = "disabled";
160 reg = <3>;
161 phy-mode = "rgmii";
162 };
163
164 phy4: ethernet-phy@4 {
165 status = "disabled";
166 reg = <4>;
167 phy-mode = "rgmii";
168 };
169 };
170 };
171
172 &gsw {
173 mediatek,ephy-base = /bits/ 8 <8>;
174 };
175
176 &wmac {
177 ralink,mtd-eeprom = <&factory 0x0>;
178 nvmem-cells = <&macaddr_factory_4>;
179 nvmem-cell-names = "mac-address";
180 };
181
182 &pcie {
183 status = "okay";
184 };
185
186 &pcie0 {
187 wifi@0,0 {
188 reg = <0x0000 0 0 0 0>;
189 mediatek,mtd-eeprom = <&factory 0x8000>;
190 ieee80211-freq-limit = <5000000 6000000>;
191 nvmem-cells = <&macaddr_factory_4>;
192 nvmem-cell-names = "mac-address";
193 mac-address-increment = <2>;
194 };
195 };
196
197 &factory {
198 compatible = "nvmem-cells";
199 #address-cells = <1>;
200 #size-cells = <1>;
201
202 macaddr_factory_4: macaddr@4 {
203 reg = <0x4 0x6>;
204 };
205 };