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