280fc5957e49ce8552d86ec75540595e631fa46d
[openwrt/openwrt.git] / target / linux / mvebu / patches-5.15 / 320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch
1 --- a/arch/arm/boot/dts/armada-370-synology-ds213j.dts
2 +++ b/arch/arm/boot/dts/armada-370-synology-ds213j.dts
3 @@ -31,6 +31,7 @@
4
5 chosen {
6 stdout-path = "serial0:115200n8";
7 + append-rootblock = "nullparameter="; /* override the bootloader args */
8 };
9
10 memory@0 {
11 @@ -94,6 +95,8 @@
12 status = "okay";
13 phy = <&phy1>;
14 phy-mode = "sgmii";
15 + nvmem-cells = <&macaddr_vendor_0>;
16 + nvmem-cell-names = "mac-address";
17 };
18
19 sata@a0000 {
20 @@ -175,6 +178,24 @@
21 gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
22 };
23 };
24 +
25 + virtual_flash {
26 + compatible = "mtd-concat";
27 +
28 + devices = <&mtd_kernel &mtd_gap &mtd_gap2>;
29 +
30 + partitions {
31 + compatible = "fixed-partitions";
32 + #address-cells = <1>;
33 + #size-cells = <1>;
34 +
35 + partition@0 {
36 + compatible = "openwrt,uimage", "denx,uimage";
37 + label = "firmware";
38 + reg = <0x0 0x0>;
39 + };
40 + };
41 + };
42 };
43
44 &mdio {
45 @@ -265,48 +286,52 @@
46 reg = <0>; /* Chip select 0 */
47 spi-max-frequency = <20000000>;
48
49 - /*
50 - * Warning!
51 - *
52 - * Synology u-boot uses its compiled-in environment
53 - * and it seems Synology did not care to change u-boot
54 - * default configuration in order to allow saving a
55 - * modified environment at a sensible location. So,
56 - * if you do a 'saveenv' under u-boot, your modified
57 - * environment will be saved at 1MB after the start
58 - * of the flash, i.e. in the middle of the uImage.
59 - * For that reason, it is strongly advised not to
60 - * change the default environment, unless you know
61 - * what you are doing.
62 - */
63 - partition@0 { /* u-boot */
64 - label = "RedBoot";
65 - reg = <0x00000000 0x000c0000>; /* 768KB */
66 - };
67 + partitions {
68 + compatible = "fixed-partitions";
69
70 - partition@c0000 { /* uImage */
71 - label = "zImage";
72 - reg = <0x000c0000 0x002d0000>; /* 2880KB */
73 - };
74 + partition@0 { /* u-boot */
75 + label = "u-boot";
76 + reg = <0x00000000 0x000c0000>; /* 768KB */
77 + read-only;
78 + };
79
80 - partition@390000 { /* uInitramfs */
81 - label = "rd.gz";
82 - reg = <0x00390000 0x00440000>; /* 4250KB */
83 - };
84 + mtd_gap: partition@c0000 { /* gap */
85 + label = "gap";
86 + reg = <0x000c0000 0x00040000>; /* 256KB */
87 + };
88
89 - partition@7d0000 { /* MAC address and serial number */
90 - label = "vendor";
91 - reg = <0x007d0000 0x00010000>; /* 64KB */
92 - };
93 + partition@100000 { /* u-boot-env */
94 + label = "u-boot-env";
95 + reg = <0x00100000 0x00010000>; /* 64KB */
96 + };
97
98 - partition@7e0000 {
99 - label = "RedBoot config";
100 - reg = <0x007e0000 0x00010000>; /* 64KB */
101 - };
102 + mtd_kernel: partition@110000 {
103 + label = "kernel";
104 + reg = <0x00110000 0x006c0000>; /* 6912KB */
105 + };
106
107 - partition@7f0000 {
108 - label = "FIS directory";
109 - reg = <0x007f0000 0x00010000>; /* 64KB */
110 + partition@7d0000 { /* MAC address and serial number */
111 + reg = <0x007d0000 0x00010000>; /* 64KB */
112 + label = "vendor";
113 + read-only;
114 +
115 + compatible = "nvmem-cells";
116 +
117 + nvmem-layout {
118 + compatible = "fixed-layout";
119 + #address-cells = <1>;
120 + #size-cells = <1>;
121 +
122 + macaddr_vendor_0: macaddr@0 {
123 + reg = <0x0 0x6>;
124 + };
125 + };
126 + };
127 +
128 + mtd_gap2: partition@7e0000 {
129 + label = "gap2";
130 + reg = <0x007e0000 0x00020000>; /* 128KB */
131 + };
132 };
133 };
134 };