f70ab262c7b004563c3091752179428c3bb3015b
[openwrt/staging/wigyori.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 --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts
39 +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
40 @@ -274,20 +274,16 @@
41 read-only;
42 };
43 /*
44 - * Between the boot loader and the rootfs is the kernel
45 - * in a custom Storlink format flashed from the boot
46 - * menu. The rootfs is in squashfs format.
47 + * This firmware image contains the kernel catenated
48 + * with the squashfs root filesystem. For some reason
49 + * this is called "upgrade" on the vendor system.
50 */
51 - partition@1800c0 {
52 - label = "rootfs";
53 - reg = <0x001800c0 0x01dbff40>;
54 - read-only;
55 - };
56 - partition@1f40000 {
57 + partition@40000 {
58 label = "upgrade";
59 - reg = <0x01f40000 0x00040000>;
60 + reg = <0x00040000 0x01f40000>;
61 read-only;
62 };
63 + /* RGDB, Residental Gateway Database? */
64 partition@1f80000 {
65 label = "rgdb";
66 reg = <0x01f80000 0x00040000>;