ramips: mt7628: use nvmem-layout
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7628an_ravpower_rp-wd009.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "ravpower,rp-wd009", "mediatek,mt7628an-soc";
10 model = "RAVPower RP-WD009";
11
12 aliases {
13 led-boot = &led_globe;
14 led-failsafe = &led_globe;
15 led-running = &led_globe;
16 led-upgrade = &led_globe;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_globe: globe {
23 label = "white:globe";
24 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
25 };
26
27 wlan2 {
28 label = "white:wlan2";
29 gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
30 linux,default-trigger = "phy0tpt";
31 };
32
33 wlan5 {
34 label = "white:wlan5";
35 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
36 linux,default-trigger = "phy1tpt";
37 };
38
39 sd_white {
40 label = "white:sd";
41 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
42 };
43
44 sd_red {
45 label = "red:sd";
46 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
47 };
48 };
49
50 keys {
51 compatible = "gpio-keys";
52
53 reset {
54 label = "reset";
55 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
56 linux,code = <KEY_RESTART>;
57 };
58
59 /* Power interrupt on Pin 39 */
60
61 rfkill {
62 label = "rfkill";
63 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
64 linux,code = <KEY_RFKILL>;
65 };
66
67 backup {
68 label = "backup";
69 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
70 linux,code = <KEY_COPY>;
71 };
72 };
73 };
74
75 &gpio {
76 mt7610-power {
77 gpio-hog;
78 gpios = <20 GPIO_ACTIVE_HIGH>;
79 output-high;
80 line-name = "mt7610-power";
81 };
82 };
83
84 &state_default {
85 gpio {
86 groups = "uart1", "wled_an", "p0led_an", "p2led_an", "p3led_an",
87 "p4led_an", "uart2", "pwm0", "i2s";
88 function = "gpio";
89 };
90 };
91
92 &sdhci {
93 status = "okay";
94 };
95
96 &i2c {
97 status = "okay";
98
99 /* Custom PMIC at 0x0a */
100 };
101
102 &pcie {
103 status = "okay";
104 };
105
106 &pcie0 {
107 wifi@0,0 {
108 reg = <0x0000 0 0 0 0>;
109 nvmem-cells = <&eeprom_factory_8000>;
110 nvmem-cell-names = "eeprom";
111 ieee80211-freq-limit = <5470000 6000000>;
112 };
113 };
114
115 &spi0 {
116 status = "okay";
117
118 flash@0 {
119 compatible = "jedec,spi-nor";
120 reg = <0>;
121 spi-max-frequency = <40000000>;
122
123 partitions {
124 compatible = "fixed-partitions";
125 #address-cells = <1>;
126 #size-cells = <1>;
127
128 partition@0 {
129 label = "bootloader";
130 reg = <0x0 0x30000>;
131 read-only;
132 };
133
134 partition@30000 {
135 label = "config";
136 reg = <0x30000 0x10000>;
137 read-only;
138 };
139
140 factory: partition@40000 {
141 label = "factory";
142 reg = <0x40000 0x10000>;
143 read-only;
144
145 nvmem-layout {
146 compatible = "fixed-layout";
147 #address-cells = <1>;
148 #size-cells = <1>;
149
150 eeprom_factory_0: eeprom@0 {
151 reg = <0x0 0x400>;
152 };
153
154 eeprom_factory_8000: eeprom@8000 {
155 reg = <0x8000 0x200>;
156 };
157
158 macaddr_factory_4: macaddr@4 {
159 reg = <0x4 0x6>;
160 };
161 };
162 };
163
164 partition@50000 {
165 label = "loader";
166 reg = <0x50000 0x180000>;
167 };
168
169 partition@1d0000 {
170 label = "params";
171 reg = <0x1d0000 0x10000>;
172 read-only;
173 };
174
175 partition@1e0000 {
176 label = "user_backup";
177 reg = <0x1e0000 0x10000>;
178 read-only;
179 };
180
181 partition@1f0000 {
182 label = "user";
183 reg = <0x1f0000 0x10000>;
184 read-only;
185 };
186
187 partition@200000 {
188 compatible = "denx,uimage";
189 label = "firmware";
190 reg = <0x200000 0xdf0000>;
191 };
192
193 partition@ff0000 {
194 label = "mode";
195 reg = <0xff0000 0x10000>;
196 read-only;
197 };
198 };
199 };
200 };
201
202 &wmac {
203 status = "okay";
204
205 nvmem-cells = <&eeprom_factory_0>;
206 nvmem-cell-names = "eeprom";
207 };
208
209 &ethernet {
210 nvmem-cells = <&macaddr_factory_4>;
211 nvmem-cell-names = "mac-address";
212 };