ramips: convert MT7603 EEPROM to NVMEM format
[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 macaddr_factory_e000: macaddr@e000 {
101 reg = <0xe000 0x6>;
102 };
103
104 macaddr_factory_e006: macaddr@e006 {
105 reg = <0xe006 0x6>;
106 };
107 };
108
109 partition@50000 {
110 compatible = "denx,uimage";
111 label = "firmware";
112 reg = <0x50000 0xfb0000>;
113 };
114 };
115 };
116 };
117
118 &pcie {
119 status = "okay";
120 };
121
122 &pcie0 {
123 mt76@0,0 {
124 reg = <0x0000 0 0 0 0>;
125 nvmem-cells = <&eeprom_factory_0>;
126 nvmem-cell-names = "eeprom";
127 };
128 };
129
130 &pcie1 {
131 mt76@0,0 {
132 reg = <0x0000 0 0 0 0>;
133 mediatek,mtd-eeprom = <&factory 0x8000>;
134 ieee80211-freq-limit = <5000000 6000000>;
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 = <&ethphy0>;
152
153 nvmem-cells = <&macaddr_factory_e006>;
154 nvmem-cell-names = "mac-address";
155 };
156
157 &mdio {
158 ethphy0: ethernet-phy@0 {
159 reg = <0>;
160 };
161 };
162
163 &switch0 {
164 ports {
165 port@1 {
166 status = "okay";
167 label = "lan1";
168 };
169
170 port@2 {
171 status = "okay";
172 label = "lan2";
173 };
174
175 port@3 {
176 status = "okay";
177 label = "lan3";
178 };
179
180 port@4 {
181 status = "okay";
182 label = "lan4";
183 };
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "i2c", "uart2", "uart3", "wdt";
190 function = "gpio";
191 };
192 };