ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "factory";
111 reg = <0x100000 0x40000>;
112 read-only;
113
114 nvmem-layout {
115 compatible = "fixed-layout";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 eeprom_factory_0: eeprom@0 {
120 reg = <0x0 0x4da8>;
121 };
122
123 eeprom_factory_8000: eeprom@8000 {
124 reg = <0x8000 0x4da8>;
125 };
126 };
127 };
128
129 /*
130 * uboot expects to find kernels at 0x140000 & 0x2140000,
131 * referred to as Uimage & Uimage1 in factory FW, respectively.
132 * U-boot variable 'bootImage' controls which is booted;
133 * 0 for the first, 1 for the 2nd.
134 * There's a 3rd partition, Uimage2 (0x4140000), which
135 * I expected to be a recovery image, but is actually blank.
136 *
137 * A kernel is considered suitable for handing control over
138 * if its linux magic number exists & uImage CRC are correct.
139 * If either of those conditions fail, 'bootImage' value
140 * is toggled in uboot env & a restart performed in the hope that the
141 * alternate kernel is okay.
142 *
143 * Note uboot's tftp flash install writes the transferred
144 * image to the active kernel partition.
145 */
146
147 partition@140000 {
148 label = "kernel";
149 reg = <0x140000 0x400000>;
150 };
151
152 partition@540000 {
153 label = "ubi";
154 reg = <0x540000 0x1c00000>;
155 };
156
157 partition@2140000 {
158 label = "oem";
159 reg = <0x2140000 0x2000000>;
160 };
161
162 partition@4140000 {
163 label = "backup";
164 reg = <0x4140000 0x2000000>;
165 };
166
167 partition@6140000 {
168 label = "chime";
169 reg = <0x6140000 0xa00000>;
170 };
171
172 partition@6b40000 {
173 label = "data";
174 reg = <0x6b40000 0xa00000>;
175 };
176
177 partition@7540000 {
178 label = "reserved";
179 reg = <0x7540000 0x840000>;
180 read-only;
181 };
182
183 partition@7d80000 {
184 label = "nvram";
185 reg = <0x7d80000 0x100000>;
186 read-only;
187 };
188
189 partition@7e80000 {
190 label = "hwconfig";
191 reg = <0x7e80000 0x100000>;
192 read-only;
193 };
194 };
195 };