2e4377ec0265067775d12a4db16917cee934edc8
[openwrt/staging/hauke.git] / target / linux / gemini / patches-4.19 / 0007-ARM-dts-Fix-up-the-D-Link-DIR-685-MTD-partition-info.patch
1 From 0f6c4817471faf572b5273cdf90160790b0c3b29 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Thu, 17 May 2018 17:00:10 +0200
4 Subject: [PATCH 07/18] ARM: dts: Fix up the D-Link DIR-685 MTD partition info
5
6 The vendor firmware was analyzed to get the right idea about
7 this flash layout. /proc/mtd contains:
8
9 dev: size erasesize name
10 mtd0: 01e7ff40 00020000 "rootfs"
11 mtd1: 01f40000 00020000 "upgrade"
12 mtd2: 00040000 00020000 "rgdb"
13 mtd3: 00020000 00020000 "nvram"
14 mtd4: 00040000 00020000 "RedBoot"
15 mtd5: 00020000 00020000 "LangPack"
16 mtd6: 02000000 00020000 "flash"
17
18 Here "flash" is obviously the whole device and we know "rootfs"
19 is a bogus hack to point to a squashfs rootfs inside of the main
20 "upgrade partition". We know "RedBoot" is the first 0x40000 of
21 the flash and the "upgrade" partition follows from 0x40000 to
22 0x1f8000. So we have mtd0, 1, 4 and 6 covered.
23
24 Remains:
25 mtd2: 00040000 00020000 "rgdb"
26 mtd3: 00020000 00020000 "nvram"
27 mtd5: 00020000 00020000 "LangPack"
28
29 Inspecting the flash at 0x1f8000 and 0x1fa000 reveals each of
30 these starting with "RGCFG1" so we assume 0x1f8000-1fbfff is
31 "rgdb" of 0x40000.
32
33 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
34 ---
35 arch/arm/boot/dts/gemini-dlink-dir-685.dts | 16 ++++++----------
36 1 file changed, 6 insertions(+), 10 deletions(-)
37
38 diff --git a/arch/arm/boot/dts/gemini-dlink-dir-685.dts b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
39 index 6f258b50eb44..502a361d1fe9 100644
40 --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts
41 +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
42 @@ -274,20 +274,16 @@
43 read-only;
44 };
45 /*
46 - * Between the boot loader and the rootfs is the kernel
47 - * in a custom Storlink format flashed from the boot
48 - * menu. The rootfs is in squashfs format.
49 + * This firmware image contains the kernel catenated
50 + * with the squashfs root filesystem. For some reason
51 + * this is called "upgrade" on the vendor system.
52 */
53 - partition@1800c0 {
54 - label = "rootfs";
55 - reg = <0x001800c0 0x01dbff40>;
56 - read-only;
57 - };
58 - partition@1f40000 {
59 + partition@40000 {
60 label = "upgrade";
61 - reg = <0x01f40000 0x00040000>;
62 + reg = <0x00040000 0x01f40000>;
63 read-only;
64 };
65 + /* RGDB, Residental Gateway Database? */
66 partition@1f80000 {
67 label = "rgdb";
68 reg = <0x01f80000 0x00040000>;
69 --
70 2.19.2
71