ramips: improve support for STORYLiNK SAP-G3200U3
[openwrt/staging/mans0n.git] / target / linux / ramips / dts / mt7621_storylink_sap-g3200u3.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 = "storylink,sap-g3200u3", "mediatek,mt7621-soc";
9 model = "STORYLiNK SAP-G3200U3";
10
11 leds {
12 compatible = "gpio-leds";
13
14 usb {
15 function = LED_FUNCTION_USB;
16 color = <LED_COLOR_ID_GREEN>;
17 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
18 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
19 linux,default-trigger = "usbport";
20 };
21 };
22
23 keys {
24 compatible = "gpio-keys";
25
26 reset {
27 label = "reset";
28 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31
32 rfkill {
33 label = "rfkill";
34 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
35 linux,code = <KEY_RFKILL>;
36 };
37 };
38 };
39
40 &spi0 {
41 status = "okay";
42
43 flash@0 {
44 compatible = "jedec,spi-nor";
45 reg = <0>;
46 spi-max-frequency = <50000000>;
47 m25p,fast-read;
48
49 partitions {
50 compatible = "fixed-partitions";
51 #address-cells = <1>;
52 #size-cells = <1>;
53
54 partition@0 {
55 label = "u-boot";
56 reg = <0x0 0x30000>;
57 read-only;
58 };
59
60 partition@30000 {
61 label = "u-boot-env";
62 reg = <0x30000 0x1000>;
63 read-only;
64 };
65
66 partition@31000 {
67 label = "config";
68 reg = <0x31000 0xf000>;
69 read-only;
70 };
71
72 partition@40000 {
73 label = "factory";
74 reg = <0x40000 0x10000>;
75 read-only;
76
77 nvmem-layout {
78 compatible = "fixed-layout";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 eeprom_factory_0: eeprom@0 {
83 reg = <0x0 0x200>;
84 };
85
86 eeprom_factory_8000: eeprom@8000 {
87 reg = <0x8000 0x200>;
88 };
89
90 macaddr_factory_e000: macaddr@e000 {
91 reg = <0xe000 0x6>;
92 };
93
94 macaddr_factory_e006: macaddr@e006 {
95 reg = <0xe006 0x6>;
96 };
97 };
98 };
99
100 partition@50000 {
101 compatible = "denx,uimage";
102 label = "firmware";
103 reg = <0x50000 0x7b0000>;
104 };
105 };
106 };
107 };
108
109 &pcie {
110 status = "okay";
111 };
112
113 &pcie0 {
114 wifi@0,0 {
115 compatible = "mediatek,mt76";
116 reg = <0x0000 0 0 0 0>;
117 nvmem-cells = <&eeprom_factory_8000>;
118 nvmem-cell-names = "eeprom";
119 ieee80211-freq-limit = <5000000 6000000>;
120
121 led {
122 led-sources = <2>;
123 led-active-low;
124 };
125 };
126 };
127
128 &pcie1 {
129 wifi@0,0 {
130 compatible = "mediatek,mt76";
131 reg = <0x0000 0 0 0 0>;
132 nvmem-cells = <&eeprom_factory_0>;
133 nvmem-cell-names = "eeprom";
134 ieee80211-freq-limit = <2400000 2500000>;
135
136 led {
137 led-sources = <2>;
138 led-active-low;
139 };
140 };
141 };
142
143 &gmac0 {
144 nvmem-cells = <&macaddr_factory_e000>;
145 nvmem-cell-names = "mac-address";
146 };
147
148 &gmac1 {
149 status = "okay";
150 label = "wan";
151 phy-handle = <&ethphy4>;
152
153 nvmem-cells = <&macaddr_factory_e006>;
154 nvmem-cell-names = "mac-address";
155 };
156
157 &mdio {
158 ethphy4: ethernet-phy@4 {
159 reg = <4>;
160 };
161 };
162
163 &switch0 {
164 ports {
165 port@0 {
166 status = "okay";
167 label = "lan4";
168 };
169
170 port@1 {
171 status = "okay";
172 label = "lan3";
173 };
174
175 port@2 {
176 status = "okay";
177 label = "lan2";
178 };
179
180 port@3 {
181 status = "okay";
182 label = "lan1";
183 };
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "uart3", "jtag";
190 function = "gpio";
191 };
192 };