ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_elecom_wrc-1167ghbk2-s.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "elecom,wrc-1167ghbk2-s", "mediatek,mt7621-soc";
8 model = "ELECOM WRC-1167GHBK2-S";
9
10 aliases {
11 led-boot = &led_power_green;
12 led-failsafe = &led_power_green;
13 led-running = &led_power_green;
14 led-upgrade = &led_power_green;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wlan2g {
21 label = "white:wlan2g";
22 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
23 linux,default-trigger = "phy0radio";
24 };
25
26 wlan5g {
27 label = "white:wlan5g";
28 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
29 };
30
31 led_power_green: power_green {
32 label = "green:power";
33 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
34 };
35
36 power_blue {
37 label = "blue:power";
38 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
39 };
40
41 wps {
42 label = "red:wps";
43 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
44 };
45
46 power_red {
47 label = "red:power";
48 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
49 };
50 };
51
52 keys {
53 compatible = "gpio-keys";
54
55 reset {
56 label = "reset";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RESTART>;
59 };
60
61 wps {
62 label = "wps";
63 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
64 linux,code = <KEY_WPS_BUTTON>;
65 };
66 };
67 };
68
69 &gmac0 {
70 nvmem-cells = <&macaddr_factory_e000>;
71 nvmem-cell-names = "mac-address";
72 };
73
74 &switch0 {
75 ports {
76 port@0 {
77 status = "okay";
78 label = "wan";
79 nvmem-cells = <&macaddr_factory_e006>;
80 nvmem-cell-names = "mac-address";
81 };
82
83 port@1 {
84 status = "okay";
85 label = "lan4";
86 };
87
88 port@2 {
89 status = "okay";
90 label = "lan3";
91 };
92
93 port@3 {
94 status = "okay";
95 label = "lan2";
96 };
97
98 port@4 {
99 status = "okay";
100 label = "lan1";
101 };
102 };
103 };
104
105 &spi0 {
106 status = "okay";
107
108 flash@0 {
109 compatible = "jedec,spi-nor";
110 reg = <0>;
111 spi-max-frequency = <10000000>;
112
113 partitions {
114 compatible = "fixed-partitions";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 partition@0 {
119 label = "u-boot";
120 reg = <0x0 0x30000>;
121 read-only;
122 };
123
124 partition@30000 {
125 label = "u-boot-env";
126 reg = <0x30000 0x10000>;
127 read-only;
128 };
129
130 factory: partition@40000 {
131 label = "factory";
132 reg = <0x40000 0x10000>;
133 read-only;
134 };
135
136 partition@50000 {
137 compatible = "denx,uimage";
138 label = "firmware";
139 reg = <0x50000 0xf20000>;
140 };
141
142 partition@f70000 {
143 label = "user_data";
144 reg = <0xf70000 0x80000>;
145 read-only;
146 };
147
148 partition@ff0000 {
149 label = "NVRAM";
150 reg = <0xff0000 0x10000>;
151 read-only;
152 };
153 };
154 };
155 };
156
157 &state_default {
158 gpio {
159 groups = "i2c", "uart3", "jtag", "wdt";
160 function = "gpio";
161 };
162 };
163
164 &pcie {
165 status = "okay";
166 };
167
168 &pcie0 {
169 wifi@0,0 {
170 compatible = "mediatek,mt76";
171 reg = <0x0000 0 0 0 0>;
172 mediatek,mtd-eeprom = <&factory 0x0>;
173 nvmem-cells = <&macaddr_factory_e000>;
174 nvmem-cell-names = "mac-address";
175 mac-address-increment = <1>;
176 };
177 };
178
179 &xhci {
180 status = "disabled";
181 };
182
183 &factory {
184 compatible = "nvmem-cells";
185 #address-cells = <1>;
186 #size-cells = <1>;
187
188 macaddr_factory_e000: macaddr@e000 {
189 reg = <0xe000 0x6>;
190 };
191
192 macaddr_factory_e006: macaddr@e006 {
193 reg = <0xe006 0x6>;
194 };
195 };