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