ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_elecom_wrc-1167ghbk2-s.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "elecom,wrc-1167ghbk2-s", "mediatek,mt7621-soc";
8 model = "ELECOM WRC-1167GHBK2-S";
9
10 aliases {
11 led-boot = &led_power_green;
12 led-failsafe = &led_power_green;
13 led-running = &led_power_green;
14 led-upgrade = &led_power_green;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wlan2g {
21 label = "white:wlan2g";
22 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
23 linux,default-trigger = "phy0radio";
24 };
25
26 wlan5g {
27 label = "white:wlan5g";
28 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
29 };
30
31 led_power_green: power_green {
32 label = "green:power";
33 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
34 };
35
36 power_blue {
37 label = "blue:power";
38 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
39 };
40
41 wps {
42 label = "red:wps";
43 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
44 };
45
46 power_red {
47 label = "red:power";
48 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
49 };
50 };
51
52 keys {
53 compatible = "gpio-keys";
54
55 reset {
56 label = "reset";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RESTART>;
59 };
60
61 wps {
62 label = "wps";
63 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
64 linux,code = <KEY_WPS_BUTTON>;
65 };
66 };
67 };
68
69 &gmac0 {
70 nvmem-cells = <&macaddr_factory_e000>;
71 nvmem-cell-names = "mac-address";
72 };
73
74 &gmac1 {
75 status = "okay";
76 label = "wan";
77 phy-handle = <&ethphy0>;
78
79 nvmem-cells = <&macaddr_factory_e006>;
80 nvmem-cell-names = "mac-address";
81 };
82
83 &mdio {
84 ethphy0: ethernet-phy@0 {
85 reg = <0>;
86 };
87 };
88
89 &switch0 {
90 ports {
91 port@1 {
92 status = "okay";
93 label = "lan4";
94 };
95
96 port@2 {
97 status = "okay";
98 label = "lan3";
99 };
100
101 port@3 {
102 status = "okay";
103 label = "lan2";
104 };
105
106 port@4 {
107 status = "okay";
108 label = "lan1";
109 };
110 };
111 };
112
113 &spi0 {
114 status = "okay";
115
116 flash@0 {
117 compatible = "jedec,spi-nor";
118 reg = <0>;
119 spi-max-frequency = <10000000>;
120
121 partitions {
122 compatible = "fixed-partitions";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 partition@0 {
127 label = "u-boot";
128 reg = <0x0 0x30000>;
129 read-only;
130 };
131
132 partition@30000 {
133 label = "u-boot-env";
134 reg = <0x30000 0x10000>;
135 read-only;
136 };
137
138 factory: partition@40000 {
139 label = "factory";
140 reg = <0x40000 0x10000>;
141 read-only;
142 };
143
144 partition@50000 {
145 compatible = "denx,uimage";
146 label = "firmware";
147 reg = <0x50000 0xf20000>;
148 };
149
150 partition@f70000 {
151 label = "user_data";
152 reg = <0xf70000 0x80000>;
153 read-only;
154 };
155
156 partition@ff0000 {
157 label = "NVRAM";
158 reg = <0xff0000 0x10000>;
159 read-only;
160 };
161 };
162 };
163 };
164
165 &state_default {
166 gpio {
167 groups = "i2c", "uart3", "jtag", "wdt";
168 function = "gpio";
169 };
170 };
171
172 &pcie {
173 status = "okay";
174 };
175
176 &pcie0 {
177 wifi@0,0 {
178 compatible = "mediatek,mt76";
179 reg = <0x0000 0 0 0 0>;
180 mediatek,mtd-eeprom = <&factory 0x0>;
181 nvmem-cells = <&macaddr_factory_e000>;
182 nvmem-cell-names = "mac-address";
183 mac-address-increment = <1>;
184 };
185 };
186
187 &xhci {
188 status = "disabled";
189 };
190
191 &factory {
192 compatible = "nvmem-cells";
193 #address-cells = <1>;
194 #size-cells = <1>;
195
196 macaddr_factory_e000: macaddr@e000 {
197 reg = <0xe000 0x6>;
198 };
199
200 macaddr_factory_e006: macaddr@e006 {
201 reg = <0xe006 0x6>;
202 };
203 };