ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_mtc_wr1201.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "mtc,wr1201", "mediatek,mt7621-soc";
8 model = "MTC Wireless Router WR1201";
9
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 label-mac-device = &gmac0;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 led_power: power {
22 label = "green:power";
23 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
24 };
25
26 usb {
27 label = "green:usb";
28 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
29 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
30 linux,default-trigger = "usbport";
31 };
32
33 eth_link {
34 label = "green:eth_link";
35 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
36 };
37
38 wps {
39 label = "green:wps";
40 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
41 };
42 };
43
44 keys {
45 compatible = "gpio-keys";
46
47 reset {
48 label = "reset";
49 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_RESTART>;
51 };
52 };
53 };
54
55 &spi0 {
56 status = "okay";
57
58 flash@0 {
59 compatible = "jedec,spi-nor";
60 reg = <0>;
61 spi-max-frequency = <10000000>;
62
63 partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "Bootloader";
70 reg = <0x0 0x30000>;
71 read-only;
72 };
73
74 partition@30000 {
75 label = "Config";
76 reg = <0x30000 0x10000>;
77 read-only;
78 };
79
80 factory: partition@40000 {
81 label = "factory";
82 reg = <0x40000 0x10000>;
83 read-only;
84 };
85
86 partition@50000 {
87 compatible = "denx,uimage";
88 label = "firmware";
89 reg = <0x50000 0xfa0000>;
90 };
91
92 partition@ff0000 {
93 label = "Second_Config";
94 reg = <0xff0000 0x10000>;
95 read-only;
96 };
97 };
98 };
99 };
100
101 &gmac0 {
102 nvmem-cells = <&macaddr_factory_4>;
103 nvmem-cell-names = "mac-address";
104 };
105
106 &switch0 {
107 ports {
108 port@0 {
109 status = "okay";
110 label = "lan4";
111 };
112
113 port@1 {
114 status = "okay";
115 label = "lan3";
116 };
117
118 port@2 {
119 status = "okay";
120 label = "lan2";
121 };
122
123 port@3 {
124 status = "okay";
125 label = "lan1";
126 };
127
128 port@4 {
129 status = "okay";
130 label = "wan";
131 nvmem-cells = <&macaddr_factory_4>;
132 nvmem-cell-names = "mac-address";
133 mac-address-increment = <1>;
134 };
135 };
136 };
137
138 &sdhci {
139 status = "okay";
140 };
141
142 &pcie {
143 status = "okay";
144 };
145
146 &pcie0 {
147 wifi@0,0 {
148 reg = <0x0000 0 0 0 0>;
149 mediatek,mtd-eeprom = <&factory 0x8000>;
150 ieee80211-freq-limit = <5000000 6000000>;
151
152 led {
153 led-sources = <2>;
154 led-active-low;
155 };
156 };
157 };
158
159 &pcie1 {
160 wifi@0,0 {
161 reg = <0x0000 0 0 0 0>;
162 mediatek,mtd-eeprom = <&factory 0x0000>;
163 ieee80211-freq-limit = <2400000 2500000>;
164
165 led {
166 led-sources = <2>;
167 led-active-low;
168 };
169 };
170 };
171
172 &state_default {
173 gpio {
174 groups = "rgmii2";
175 function = "gpio";
176 };
177 };
178
179 &factory {
180 compatible = "nvmem-cells";
181 #address-cells = <1>;
182 #size-cells = <1>;
183
184 macaddr_factory_4: macaddr@4 {
185 reg = <0x4 0x6>;
186 };
187 };