7b1e5d863b5c1c96d1a7d03e709beae2850cf13a
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_tenbay_t-mb5eu-v01.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 = "tenbay,t-mb5eu-v01", "mediatek,mt7621-soc";
10 model = "Tenbay T-MB5EU-V01";
11
12 aliases {
13 led-boot = &led_green;
14 led-failsafe = &led_red;
15 led-running = &led_blue;
16 led-upgrade = &led_red;
17 label-mac-device = &gmac1;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 bootargs-override = "console=ttyS0,115200";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27 pinctrl-names = "default";
28 pinctrl-0 = <&led_pins>;
29
30 led_blue: blue {
31 label = "blue";
32 gpios = <&aw9523 0 GPIO_ACTIVE_LOW>;
33 };
34
35 led_red: red {
36 label = "red";
37 gpios = <&aw9523 1 GPIO_ACTIVE_LOW>;
38 };
39
40 led_green: green {
41 label = "green";
42 gpios = <&aw9523 11 GPIO_ACTIVE_LOW>;
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys-polled";
48 poll-interval = <50>;
49 pinctrl-names = "default";
50 pinctrl-0 = <&button_pins>;
51
52 reset {
53 label = "reset";
54 gpios = <&aw9523 9 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_RESTART>;
56 };
57
58 wps {
59 label = "wps";
60 gpios = <&aw9523 8 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_WPS_BUTTON>;
62 };
63 };
64
65 i2c-gpio {
66 #address-cells = <1>;
67 #size-cells = <0>;
68
69 compatible = "i2c-gpio";
70 gpios = <&gpio 7 GPIO_ACTIVE_HIGH &gpio 8 GPIO_ACTIVE_HIGH>;
71 i2c-gpio,delay-us = <10>;
72
73 aw9523: gpio-expander@5b {
74 compatible = "awinic,aw9523-pinctrl";
75 reg = <0x5b>;
76 gpio-controller;
77 #gpio-cells = <2>;
78 gpio-ranges = <&aw9523 0 0 16>;
79
80 reset-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
81
82 button_pins: button-pins {
83 pins = "gpio8", "gpio9";
84 function = "gpio";
85 bias-pull-up;
86 drive-open-drain;
87 input-enable;
88 };
89
90 led_pins: led-pins {
91 pins = "gpio0", "gpio1", "gpio11";
92 function = "gpio";
93 input-disable;
94 output-low;
95 };
96 };
97 };
98 };
99
100 &pcie {
101 status = "okay";
102 };
103
104 &pcie1 {
105 wifi@0,0 {
106 compatible = "mediatek,mt76";
107 reg = <0x0 0 0 0 0>;
108 nvmem-cells = <&eeprom_factory_0>;
109 nvmem-cell-names = "eeprom";
110 mediatek,disable-radar-background;
111 };
112 };
113
114 &gmac0 {
115 nvmem-cells = <&macaddr_factory_4 0>;
116 nvmem-cell-names = "mac-address";
117 };
118
119 &gmac1 {
120 status = "okay";
121 label = "wan";
122 phy-handle = <&ethphy0>;
123
124 nvmem-cells = <&macaddr_factory_4 (-2)>;
125 nvmem-cell-names = "mac-address";
126 };
127
128 &mdio {
129 ethphy0: ethernet-phy@0 {
130 reg = <0>;
131 };
132 };
133
134 &switch0 {
135 ports {
136 port@1 {
137 status = "okay";
138 label = "lan1";
139 };
140
141 port@2 {
142 status = "okay";
143 label = "lan2";
144 };
145
146 port@3 {
147 status = "okay";
148 label = "lan3";
149 };
150
151 port@4 {
152 status = "okay";
153 label = "lan4";
154 };
155 };
156 };
157
158 &state_default {
159 gpio {
160 groups = "uart3";
161 function = "gpio";
162 };
163 };
164
165 &spi0 {
166 status = "okay";
167
168 flash@0 {
169 compatible = "jedec,spi-nor";
170 reg = <0>;
171 spi-max-frequency = <50000000>;
172
173 partitions {
174 compatible = "fixed-partitions";
175 #address-cells = <1>;
176 #size-cells = <1>;
177
178 partition@0 {
179 label = "u-boot";
180 reg = <0x0 0x30000>;
181 read-only;
182 };
183
184 partition@30000 {
185 label = "u-boot-env";
186 reg = <0x30000 0x10000>;
187 read-only;
188 };
189
190 partition@40000 {
191 label = "product";
192 reg = <0x40000 0x10000>;
193 read-only;
194 };
195
196 factory: partition@50000 {
197 label = "factory";
198 reg = <0x50000 0x40000>;
199 read-only;
200
201 nvmem-layout {
202 compatible = "fixed-layout";
203 #address-cells = <1>;
204 #size-cells = <1>;
205
206 eeprom_factory_0: eeprom@0 {
207 reg = <0x0 0xe00>;
208 };
209
210 macaddr_factory_4: macaddr@4 {
211 compatible = "mac-base";
212 reg = <0x4 0x6>;
213 #nvmem-cell-cells = <1>;
214 };
215 };
216 };
217
218 partition@90000 {
219 compatible = "denx,fit";
220 label = "firmware";
221 reg = <0x90000 0xf70000>;
222 };
223 };
224 };
225 };