ramips: mt7621: convert to nvmem-layout
[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 &gmac1 {
75 status = "okay";
76 label = "wan";
77 phy-handle = <&ethphy0>;
78
79 nvmem-cells = <&macaddr_factory_e006>;
80 nvmem-cell-names = "mac-address";
81 };
82
83 &mdio {
84 ethphy0: ethernet-phy@0 {
85 reg = <0>;
86 };
87 };
88
89 &switch0 {
90 ports {
91 port@1 {
92 status = "okay";
93 label = "lan4";
94 };
95
96 port@2 {
97 status = "okay";
98 label = "lan3";
99 };
100
101 port@3 {
102 status = "okay";
103 label = "lan2";
104 };
105
106 port@4 {
107 status = "okay";
108 label = "lan1";
109 };
110 };
111 };
112
113 &spi0 {
114 status = "okay";
115
116 flash@0 {
117 compatible = "jedec,spi-nor";
118 reg = <0>;
119 spi-max-frequency = <10000000>;
120
121 partitions {
122 compatible = "fixed-partitions";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 partition@0 {
127 label = "u-boot";
128 reg = <0x0 0x30000>;
129 read-only;
130 };
131
132 partition@30000 {
133 label = "u-boot-env";
134 reg = <0x30000 0x10000>;
135 read-only;
136 };
137
138 factory: partition@40000 {
139 label = "factory";
140 reg = <0x40000 0x10000>;
141 read-only;
142
143 nvmem-layout {
144 compatible = "fixed-layout";
145 #address-cells = <1>;
146 #size-cells = <1>;
147
148 eeprom_factory_0: eeprom@0 {
149 reg = <0x0 0x4da8>;
150 };
151
152 macaddr_factory_e000: macaddr@e000 {
153 reg = <0xe000 0x6>;
154 };
155
156 macaddr_factory_e006: macaddr@e006 {
157 reg = <0xe006 0x6>;
158 };
159 };
160 };
161
162 partition@50000 {
163 compatible = "denx,uimage";
164 label = "firmware";
165 reg = <0x50000 0xf20000>;
166 };
167
168 partition@f70000 {
169 label = "user_data";
170 reg = <0xf70000 0x80000>;
171 read-only;
172 };
173
174 partition@ff0000 {
175 label = "NVRAM";
176 reg = <0xff0000 0x10000>;
177 read-only;
178 };
179 };
180 };
181 };
182
183 &state_default {
184 gpio {
185 groups = "i2c", "uart3", "jtag", "wdt";
186 function = "gpio";
187 };
188 };
189
190 &pcie {
191 status = "okay";
192 };
193
194 &pcie0 {
195 wifi@0,0 {
196 compatible = "mediatek,mt76";
197 reg = <0x0000 0 0 0 0>;
198 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>;
199 nvmem-cell-names = "eeprom", "mac-address";
200 mac-address-increment = <1>;
201 };
202 };
203
204 &xhci {
205 status = "disabled";
206 };