ramips: fix mtd partition node names for Phicomm PSG1208
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_yuncore_fap640.dts
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 compatible = "yuncore,fap640", "mediatek,mt7621-soc";
10 model = "YunCore FAP640";
11
12 aliases {
13 led-boot = &led_status_blue;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_green;
16 led-upgrade = &led_status_red;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_green: status_green {
28 label = "green:status";
29 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
30 };
31
32 led_status_red: status_red {
33 label = "red:status";
34 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_blue: status_blue {
38 label = "blue:status";
39 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
40 };
41
42 wan {
43 label = "green:wan";
44 gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "mt7530-0:04:link";
46 };
47
48 lan1 {
49 label = "green:lan1";
50 gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
51 linux,default-trigger = "mt7530-0:03:link";
52 };
53
54 lan2 {
55 label = "green:lan2";
56 gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
57 linux,default-trigger = "mt7530-0:02:link";
58 };
59
60 lan3 {
61 label = "green:lan3";
62 gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "mt7530-0:01:link";
64 };
65
66 lan4 {
67 label = "green:lan4";
68 gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
69 linux,default-trigger = "mt7530-0:00:link";
70 };
71 };
72
73 watchdog {
74 compatible = "linux,wdt-gpio";
75 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
76 hw_algo = "toggle";
77 hw_margin_ms = <200>;
78 always-running;
79 };
80
81 keys {
82 compatible = "gpio-keys";
83
84 reset {
85 label = "reset";
86 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
87 linux,code = <KEY_RESTART>;
88 };
89 };
90 };
91
92 &spi0 {
93 status = "okay";
94
95 flash@0 {
96 compatible = "jedec,spi-nor";
97 reg = <0>;
98 spi-max-frequency = <80000000>;
99 m25p,fast-read;
100
101 partitions {
102 compatible = "fixed-partitions";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 partition@0 {
107 label = "Bootloader";
108 reg = <0x0 0x30000>;
109 read-only;
110 };
111
112 partition@30000 {
113 label = "Config";
114 reg = <0x30000 0x10000>;
115 read-only;
116 };
117
118 /* range 0x40000 to 0x50000 is empty in vendor
119 * firmware, so we do not use it either
120 */
121
122 factory: partition@50000 {
123 compatible = "nvmem-cells";
124 label = "Factory";
125 reg = <0x50000 0x40000>;
126 #address-cells = <1>;
127 #size-cells = <1>;
128 read-only;
129
130 eeprom_factory_0: eeprom@0 {
131 reg = <0x0 0xe00>;
132 };
133
134 macaddr_factory_0004: macaddr@0004 {
135 reg = <0x0004 0x6>;
136 };
137
138 macaddr_factory_e006: macaddr@e006 {
139 reg = <0xe006 0x6>;
140 };
141 };
142
143 partition@90000 {
144 compatible = "denx,uimage";
145 label = "firmware";
146 reg = <0x90000 0xf70000>;
147 };
148 };
149 };
150 };
151
152 &pcie {
153 status = "okay";
154 };
155
156 &pcie1 {
157 wifi@0,0 {
158 compatible = "mediatek,mt76";
159 reg = <0x0000 0 0 0 0>;
160 nvmem-cells = <&eeprom_factory_0>;
161 nvmem-cell-names = "eeprom";
162 mediatek,disable-radar-background;
163 };
164 };
165
166 &gmac0 {
167 nvmem-cells = <&macaddr_factory_e006>;
168 nvmem-cell-names = "mac-address";
169 };
170
171 &gmac1 {
172 status = "okay";
173 label = "wan";
174 phy-handle = <&ethphy4>;
175
176 nvmem-cells = <&macaddr_factory_0004>;
177 nvmem-cell-names = "mac-address";
178 };
179
180 &mdio {
181 ethphy4: ethernet-phy@4 {
182 reg = <4>;
183 };
184 };
185
186
187 &switch0 {
188 gpio-controller;
189 #gpio-cells = <2>;
190
191 ports {
192 port@0 {
193 status = "okay";
194 label = "lan4";
195 };
196
197 port@1 {
198 status = "okay";
199 label = "lan3";
200 };
201
202 port@2 {
203 status = "okay";
204 label = "lan2";
205 };
206
207 port@3 {
208 status = "okay";
209 label = "lan1";
210 };
211 };
212 };
213
214 &state_default {
215 gpio {
216 groups = "jtag", "wdt";
217 function = "gpio";
218 };
219 };