ramips: add proper system clock and reset driver support for mt7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_br-6478ac-v2.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (C) 2016 Rohan Murch <rohan.murch@gmail.com>
4 * Copyright (C) 2016 Hans Ulli Kroll <ulli.kroll@googlemail.com>
5 * Copyright (C) 2017 James McKenzie <openwrt@madingley.org>
6 */
7
8 #include "mt7620a.dtsi"
9
10 #include <dt-bindings/gpio/gpio.h>
11 #include <dt-bindings/input/input.h>
12 #include <dt-bindings/mtd/partitions/uimage.h>
13
14 / {
15 compatible = "edimax,br-6478ac-v2", "ralink,mt7620a-soc";
16 model = "Edimax BR-6478AC v2";
17
18 aliases {
19 led-boot = &led_power;
20 led-failsafe = &led_power;
21 led-running = &led_power;
22 led-upgrade = &led_power;
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset_wps {
29 label = "reset_wps";
30 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 led_power: power {
39 label = "white:power";
40 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
41 };
42
43 internet {
44 label = "blue:internet";
45 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
46 };
47
48 wlan {
49 label = "blue:wlan";
50 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
51 };
52
53 usb {
54 label = "blue:usb";
55 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
56 trigger-sources = <&ohci_port1>, <&ehci_port1>;
57 linux,default-trigger = "usbport";
58 };
59 };
60
61 gpio_export {
62 compatible = "gpio-export";
63 #size-cells = <0>;
64 usb-power {
65 gpio-export,name="usb-power";
66 gpio-export,output=<1>;
67 gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
68 };
69 };
70 };
71
72 &gpio2 {
73 status = "okay";
74 };
75
76 &spi0 {
77 status = "okay";
78
79 flash@0 {
80 compatible = "jedec,spi-nor";
81 reg = <0>;
82 spi-max-frequency = <10000000>;
83
84 partitions {
85 compatible = "fixed-partitions";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 partition@0 {
90 label = "u-boot";
91 reg = <0x0 0x30000>;
92 read-only;
93 };
94
95 partition@30000 {
96 label = "u-boot-env";
97 reg = <0x30000 0x10000>;
98 read-only;
99 };
100
101 factory: partition@40000 {
102 label = "factory";
103 reg = <0x40000 0x10000>;
104 read-only;
105 };
106
107 partition@50000 {
108 label = "cimage";
109 reg = <0x50000 0x20000>;
110 read-only;
111 };
112
113 partition@70000 {
114 compatible = "openwrt,uimage", "denx,uimage";
115 openwrt,offset = <FW_EDIMAX_OFFSET>;
116 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
117 label = "firmware";
118 reg = <0x00070000 0x00790000>;
119 };
120 };
121 };
122 };
123
124 &state_default {
125 gpio {
126 groups = "i2c", "uartf", "nd_sd";
127 function = "gpio";
128 };
129 };
130
131 &ethernet {
132 pinctrl-names = "default";
133 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
134
135 nvmem-cells = <&macaddr_factory_4>;
136 nvmem-cell-names = "mac-address";
137
138 mediatek,portmap = "wllll";
139
140 port@5 {
141 status = "okay";
142 mediatek,fixed-link = <1000 1 1 1>;
143 phy-mode = "rgmii";
144 };
145
146 mdio-bus {
147 status = "okay";
148
149 phy0: ethernet-phy@0 {
150 reg = <0>;
151 phy-mode = "rgmii";
152 };
153
154 phy1: ethernet-phy@1 {
155 reg = <1>;
156 phy-mode = "rgmii";
157 };
158
159 phy2: ethernet-phy@2 {
160 reg = <2>;
161 phy-mode = "rgmii";
162 };
163
164 phy3: ethernet-phy@3 {
165 reg = <3>;
166 phy-mode = "rgmii";
167 };
168
169 phy4: ethernet-phy@4 {
170 reg = <4>;
171 phy-mode = "rgmii";
172 };
173
174 phy1f: ethernet-phy@1f {
175 reg = <0x1f>;
176 phy-mode = "rgmii";
177 };
178 };
179 };
180
181 &gsw {
182 mediatek,ephy-base = /bits/ 8 <12>;
183 };
184
185 &wmac {
186 ralink,mtd-eeprom = <&factory 0x0>;
187 };
188
189 &pcie {
190 status = "okay";
191 };
192
193 &pcie0 {
194 wifi@0,0 {
195 reg = <0x0000 0 0 0 0>;
196 mediatek,mtd-eeprom = <&factory 0x8000>;
197 mediatek,2ghz = <0>;
198 };
199 };
200
201 &ehci {
202 status = "okay";
203 };
204
205 &ohci {
206 status = "okay";
207 };
208
209 &factory {
210 compatible = "nvmem-cells";
211 #address-cells = <1>;
212 #size-cells = <1>;
213
214 macaddr_factory_4: macaddr@4 {
215 reg = <0x4 0x6>;
216 };
217 };