ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/staging/blocktrron.git] / target / linux / ramips / dts / mt7621_wevo_w2914ns-v2.dtsi
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 aliases {
8 label-mac-device = &wan;
9 };
10
11 leds {
12 compatible = "gpio-leds";
13
14 usb {
15 label = "green:usb";
16 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
17 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
18 linux,default-trigger = "usbport";
19 };
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30
31 wps {
32 label = "wps";
33 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
34 linux,code = <KEY_WPS_BUTTON>;
35 };
36 };
37 };
38
39 &spi0 {
40 status = "okay";
41
42 flash@0 {
43 compatible = "jedec,spi-nor";
44 reg = <0>;
45 spi-max-frequency = <80000000>;
46 m25p,fast-read;
47
48 partitions {
49 compatible = "fixed-partitions";
50 #address-cells = <1>;
51 #size-cells = <1>;
52
53 partition@0 {
54 label = "u-boot";
55 reg = <0x0 0x30000>;
56 read-only;
57 };
58
59 partition@30000 {
60 label = "u-boot-env";
61 reg = <0x30000 0x10000>;
62 read-only;
63 };
64
65 factory: partition@40000 {
66 compatible = "nvmem-cells";
67 label = "factory";
68 reg = <0x40000 0x10000>;
69 #address-cells = <1>;
70 #size-cells = <1>;
71 read-only;
72
73 eeprom_factory_0: eeprom@0 {
74 reg = <0x0 0x400>;
75 };
76
77 macaddr_factory_2e: macaddr@2e {
78 reg = <0x2e 0x6>;
79 };
80
81 macaddr_factory_e000: macaddr@e000 {
82 reg = <0xe000 0x6>;
83 };
84 };
85
86 partition@50000 {
87 compatible = "denx,uimage";
88 label = "firmware";
89 reg = <0x50000 0xfb0000>;
90 };
91 };
92 };
93 };
94
95 &pcie {
96 status = "okay";
97 };
98
99 &pcie0 {
100 wifi@0,0 {
101 compatible = "mediatek,mt76";
102 reg = <0x0000 0 0 0 0>;
103 nvmem-cells = <&eeprom_factory_0>;
104 nvmem-cell-names = "eeprom";
105
106 led {
107 led-sources = <0>;
108 led-active-low;
109 };
110 };
111 };
112
113 &pcie1 {
114 wifi@0,0 {
115 compatible = "mediatek,mt76";
116 reg = <0x0000 0 0 0 0>;
117 mediatek,mtd-eeprom = <&factory 0x8000>;
118 ieee80211-freq-limit = <5000000 6000000>;
119
120 led {
121 led-sources = <2>;
122 led-active-low;
123 };
124 };
125 };
126
127 &ethernet {
128 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
129 };
130
131 &gmac0 {
132 nvmem-cells = <&macaddr_factory_e000>;
133 nvmem-cell-names = "mac-address";
134 };
135
136 &switch0 {
137 ports {
138 port@0 {
139 status = "okay";
140 label = "lan4";
141 };
142
143 port@1 {
144 status = "okay";
145 label = "lan3";
146 };
147
148 port@2 {
149 status = "okay";
150 label = "lan2";
151 };
152
153 port@3 {
154 status = "okay";
155 label = "lan1";
156 };
157 wan: port@4 {
158 status = "okay";
159 label = "wan";
160 nvmem-cells = <&macaddr_factory_2e>;
161 nvmem-cell-names = "mac-address";
162 };
163 };
164 };
165
166 &state_default {
167 gpio {
168 groups = "wdt", "rgmii2";
169 function = "gpio";
170 };
171 };