8edae7de875d56864539e70a52b3159fc2b9e2fe
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_totolink_a7000r.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "totolink,a7000r", "mediatek,mt7621-soc";
10 model = "TOTOLINK A7000R";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_sys: sys {
23 label = "blue:sys";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26 };
27
28 keys {
29 compatible = "gpio-keys";
30
31 reset {
32 label = "reset";
33 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 linux,code = <KEY_RESTART>;
36 };
37 };
38 };
39
40 &spi0 {
41 status = "okay";
42
43 flash@0 {
44 compatible = "jedec,spi-nor";
45 reg = <0>;
46 spi-max-frequency = <40000000>;
47
48 partitions {
49 compatible = "fixed-partitions";
50 #address-cells = <1>;
51 #size-cells = <1>;
52
53 partition@0 {
54 label = "u-boot";
55 reg = <0x0 0x30000>;
56 read-only;
57 };
58
59 partition@30000 {
60 label = "u-boot-env";
61 reg = <0x30000 0x10000>;
62 read-only;
63 };
64
65 factory: partition@40000 {
66 label = "factory";
67 reg = <0x40000 0x10000>;
68 read-only;
69
70 nvmem-layout {
71 compatible = "fixed-layout";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 eeprom_factory_0: eeprom@0 {
76 reg = <0x0 0x4da8>;
77 };
78
79 eeprom_factory_8000: eeprom@8000 {
80 reg = <0x8000 0x4da8>;
81 };
82
83 macaddr_factory_e000: macaddr@e000 {
84 reg = <0xe000 0x6>;
85 };
86 };
87 };
88
89 partition@50000 {
90 compatible = "denx,uimage";
91 label = "firmware";
92 reg = <0x50000 0xfb0000>;
93 };
94 };
95 };
96 };
97
98 &pcie {
99 status = "okay";
100 };
101
102 &pcie0 {
103 wifi@0,0 {
104 compatible = "mediatek,mt76";
105 reg = <0x0000 0 0 0 0>;
106 nvmem-cells = <&eeprom_factory_0>;
107 nvmem-cell-names = "eeprom";
108 ieee80211-freq-limit = <2400000 2500000>;
109 };
110 };
111
112 &pcie1 {
113 wifi@0,0 {
114 compatible = "mediatek,mt76";
115 reg = <0x0000 0 0 0 0>;
116 nvmem-cells = <&eeprom_factory_8000>;
117 nvmem-cell-names = "eeprom";
118 ieee80211-freq-limit = <5000000 6000000>;
119 };
120 };
121
122 &gmac0 {
123 nvmem-cells = <&macaddr_factory_e000>;
124 nvmem-cell-names = "mac-address";
125 };
126
127 &gmac1 {
128 status = "okay";
129 label = "wan";
130 phy-handle = <&ethphy4>;
131
132 nvmem-cells = <&macaddr_factory_e000>;
133 nvmem-cell-names = "mac-address";
134 mac-address-increment = <1>;
135 };
136
137 &mdio {
138 ethphy4: ethernet-phy@4 {
139 reg = <4>;
140 };
141 };
142
143 &switch0 {
144 ports {
145 port@0 {
146 status = "okay";
147 label = "lan1";
148 };
149
150 port@1 {
151 status = "okay";
152 label = "lan2";
153 };
154
155 port@2 {
156 status = "okay";
157 label = "lan3";
158 };
159
160 port@3 {
161 status = "okay";
162 label = "lan4";
163 };
164 };
165 };
166
167 &state_default {
168 gpio {
169 groups = "i2c", "wdt";
170 function = "gpio";
171 };
172 };