ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_ampedwireless_ally.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_amber;
11 led-failsafe = &led_status_amber;
12 led-running = &led_status_green;
13 led-upgrade = &led_status_red;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 led_switch {
20 label = "led_switch";
21 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
22 linux,code = <KEY_LIGHTS_TOGGLE>;
23 linux,input-type = <EV_SW>;
24 };
25
26 reset {
27 label = "reset";
28 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31
32 wps {
33 label = "wps";
34 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
35 linux,code = <KEY_WPS_BUTTON>;
36 };
37 };
38
39 leds {
40 compatible = "gpio-leds";
41
42 led_status_green: status_green {
43 label = "green:status";
44 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
45 };
46
47 led_status_red: status_red {
48 label = "red:status";
49 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
50 };
51
52 led_status_amber: status_amber {
53 label = "amber:status";
54 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
55 };
56 };
57 };
58
59 &pcie {
60 status = "okay";
61 };
62
63 &pcie0 {
64 wifi@0,0 {
65 compatible = "pci14c3,7615";
66 reg = <0x0000 0 0 0 0>;
67 nvmem-cells = <&eeprom_factory_0>;
68 nvmem-cell-names = "eeprom";
69 ieee80211-freq-limit = <2400000 2500000>;
70 };
71 };
72
73 &pcie1 {
74 wifi@0,0 {
75 compatible = "pci14c3,7615";
76 reg = <0x0000 0 0 0 0>;
77 nvmem-cells = <&eeprom_factory_8000>;
78 nvmem-cell-names = "eeprom";
79 ieee80211-freq-limit = <5000000 6000000>;
80 };
81 };
82
83 &state_default {
84 gpio {
85 groups = "uart2", "uart3", "jtag", "wdt";
86 function = "gpio";
87 };
88 };
89
90 &nand {
91 status = "okay";
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "u-boot";
100 reg = <0x0 0x80000>;
101 read-only;
102 };
103
104 partition@80000 {
105 label = "u-boot-env";
106 reg = <0x80000 0x80000>;
107 };
108
109 factory: partition@100000 {
110 compatible = "nvmem-cells";
111 label = "factory";
112 reg = <0x100000 0x40000>;
113 #address-cells = <1>;
114 #size-cells = <1>;
115 read-only;
116
117 eeprom_factory_0: eeprom@0 {
118 reg = <0x0 0x4da8>;
119 };
120
121 eeprom_factory_8000: eeprom@8000 {
122 reg = <0x8000 0x4da8>;
123 };
124 };
125
126 /*
127 * uboot expects to find kernels at 0x140000 & 0x2140000,
128 * referred to as Uimage & Uimage1 in factory FW, respectively.
129 * U-boot variable 'bootImage' controls which is booted;
130 * 0 for the first, 1 for the 2nd.
131 * There's a 3rd partition, Uimage2 (0x4140000), which
132 * I expected to be a recovery image, but is actually blank.
133 *
134 * A kernel is considered suitable for handing control over
135 * if its linux magic number exists & uImage CRC are correct.
136 * If either of those conditions fail, 'bootImage' value
137 * is toggled in uboot env & a restart performed in the hope that the
138 * alternate kernel is okay.
139 *
140 * Note uboot's tftp flash install writes the transferred
141 * image to the active kernel partition.
142 */
143
144 partition@140000 {
145 label = "kernel";
146 reg = <0x140000 0x400000>;
147 };
148
149 partition@540000 {
150 label = "ubi";
151 reg = <0x540000 0x1c00000>;
152 };
153
154 partition@2140000 {
155 label = "oem";
156 reg = <0x2140000 0x2000000>;
157 };
158
159 partition@4140000 {
160 label = "backup";
161 reg = <0x4140000 0x2000000>;
162 };
163
164 partition@6140000 {
165 label = "chime";
166 reg = <0x6140000 0xa00000>;
167 };
168
169 partition@6b40000 {
170 label = "data";
171 reg = <0x6b40000 0xa00000>;
172 };
173
174 partition@7540000 {
175 label = "reserved";
176 reg = <0x7540000 0x840000>;
177 read-only;
178 };
179
180 partition@7d80000 {
181 label = "nvram";
182 reg = <0x7d80000 0x100000>;
183 read-only;
184 };
185
186 partition@7e80000 {
187 label = "hwconfig";
188 reg = <0x7e80000 0x100000>;
189 read-only;
190 };
191 };
192 };