ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_yuncore_g720.dts
1 #include <dt-bindings/gpio/gpio.h>
2 #include <dt-bindings/input/input.h>
3 #include <dt-bindings/leds/common.h>
4
5 #include "mt7621.dtsi"
6
7 / {
8 compatible = "yuncore,g720", "mediatek,mt7621-soc";
9 model = "YunCore G720";
10
11 aliases {
12 label-mac-device = &wifi0;
13 led-boot = &led_sys_red;
14 led-failsafe = &led_sys_red;
15 led-running = &led_sys_red;
16 led-upgrade = &led_sys_red;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 led_sys_red: led-sys {
27 color = <LED_COLOR_ID_RED>;
28 function = LED_FUNCTION_STATUS;
29 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
30 };
31 };
32
33 keys {
34 compatible = "gpio-keys";
35
36 reset {
37 label = "reset";
38 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
39 linux,code = <KEY_RESTART>;
40 };
41 };
42
43 watchdog {
44 compatible = "linux,wdt-gpio";
45 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
46 hw_algo = "toggle";
47 hw_margin_ms = <200>;
48 always-running;
49 };
50 };
51
52 &gpio {
53 s1 {
54 gpio-hog;
55 line-name = "s1";
56 gpios = <4 GPIO_ACTIVE_LOW>;
57 output-high;
58 };
59
60 s2 {
61 gpio-hog;
62 line-name = "s2";
63 gpios = <3 GPIO_ACTIVE_LOW>;
64 output-high;
65 };
66 };
67
68 &spi0 {
69 status = "okay";
70
71 flash@0 {
72 compatible = "w25q128", "jedec,spi-nor";
73 reg = <0>;
74 spi-max-frequency = <10000000>;
75
76 partitions {
77 compatible = "fixed-partitions";
78 #address-cells = <1>;
79 #size-cells = <1>;
80
81 partition@0 {
82 label = "u-boot";
83 reg = <0x0 0x30000>;
84 read-only;
85 };
86
87 partition@30000 {
88 label = "u-boot-env";
89 reg = <0x30000 0x10000>;
90 read-only;
91 };
92
93 partition@40000 {
94 label = "factory";
95 reg = <0x50000 0x40000>;
96 read-only;
97
98 nvmem-layout {
99 compatible = "fixed-layout";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 eeprom_factory_0: eeprom@0 {
104 reg = <0x0 0xe00>;
105 };
106
107 macaddr_factory_e000: macaddr@e000 {
108 reg = <0xe000 0x6>;
109 };
110
111 macaddr_factory_e006: macaddr@e006 {
112 reg = <0xe006 0x6>;
113 };
114 };
115 };
116
117 partition@50000 {
118 compatible = "denx,uimage";
119 label = "firmware";
120 reg = <0x90000 0xf70000>;
121 };
122 };
123 };
124 };
125
126 &gmac0 {
127 nvmem-cells = <&macaddr_factory_e000>;
128 nvmem-cell-names = "mac-address";
129 };
130
131 &gmac1 {
132 status = "okay";
133 label = "wan";
134 phy-handle = <&ethphy4>;
135
136 nvmem-cells = <&macaddr_factory_e006>;
137 nvmem-cell-names = "mac-address";
138 };
139
140 &ethphy4 {
141 /delete-property/ interrupts;
142 };
143
144 &switch0 {
145 ports {
146 port@0 {
147 status = "okay";
148 label = "lan1";
149 };
150
151 port@1 {
152 status = "okay";
153 label = "lan2";
154 };
155
156 port@2 {
157 status = "okay";
158 label = "lan3";
159 };
160
161 port@3 {
162 status = "okay";
163 label = "lan4";
164 };
165 };
166 };
167
168 &pcie {
169 status = "okay";
170 };
171
172 &pcie1 {
173 wifi0: wifi@0,0 {
174 compatible = "mediatek,mt76";
175 reg = <0x0000 0 0 0 0>;
176 nvmem-cells = <&eeprom_factory_0>;
177 nvmem-cell-names = "eeprom";
178 };
179 };
180
181 &state_default {
182 gpio {
183 groups = "jtag", "wdt";
184 function = "gpio";
185 };
186 };