ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_nand_128m.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 chosen {
10 bootargs = "console=ttyS0,115200n8";
11 };
12
13 keys: keys {
14 compatible = "gpio-keys";
15
16 reset {
17 label = "reset";
18 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
19 linux,code = <KEY_RESTART>;
20 };
21 };
22 };
23
24 &nand {
25 status = "okay";
26
27 partitions {
28 compatible = "fixed-partitions";
29 #address-cells = <1>;
30 #size-cells = <1>;
31
32 partition@0 {
33 label = "Bootloader";
34 reg = <0x0 0x80000>;
35 read-only;
36 };
37
38 partition@80000 {
39 label = "Config";
40 reg = <0x80000 0x40000>;
41 };
42
43 partition@c0000 {
44 label = "Bdata";
45 reg = <0xc0000 0x40000>;
46 read-only;
47 };
48
49 factory: partition@100000 {
50 label = "factory";
51 reg = <0x100000 0x40000>;
52 read-only;
53 };
54
55 partition@140000 {
56 label = "crash";
57 reg = <0x140000 0x40000>;
58 };
59
60 partition@180000 {
61 label = "crash_syslog";
62 reg = <0x180000 0x40000>;
63 };
64
65 partition@1c0000 {
66 label = "reserved0";
67 reg = <0x1c0000 0x40000>;
68 read-only;
69 };
70
71 /* uboot expects to find kernels at 0x200000 & 0x600000
72 * referred to as system 1 & system 2 respectively.
73 * a kernel is considered suitable for handing control over
74 * if its linux magic number exists & uImage CRC are correct.
75 * If either of those conditions fail, a matching sys'n'_fail flag
76 * is set in uboot env & a restart performed in the hope that the
77 * alternate kernel is okay.
78 * if neither kernel checksums ok and both are marked failed, system 2
79 * is booted anyway.
80 *
81 * Note uboot's tftp flash install writes the transferred
82 * image to both kernel partitions.
83 */
84
85 /* We keep stock xiaomi firmware (kernel0) here */
86 partition@200000 {
87 label = "kernel_stock";
88 reg = <0x200000 0x400000>;
89 };
90
91 partition@600000 {
92 label = "kernel";
93 reg = <0x600000 0x400000>;
94 };
95
96 /* ubi partition is the result of squashing
97 * next consecutive stock partitions:
98 * - rootfs0 (rootfs partition for stock kernel0),
99 * - rootfs1 (rootfs partition for stock failsafe kernel1),
100 * - overlay (used as ubi overlay in stock fw)
101 * resulting 117,5MiB space for packages.
102 */
103
104 partition@a00000 {
105 label = "ubi";
106 reg = <0xa00000 0x7580000>;
107 };
108 };
109 };