ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_yuncore_fap690.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,fap690", "mediatek,mt7621-soc";
10 model = "YunCore FAP690";
11
12 aliases {
13 led-boot = &led_status_green;
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
43 watchdog {
44 compatible = "linux,wdt-gpio";
45 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
46 hw_algo = "toggle";
47 hw_margin_ms = <200>;
48 always-running;
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 reset {
55 label = "reset";
56 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_RESTART>;
58 };
59 };
60 };
61
62 &spi0 {
63 status = "okay";
64
65 flash@0 {
66 compatible = "jedec,spi-nor";
67 reg = <0>;
68 spi-max-frequency = <80000000>;
69 m25p,fast-read;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "Bootloader";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "Config";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 /* range 0x40000 to 0x50000 is empty in vendor
89 * firmware, so we do not use it either
90 */
91
92 factory: partition@50000 {
93 label = "Factory";
94 reg = <0x50000 0x40000>;
95 read-only;
96
97 nvmem-layout {
98 compatible = "fixed-layout";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 eeprom_factory_0: eeprom@0 {
103 reg = <0x0 0xe00>;
104 };
105
106 macaddr_factory_4: macaddr@4 {
107 reg = <0x4 0x6>;
108 };
109
110 precal_factory_e10: precal@e10 {
111 reg = <0xe10 0x19c10>;
112 };
113 };
114 };
115
116 partition@90000 {
117 compatible = "denx,uimage";
118 label = "firmware";
119 reg = <0x90000 0xf70000>;
120 };
121 };
122 };
123 };
124
125 &pcie {
126 status = "okay";
127 };
128
129 &pcie1 {
130 wifi@0,0 {
131 compatible = "mediatek,mt76";
132 reg = <0x0000 0 0 0 0>;
133 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
134 nvmem-cell-names = "eeprom", "precal";
135 mediatek,disable-radar-background;
136 };
137 };
138
139 &gmac0 {
140 nvmem-cells = <&macaddr_factory_4>;
141 nvmem-cell-names = "mac-address";
142 };
143
144 &switch0 {
145 ports {
146 port@4 {
147 status = "okay";
148 label = "lan";
149 };
150 };
151 };
152
153 &state_default {
154 gpio {
155 groups = "jtag", "wdt";
156 function = "gpio";
157 };
158 };