rockchip: add Radxa CM3 IO board support
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_d-team_newifi-d2.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "d-team,newifi-d2", "mediatek,mt7621-soc";
9 model = "D-Team Newifi D2";
10
11 aliases {
12 led-boot = &led_power_blue;
13 led-failsafe = &led_power_blue;
14 led-running = &led_power_blue;
15 led-upgrade = &led_power_blue;
16 label-mac-device = &gmac0;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 power-amber {
27 function = LED_FUNCTION_POWER;
28 color = <LED_COLOR_ID_AMBER>;
29 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
30 };
31
32 led_power_blue: power-blue {
33 function = LED_FUNCTION_POWER;
34 color = <LED_COLOR_ID_BLUE>;
35 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
36 };
37
38 internet-amber {
39 label = "amber:internet";
40 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
41 };
42
43 internet-blue {
44 label = "blue:internet";
45 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
46 };
47
48 wlan2g {
49 label = "blue:wlan2g";
50 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
51 };
52
53 wlan5g {
54 label = "blue:wlan5g";
55 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
56 };
57
58 usb {
59 function = LED_FUNCTION_USB;
60 color = <LED_COLOR_ID_BLUE>;
61 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
62 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
63 linux,default-trigger = "usbport";
64 };
65 };
66
67 keys {
68 compatible = "gpio-keys";
69
70 reset {
71 label = "reset";
72 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
73 linux,code = <KEY_RESTART>;
74 };
75
76 wps {
77 label = "wps";
78 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
79 linux,code = <KEY_WPS_BUTTON>;
80 };
81 };
82
83 gpio_export {
84 compatible = "gpio-export";
85 #size-cells = <0>;
86
87 power_usb3 {
88 gpio-export,name = "power_usb3";
89 gpio-export,output = <1>;
90 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
91 };
92 };
93 };
94
95 &spi0 {
96 status = "okay";
97
98 flash@0 {
99 compatible = "jedec,spi-nor";
100 reg = <0>;
101 spi-max-frequency = <45000000>;
102 broken-flash-reset;
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0 0x30000>;
112 read-only;
113 };
114
115 partition@30000 {
116 label = "u-boot-env";
117 reg = <0x30000 0x10000>;
118 read-only;
119 };
120
121 factory: partition@40000 {
122 label = "factory";
123 reg = <0x40000 0x10000>;
124 read-only;
125
126 nvmem-layout {
127 compatible = "fixed-layout";
128 #address-cells = <1>;
129 #size-cells = <1>;
130
131 eeprom_factory_0: eeprom@0 {
132 reg = <0x0 0x400>;
133 };
134
135 eeprom_factory_8000: eeprom@8000 {
136 reg = <0x8000 0x200>;
137 };
138
139 macaddr_factory_e000: macaddr@e000 {
140 reg = <0xe000 0x6>;
141 };
142
143 macaddr_factory_e006: macaddr@e006 {
144 reg = <0xe006 0x6>;
145 };
146 };
147 };
148
149 partition@50000 {
150 compatible = "denx,uimage";
151 label = "firmware";
152 reg = <0x50000 0x1fb0000>;
153 };
154 };
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie0 {
163 mt76@0,0 {
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_factory_8000>;
166 nvmem-cell-names = "eeprom";
167 ieee80211-freq-limit = <5000000 6000000>;
168 };
169 };
170
171 &pcie1 {
172 mt76@0,0 {
173 reg = <0x0000 0 0 0 0>;
174 nvmem-cells = <&eeprom_factory_0>;
175 nvmem-cell-names = "eeprom";
176 };
177 };
178
179 &gmac0 {
180 nvmem-cells = <&macaddr_factory_e000>;
181 nvmem-cell-names = "mac-address";
182 };
183
184 &switch0 {
185 ports {
186 port@0 {
187 status = "okay";
188 label = "lan4";
189 };
190
191 port@1 {
192 status = "okay";
193 label = "lan3";
194 };
195
196 port@2 {
197 status = "okay";
198 label = "lan2";
199 };
200
201 port@3 {
202 status = "okay";
203 label = "lan1";
204 };
205
206 port@4 {
207 status = "okay";
208 label = "wan";
209 nvmem-cells = <&macaddr_factory_e006>;
210 nvmem-cell-names = "mac-address";
211 };
212 };
213 };
214
215 &state_default {
216 gpio {
217 groups = "i2c", "jtag", "uart2", "uart3";
218 function = "gpio";
219 };
220 };