[OpenWrt-Devel] [PATCH RFT] ramips: mt7621: use lzma-loader for all devices

mail at adrianschmutzler.de mail at adrianschmutzler.de
Tue Apr 14 05:27:16 EDT 2020


Hi,

be aware that LZMA_TEXT_START=0x82000000, so this won't work on any 32 MB RAM devices if I calculated right.

This of course won't be a problem for mt7621, but if the same strategy is applied to other subtargets, LZMA_TEXT_START might be lowered then.
So, maybe it would make sense to lower that right away before testing if that applies. (One obviously could also have subtarget-dependent values for that or just disable all 32 MB devices as well...) On ath79, for example, this value was chosen differently to work on 32 MB RAM devices as well.

Best

Adrian

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Chuanhong Guo
> Sent: Dienstag, 14. April 2020 08:45
> To: openwrt-devel at lists.openwrt.org
> Cc: Chuanhong Guo <gch981213 at gmail.com>
> Subject: [OpenWrt-Devel] [PATCH RFT] ramips: mt7621: use lzma-loader for
> all devices
> 
> With current kernel reaching 5MB uncompressed, several devices failed to
> boot. They either fails on lzma decompression or ends up with a corrupted
> kernel image. We already faced this problem two years ago and it was solved
> by limiting LZMA dictionary size. Our own lzma-loader extracts data without
> this limit just fine and lifting this limit saves 15KB kernel space when
> compressed.
> mediatek u-boot 1.1.3 comes with support for uncompressed uimage by
> default and ideally no vendor bother to remove this support.
> This commit uses uncompressed uimage with lzma-loader for all mt7621
> devices with default kernel template.
> 
> Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
> ---
> 
> D-Link DIR-860L B1 needs a different loader implementation and isn't
> covered by this patch.
> Please help testing this patch on top of current master:
> 75f19deb3a ramips: define image recipe for uncompressed uimage with
> loader 1. If your device fails to boot after 5.4 switch for mt7621:
>      Is the problem fixed by this patch?
> 2. Other devices:
>      Does this patch break your router?
> 
> Thanks in advance!
> 
>  target/linux/ramips/image/Makefile  | 4 ++++
> target/linux/ramips/image/mt7621.mk | 1 -
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/ramips/image/Makefile
> b/target/linux/ramips/image/Makefile
> index a966ba4349..1fb37d7c6c 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -27,7 +27,11 @@ LOADER_PLATFORM := $(ldrplatform-y)  KERNEL_DTB =
> kernel-bin | append-dtb | lzma  define Device/Default
>    PROFILES = Default
> +ifeq ($(SUBTARGET),mt7621)
> +  $(Device/uimage-lzma-loader)
> +else
>    KERNEL := $(KERNEL_DTB) | uImage lzma
> +endif
>    SOC := $(DEFAULT_SOC)
>    DEVICE_DTS_DIR := ../dts
>    DEVICE_DTS = $$(SOC)_$(1)
> diff --git a/target/linux/ramips/image/mt7621.mk
> b/target/linux/ramips/image/mt7621.mk
> index 8980ff70d4..942308c29a 100644
> --- a/target/linux/ramips/image/mt7621.mk
> +++ b/target/linux/ramips/image/mt7621.mk
> @@ -6,7 +6,6 @@ include ./common-tp-link.mk
> 
>  DEFAULT_SOC := mt7621
> 
> -KERNEL_DTB += -d21
>  DEVICE_VARS += UIMAGE_MAGIC SERCOMM_HWNAME
> 
>  # The OEM webinterface expects an kernel with initramfs which has the
> uImage
> --
> 2.25.2
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200414/91667cda/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list