ramips: mt7621: convert to nvmem-layout
[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 nvmem-layout {
55 compatible = "fixed-layout";
56 #address-cells = <1>;
57 #size-cells = <1>;
58
59 macaddr_factory_e000: macaddr@e000 {
60 reg = <0xe000 0x6>;
61 };
62
63 macaddr_factory_e006: macaddr@e006 {
64 reg = <0xe006 0x6>;
65 };
66 };
67 };
68
69 partition@140000 {
70 label = "crash";
71 reg = <0x140000 0x40000>;
72 };
73
74 partition@180000 {
75 label = "crash_syslog";
76 reg = <0x180000 0x40000>;
77 };
78
79 partition@1c0000 {
80 label = "reserved0";
81 reg = <0x1c0000 0x40000>;
82 read-only;
83 };
84
85 /* uboot expects to find kernels at 0x200000 & 0x600000
86 * referred to as system 1 & system 2 respectively.
87 * a kernel is considered suitable for handing control over
88 * if its linux magic number exists & uImage CRC are correct.
89 * If either of those conditions fail, a matching sys'n'_fail flag
90 * is set in uboot env & a restart performed in the hope that the
91 * alternate kernel is okay.
92 * if neither kernel checksums ok and both are marked failed, system 2
93 * is booted anyway.
94 *
95 * Note uboot's tftp flash install writes the transferred
96 * image to both kernel partitions.
97 */
98
99 /* We keep stock xiaomi firmware (kernel0) here */
100 partition@200000 {
101 label = "kernel_stock";
102 reg = <0x200000 0x400000>;
103 };
104
105 partition@600000 {
106 label = "kernel";
107 reg = <0x600000 0x400000>;
108 };
109
110 /* ubi partition is the result of squashing
111 * next consecutive stock partitions:
112 * - rootfs0 (rootfs partition for stock kernel0),
113 * - rootfs1 (rootfs partition for stock failsafe kernel1),
114 * - overlay (used as ubi overlay in stock fw)
115 * resulting 117,5MiB space for packages.
116 */
117
118 partition@a00000 {
119 label = "ubi";
120 reg = <0xa00000 0x7580000>;
121 };
122 };
123 };