Hi! On Sun, Apr 19, 2020 at 8:38 AM Szabolcs Hubai <szab...@gmail.com> wrote: > > This device has trouble extracting big kernel from flash, > and supports LZMA compressed kernels only. > > Using OpenWrt kernel loader saves us 64 KB compared to the dictionary > size limiting workaround. > > Factory image sizes (commit: 5f126c541a74) with "CONFIG_ALL_KMODS=y": > - original ("-d23", default): 4784188 bytes, LZMA ERROR 1 > - with "-d19": 4915260, LZMA ERROR 1 > - with "-d18": 4915260, diff to original: +128 KB > - with "-d17": 4980796, diff to original: +192 KB > - with this patch: 4849724, diff to original: +64 KB > > To save some CPU cycle, use minimal compression ("-a0") for the LZMA > compressed uImage.
My original thought on this device is to use a different loader. The first 4MB of SPI-NOR flash on mt7621 is mapped to 0x1fc00000 and lzma loader can read compressed kernel directly from flash. If the kernel can be put at a fixed offset in flash, we could compress lzma loader separately and let u-boot decompress only the loader. You could take a look at the tp-link-nolzma recipe in: target/linux/ath79/image/common-tp-link.mk and see if you could implement a similar solution for mt7621. Note: You need to fix AR71XX_FLASH_START defined in: target/linux/ramips/image/lzma-loader/src/loader.c to 0x1fc00000 for this method to work. If you can't implement it, I'm fine with your current solution too. but I prefer to drop patch 1/2 and write the complete kernel recipe for dir-860l only. It's a bit confusing to use "KERNEL +=" -- Regards, Chuanhong Guo _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel