You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/gemini/patches-4.19/0011-ARM-dts-Fix-up-SQ201-f...

27 lines
968 B
Diff

From 186692e51e6c40d8ebd05d25f009098eb00f8110 Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Fri, 19 Oct 2018 09:00:51 +0200
Subject: [PATCH 11/18] ARM: dts: Fix up SQ201 flash access
This sets the partition information on the SQ201 to be read
out from the RedBoot partition table, removes the static
partition table and sets our boot options to mount root from
/dev/mtdblock2 where the initramfs resides.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/boot/dts/gemini-sq201.dts | 37 ++++--------------------------
1 file changed, 5 insertions(+), 32 deletions(-)
--- a/arch/arm/boot/dts/gemini-sq201.dts
+++ b/arch/arm/boot/dts/gemini-sq201.dts
@@ -20,7 +20,7 @@
};
chosen {
- bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
gemini: Enable flash boot on reference design type The flash layout on the Storlink reference design for Gemini is using 2 MB flash for the kernel, and it also insists on overwriting the partition table with default values on every boot. The same is true for the SQ201. This poses a problem on recent OpenWrt firmware as the base zImage is bigger than 2 MB. At the same time there is a ramdisk partition of 6 MB that we don't really need. The partition table looks like this: Creating 7 MTD partitions on "30000000.flash": 0x000000000000-0x000000016000 : "BOOT" 0x000000120000-0x000000320000 : "Kern" 0x000000320000-0x000000920000 : "Ramdisk" 0x000000920000-0x000000f20000 : "Application" 0x000000f20000-0x000000f40000 : "VCTL" 0x000000f40000-0x000000fe0000 : "CurConf" 0x000000fe0000-0x000001000000 : "FIS directory" On boot the "Kern" partition is copied to RAM @0x01600000 and the "Ramdisk" partition is copied to RAM @0x00800000. Then the kernel is executed. The idea with this patch is to extend the "Kern" partition with the "Ramdisk" partition to get a full 8 MB to use for the kernel. Then we put the OpenWrt JFFS2 rootfs inside the "Application" partition. We create a small assembly loop that we prepend to the "Kern" image that will copy the "Kern" from 0x0160000 and the "Ramdisk" from 0x00800000 and put them in consecutive space at 0x00400000 and execute it from there, using "Application" as rootfs. We generate 3 main files: - zImage - contains the assembly bootstrap loop and the first part of the generated kernel image - rd.gz - contains the second part of the generated kernel image - hddapp.tgz - contains the root filesystem On the SQ201 I flash these manually using the native boot loader PLATO, "Y" alternative for the zImage, "R" for the rd.gz image and "A" for hddapp.tgz. This works fine and I can now boot to prompt on the SQ201 with nothing but flash. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
+ bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock3 rw rootfstype=squashfs,jffs2 rootwait";
stdout-path = &uart0;
};