135eb0410dd10dbb0596d4591ac45188a9fe67a5
[openwrt/staging/hauke.git] / target / linux / mediatek / dts / mt7981b-glinet-gl-mt3000.dts
1 /dts-v1/;
2
3 #include "mt7981.dtsi"
4
5 / {
6 model = "GL.iNet GL-MT3000";
7 compatible = "glinet,gl-mt3000", "mediatek,mt7981";
8
9 aliases {
10 label-mac-device = &gmac0;
11 led-boot = &led_lightblue;
12 led-failsafe = &led_lightblue;
13 led-running = &led_white;
14 led-upgrade = &led_lightblue;
15 serial0 = &uart0;
16 };
17
18 chosen {
19 stdout-path = "serial0:115200n8";
20 };
21
22 gpio-keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 linux,code = <KEY_RESTART>;
28 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
29 };
30
31 mode {
32 label = "mode";
33 linux,input-type = <EV_SW>;
34 linux,code = <BTN_0>;
35 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
36 debounce-interval = <60>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_lightblue: led@0 {
44 label = "blue:run";
45 gpios = <&pio 31 GPIO_ACTIVE_LOW>;
46 };
47
48 led_white: led@1 {
49 label = "white:system";
50 gpios = <&pio 30 GPIO_ACTIVE_LOW>;
51 };
52 };
53
54 fan_5v: regulator-fan-5v {
55 compatible = "regulator-fixed";
56 regulator-name = "fan";
57 regulator-min-microvolt = <5000000>;
58 regulator-max-microvolt = <5000000>;
59 gpio = <&pio 28 GPIO_ACTIVE_HIGH>;
60 enable-active-high;
61 regulator-boot-on;
62 };
63
64 usb_vbus: regulator-usb-vbus {
65 compatible = "regulator-fixed";
66 regulator-name = "usb_vbus";
67 regulator-min-microvolt = <5000000>;
68 regulator-max-microvolt = <5000000>;
69 gpio = <&pio 12 GPIO_ACTIVE_HIGH>;
70 enable-active-high;
71 regulator-boot-on;
72 };
73 };
74
75 &uart0 {
76 status = "okay";
77 };
78
79 &watchdog {
80 status = "okay";
81 };
82
83 &eth {
84 pinctrl-names = "default";
85 pinctrl-0 = <&mdio_pins>;
86
87 status = "okay";
88
89 gmac0: mac@0 {
90 compatible = "mediatek,eth-mac";
91 reg = <0>;
92 phy-mode = "2500base-x";
93 phy-handle = <&phy0>;
94 nvmem-cells = <&macaddr>;
95 nvmem-cell-names = "mac-address";
96 };
97
98 gmac1: mac@1 {
99 compatible = "mediatek,eth-mac";
100 reg = <1>;
101 phy-mode = "gmii";
102 phy-handle = <&int_gbe_phy>;
103 nvmem-cells = <&macaddr>;
104 nvmem-cell-names = "mac-address";
105 mac-address-increment = <1>;
106 };
107 };
108
109 &mdio_bus {
110 reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
111 reset-delay-us = <600>;
112 reset-post-delay-us = <20000>;
113
114 phy0: ethernet-phy@5 {
115 reg = <5>;
116 compatible = "ethernet-phy-ieee802.3-c45";
117 phy-mode = "2500base-x";
118 };
119 };
120
121 &pwm {
122 pinctrl-names = "default";
123 pinctrl-0 = <&pwm_pins>;
124
125 status = "okay";
126 };
127
128 &fan {
129 pwms = <&pwm 0 40000 0>;
130 fan-supply = <&fan_5v>;
131 interrupt-parent = <&pio>;
132 interrupts = <29 IRQ_TYPE_EDGE_RISING>;
133 status = "okay";
134 };
135
136 &spi0 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&spi0_flash_pins>;
139 status = "okay";
140
141 spi_nand: flash@0 {
142 #address-cells = <1>;
143 #size-cells = <1>;
144 compatible = "spi-nand";
145 reg = <0>;
146 spi-max-frequency = <52000000>;
147
148 spi-cal-enable;
149 spi-cal-mode = "read-data";
150 spi-cal-datalen = <7>;
151 spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
152 spi-cal-addrlen = <5>;
153 spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
154
155 spi-tx-bus-width = <4>;
156 spi-rx-bus-width = <4>;
157 mediatek,nmbm;
158 mediatek,bmt-max-ratio = <1>;
159 mediatek,bmt-max-reserved-blocks = <64>;
160
161 partitions {
162 compatible = "fixed-partitions";
163 #address-cells = <1>;
164 #size-cells = <1>;
165
166 partition@0 {
167 label = "BL2";
168 reg = <0x00000 0x0100000>;
169 read-only;
170 };
171
172 partition@100000 {
173 label = "u-boot-env";
174 reg = <0x0100000 0x0080000>;
175 };
176
177 factory: partition@180000 {
178 label = "Factory";
179 reg = <0x180000 0x0200000>;
180 read-only;
181
182 nvmem-layout {
183 compatible = "fixed-layout";
184 #address-cells = <1>;
185 #size-cells = <1>;
186
187 macaddr: macaddr@a {
188 reg = <0xa 0x6>;
189 };
190 };
191 };
192
193 partition@380000 {
194 label = "FIP";
195 reg = <0x380000 0x0200000>;
196 read-only;
197 };
198
199 partition@580000 {
200 label = "log";
201 reg = <0x580000 0x0040000>;
202 };
203
204 partition@5c0000 {
205 label = "ubi";
206 reg = <0x5c0000 0xf640000>;
207 compatible = "linux,ubi";
208 };
209 };
210 };
211 };
212
213 &pio {
214 spi0_flash_pins: spi0-pins {
215 mux {
216 function = "spi";
217 groups = "spi0", "spi0_wp_hold";
218 };
219 };
220
221 pwm_pins: pwm0-pins {
222 mux {
223 function = "pwm";
224 groups = "pwm0_1";
225 };
226 };
227 };
228
229 &usb_phy {
230 status = "okay";
231 };
232
233 &xhci {
234 vbus-supply = <&usb_vbus>;
235
236 status = "okay";
237 };
238
239 &wifi {
240 mediatek,mtd-eeprom = <&factory 0x0>;
241
242 status = "okay";
243 };