ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_youhua_wr1200js.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "youhua,wr1200js", "mediatek,mt7621-soc";
8 model = "YouHua WR1200JS";
9
10 aliases {
11 led-boot = &led_wps;
12 led-failsafe = &led_wps;
13 };
14
15 chosen {
16 bootargs = "console=ttyS0,115200";
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 internet {
23 label = "blue:internet";
24 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
25 };
26
27 led_wps: wps {
28 label = "blue:wps";
29 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
30 };
31
32 usb {
33 label = "blue:usb";
34 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
35 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
36 linux,default-trigger = "usbport";
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48
49 wps {
50 label = "wps";
51 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_WPS_BUTTON>;
53 };
54
55 wifi {
56 label = "wifi";
57 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RFKILL>;
59 };
60 };
61 };
62
63 &spi0 {
64 status = "okay";
65
66 flash@0 {
67 compatible = "jedec,spi-nor";
68 reg = <0>;
69 spi-max-frequency = <10000000>;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "u-boot";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "u-boot-env";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 compatible = "nvmem-cells";
90 label = "factory";
91 reg = <0x40000 0x10000>;
92 #address-cells = <1>;
93 #size-cells = <1>;
94 read-only;
95
96 eeprom_factory_0: eeprom@0 {
97 reg = <0x0 0x400>;
98 };
99
100 eeprom_factory_8000: eeprom@8000 {
101 reg = <0x8000 0x200>;
102 };
103
104 macaddr_factory_e000: macaddr@e000 {
105 reg = <0xe000 0x6>;
106 };
107
108 macaddr_factory_e006: macaddr@e006 {
109 reg = <0xe006 0x6>;
110 };
111 };
112
113 partition@50000 {
114 compatible = "denx,uimage";
115 label = "firmware";
116 reg = <0x50000 0xfb0000>;
117 };
118 };
119 };
120 };
121
122 &pcie {
123 status = "okay";
124 };
125
126 &pcie0 {
127 mt76@0,0 {
128 reg = <0x0000 0 0 0 0>;
129 nvmem-cells = <&eeprom_factory_0>;
130 nvmem-cell-names = "eeprom";
131 };
132 };
133
134 &pcie1 {
135 mt76@0,0 {
136 reg = <0x0000 0 0 0 0>;
137 nvmem-cells = <&eeprom_factory_8000>;
138 nvmem-cell-names = "eeprom";
139 ieee80211-freq-limit = <5000000 6000000>;
140
141 led {
142 led-sources = <2>;
143 led-active-low;
144 };
145 };
146 };
147
148 &gmac0 {
149 nvmem-cells = <&macaddr_factory_e000>;
150 nvmem-cell-names = "mac-address";
151 };
152
153 &gmac1 {
154 status = "okay";
155 label = "wan";
156 phy-handle = <&ethphy0>;
157
158 nvmem-cells = <&macaddr_factory_e006>;
159 nvmem-cell-names = "mac-address";
160 };
161
162 &mdio {
163 ethphy0: ethernet-phy@0 {
164 reg = <0>;
165 };
166 };
167
168 &switch0 {
169 ports {
170 port@1 {
171 status = "okay";
172 label = "lan1";
173 };
174
175 port@2 {
176 status = "okay";
177 label = "lan2";
178 };
179
180 port@3 {
181 status = "okay";
182 label = "lan3";
183 };
184
185 port@4 {
186 status = "okay";
187 label = "lan4";
188 };
189 };
190 };
191
192 &state_default {
193 gpio {
194 groups = "i2c", "uart2", "uart3", "wdt";
195 function = "gpio";
196 };
197 };