From 860d6ce0ce19b96506597bd7befadda86f15b489 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 17 Jul 2019 19:22:40 +0200 Subject: gemini: Fix up flash accesses The SL93512r and the NAS4220B have Redboot partition tables (rely on these) and need to boot from mtdblock3. Add two patches from upstream to fix this. Signed-off-by: Linus Walleij --- ...emini-Switch-to-redboot-partition-parsing.patch | 104 +++++++++++++++++++++ ...-ARM-dts-gemini-Mount-root-from-mtdblock3.patch | 36 +++++++ 2 files changed, 140 insertions(+) create mode 100644 target/linux/gemini/patches-4.19/0022-RM-dts-gemini-Switch-to-redboot-partition-parsing.patch create mode 100644 target/linux/gemini/patches-4.19/0023-ARM-dts-gemini-Mount-root-from-mtdblock3.patch (limited to 'target/linux/gemini') diff --git a/target/linux/gemini/patches-4.19/0022-RM-dts-gemini-Switch-to-redboot-partition-parsing.patch b/target/linux/gemini/patches-4.19/0022-RM-dts-gemini-Switch-to-redboot-partition-parsing.patch new file mode 100644 index 0000000000..12c899ea30 --- /dev/null +++ b/target/linux/gemini/patches-4.19/0022-RM-dts-gemini-Switch-to-redboot-partition-parsing.patch @@ -0,0 +1,104 @@ +From cad2161e64aca9e1c94fd11b0d0f7b53c9e80de0 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Fri, 12 Jul 2019 22:57:11 +0200 +Subject: [PATCH 1/2] ARM: dts: gemini: Switch to redboot partition parsing + +This switches the kernel to parse the Redboot partitions +in the SL93512r and the NAS4220B properly using the +right compatible string instead of using hard-coded +partitions. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/gemini-nas4220b.dts | 35 +++------------------------ + arch/arm/boot/dts/gemini-sl93512r.dts | 35 +++------------------------ + 2 files changed, 8 insertions(+), 62 deletions(-) + +--- a/arch/arm/boot/dts/gemini-nas4220b.dts ++++ b/arch/arm/boot/dts/gemini-nas4220b.dts +@@ -81,37 +81,10 @@ + /* 16MB of flash */ + reg = <0x30000000 0x01000000>; + +- partition@0 { +- label = "RedBoot"; +- reg = <0x00000000 0x00020000>; +- read-only; +- }; +- partition@20000 { +- label = "Kernel"; +- reg = <0x00020000 0x00300000>; +- }; +- partition@320000 { +- label = "Ramdisk"; +- reg = <0x00320000 0x00600000>; +- }; +- partition@920000 { +- label = "Application"; +- reg = <0x00920000 0x00600000>; +- }; +- partition@f20000 { +- label = "VCTL"; +- reg = <0x00f20000 0x00020000>; +- read-only; +- }; +- partition@f40000 { +- label = "CurConf"; +- reg = <0x00f40000 0x000a0000>; +- read-only; +- }; +- partition@fe0000 { +- label = "FIS directory"; +- reg = <0x00fe0000 0x00020000>; +- read-only; ++ partitions { ++ compatible = "redboot-fis"; ++ /* Eraseblock at 0xfe0000 */ ++ fis-index-block = <0x1fc>; + }; + }; + +--- a/arch/arm/boot/dts/gemini-sl93512r.dts ++++ b/arch/arm/boot/dts/gemini-sl93512r.dts +@@ -143,37 +143,10 @@ + /* 16MB of flash */ + reg = <0x30000000 0x01000000>; + +- partition@0 { +- label = "BOOT"; +- reg = <0x00000000 0x00020000>; +- read-only; +- }; +- partition@120000 { +- label = "Kern"; +- reg = <0x00020000 0x00300000>; +- }; +- partition@320000 { +- label = "Ramdisk"; +- reg = <0x00320000 0x00600000>; +- }; +- partition@920000 { +- label = "Application"; +- reg = <0x00920000 0x00600000>; +- }; +- partition@f20000 { +- label = "VCTL"; +- reg = <0x00f20000 0x00020000>; +- read-only; +- }; +- partition@f40000 { +- label = "CurConf"; +- reg = <0x00f40000 0x000a0000>; +- read-only; +- }; +- partition@fe0000 { +- label = "FIS directory"; +- reg = <0x00fe0000 0x00020000>; +- read-only; ++ partitions { ++ compatible = "redboot-fis"; ++ /* Eraseblock at 0xfe0000 */ ++ fis-index-block = <0x1fc>; + }; + }; + diff --git a/target/linux/gemini/patches-4.19/0023-ARM-dts-gemini-Mount-root-from-mtdblock3.patch b/target/linux/gemini/patches-4.19/0023-ARM-dts-gemini-Mount-root-from-mtdblock3.patch new file mode 100644 index 0000000000..2c2ddfaaf4 --- /dev/null +++ b/target/linux/gemini/patches-4.19/0023-ARM-dts-gemini-Mount-root-from-mtdblock3.patch @@ -0,0 +1,36 @@ +From b40cd2116ea0ba3584db12ab9dab7e02dd1e3333 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Fri, 12 Jul 2019 22:59:39 +0200 +Subject: [PATCH 2/2] ARM: dts: gemini: Mount root from mtdblock3 + +The third mtdblock device named "Application" is where we +want to mount our root filesystem. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/gemini-nas4220b.dts | 2 +- + arch/arm/boot/dts/gemini-sl93512r.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/gemini-nas4220b.dts ++++ b/arch/arm/boot/dts/gemini-nas4220b.dts +@@ -20,7 +20,7 @@ + }; + + chosen { +- bootargs = "console=ttyS0,19200n8"; ++ bootargs = "console=ttyS0,19200n8 root=/dev/mtdblock3 rw rootfstype=squashfs,jffs2 rootwait"; + stdout-path = &uart0; + }; + +--- a/arch/arm/boot/dts/gemini-sl93512r.dts ++++ b/arch/arm/boot/dts/gemini-sl93512r.dts +@@ -24,7 +24,7 @@ + }; + + chosen { +- bootargs = "console=ttyS0,19200n8 root=/dev/sda1 rw rootwait"; ++ bootargs = "console=ttyS0,19200n8 root=/dev/mtdblock3 rw rootfstype=squashfs,jffs2 rootwait"; + stdout-path = &uart0; + }; + -- cgit v1.2.3