ramips: add support for YunCore G720
[openwrt/staging/stintel.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 &mdio {
141 ethphy4: ethernet-phy@4 {
142 reg = <4>;
143 };
144 };
145
146 &switch0 {
147 ports {
148 port@0 {
149 status = "okay";
150 label = "lan1";
151 };
152
153 port@1 {
154 status = "okay";
155 label = "lan2";
156 };
157
158 port@2 {
159 status = "okay";
160 label = "lan3";
161 };
162
163 port@3 {
164 status = "okay";
165 label = "lan4";
166 };
167 };
168 };
169
170 &pcie {
171 status = "okay";
172 };
173
174 &pcie1 {
175 wifi0: wifi@0,0 {
176 compatible = "mediatek,mt76";
177 reg = <0x0000 0 0 0 0>;
178 nvmem-cells = <&eeprom_factory_0>;
179 nvmem-cell-names = "eeprom";
180 };
181 };
182
183 &state_default {
184 gpio {
185 groups = "jtag", "wdt";
186 function = "gpio";
187 };
188 };