ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "factory";
67 reg = <0x40000 0x10000>;
68 read-only;
69
70 nvmem-layout {
71 compatible = "fixed-layout";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 eeprom_factory_0: eeprom@0 {
76 reg = <0x0 0x400>;
77 };
78
79 eeprom_factory_8000: eeprom@8000 {
80 reg = <0x8000 0x200>;
81 };
82
83 macaddr_factory_2e: macaddr@2e {
84 reg = <0x2e 0x6>;
85 };
86
87 macaddr_factory_e000: macaddr@e000 {
88 reg = <0xe000 0x6>;
89 };
90 };
91 };
92
93 partition@50000 {
94 compatible = "denx,uimage";
95 label = "firmware";
96 reg = <0x50000 0xfb0000>;
97 };
98 };
99 };
100 };
101
102 &pcie {
103 status = "okay";
104 };
105
106 &pcie0 {
107 wifi@0,0 {
108 compatible = "mediatek,mt76";
109 reg = <0x0000 0 0 0 0>;
110 nvmem-cells = <&eeprom_factory_0>;
111 nvmem-cell-names = "eeprom";
112
113 led {
114 led-sources = <0>;
115 led-active-low;
116 };
117 };
118 };
119
120 &pcie1 {
121 wifi@0,0 {
122 compatible = "mediatek,mt76";
123 reg = <0x0000 0 0 0 0>;
124 nvmem-cells = <&eeprom_factory_8000>;
125 nvmem-cell-names = "eeprom";
126 ieee80211-freq-limit = <5000000 6000000>;
127
128 led {
129 led-sources = <2>;
130 led-active-low;
131 };
132 };
133 };
134
135 &ethernet {
136 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
137 };
138
139 &gmac0 {
140 nvmem-cells = <&macaddr_factory_e000>;
141 nvmem-cell-names = "mac-address";
142 };
143
144 &switch0 {
145 ports {
146 port@0 {
147 status = "okay";
148 label = "lan4";
149 };
150
151 port@1 {
152 status = "okay";
153 label = "lan3";
154 };
155
156 port@2 {
157 status = "okay";
158 label = "lan2";
159 };
160
161 port@3 {
162 status = "okay";
163 label = "lan1";
164 };
165 wan: port@4 {
166 status = "okay";
167 label = "wan";
168 nvmem-cells = <&macaddr_factory_2e>;
169 nvmem-cell-names = "mac-address";
170 };
171 };
172 };
173
174 &state_default {
175 gpio {
176 groups = "wdt", "rgmii2";
177 function = "gpio";
178 };
179 };