ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_wavlink_wl-wn53xax.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_status_red;
11 led-failsafe = &led_status_red;
12 led-running = &led_status_blue;
13 led-upgrade = &led_status_red;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "Reset Button";
21 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_RESTART>;
23 };
24
25 touch { /* RH6015C touch sensor -> GPIO 14 */
26 label = "Touch Button";
27 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
28 linux,code = <BTN_0>;
29 };
30
31 turbo {
32 label = "Turbo Button";
33 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
34 linux,code = <BTN_1>;
35 };
36
37 wps {
38 label = "WPS Button";
39 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_WPS_BUTTON>;
41 };
42 };
43
44 leds {
45 compatible = "gpio-leds";
46
47 led_status_blue: status_blue {
48 label = "blue:power";
49 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
50 };
51
52 led_status_red: status_red {
53 label = "red:power";
54 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
55 };
56
57 wifi2g {
58 label = "blue:wifi2g";
59 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy0tpt";
61 };
62 };
63 };
64
65 &i2c {
66 status = "okay";
67 };
68
69 &spi0 {
70 status = "okay";
71
72 flash@0 {
73 compatible = "jedec,spi-nor";
74 reg = <0>;
75 spi-max-frequency = <40000000>;
76
77 partitions {
78 compatible = "fixed-partitions";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 partition@0 {
83 label = "u-boot";
84 reg = <0x0 0x30000>;
85 read-only;
86 };
87
88 partition@30000 {
89 label = "config";
90 reg = <0x30000 0x10000>;
91 read-only;
92 };
93
94 factory: partition@40000 {
95 label = "factory";
96 reg = <0x40000 0x10000>;
97 read-only;
98
99 nvmem-layout {
100 compatible = "fixed-layout";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 macaddr_factory_e000: macaddr@e000 {
105 reg = <0xe000 0x6>;
106 };
107
108 macaddr_factory_e006: macaddr@e006 {
109 reg = <0xe006 0x6>;
110 };
111 };
112 };
113
114 partition@50000 {
115 compatible = "denx,uimage";
116 label = "firmware";
117 reg = <0x50000 0xeb0000>;
118 };
119
120 partition@f00000 {
121 label = "vendor";
122 reg = <0xf00000 0x100000>;
123 read-only;
124 };
125 };
126 };
127 };
128
129 &pcie {
130 status = "okay";
131 };
132
133 &pcie0 {
134 wifi0: mt76@0,0 {
135 compatible = "mediatek,mt76";
136 reg = <0x0000 0 0 0 0>;
137 mediatek,mtd-eeprom = <&factory 0x0>;
138 };
139 };
140
141 &pcie1 {
142 wifi1: mt76@0,0 {
143 compatible = "mediatek,mt76";
144 reg = <0x0000 0 0 0 0>;
145 mediatek,mtd-eeprom = <&factory 0x8000>;
146 };
147 };
148
149 &ethernet {
150 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
151 };
152
153 &gmac0 {
154 nvmem-cells = <&macaddr_factory_e000>;
155 nvmem-cell-names = "mac-address";
156 };
157
158 &switch0 {
159 ports {
160 port0: port@0 {
161 status = "okay";
162 };
163
164 port1: port@1 {
165 status = "okay";
166 };
167
168 port2: port@2 {
169 status = "okay";
170 };
171
172 port3: port@3 {
173 status = "okay";
174 };
175
176 port@4 {
177 status = "okay";
178 label = "wan";
179 nvmem-cells = <&macaddr_factory_e006>;
180 nvmem-cell-names = "mac-address";
181 };
182 };
183 };
184
185 &state_default {
186 gpio {
187 groups = "rgmii2", "jtag", "wdt";
188 function = "gpio";
189 };
190 };
191
192 &uartlite2 {
193 status = "okay";
194 };