aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/image
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2021-06-10 17:17:23 +0200
committerPaul Spooren <mail@aparcar.org>2021-12-13 19:36:10 +0100
commit794e8123ce625d04f8207ba5fd3b153051b2e67e (patch)
tree7d668a85bdf96f7bf1079488c19f913f3effc338 /target/linux/ramips/image
parent3bcf3e8143160e447c22c0ac3fa66fbcf6a59eef (diff)
downloadupstream-794e8123ce625d04f8207ba5fd3b153051b2e67e.tar.gz
upstream-794e8123ce625d04f8207ba5fd3b153051b2e67e.tar.bz2
upstream-794e8123ce625d04f8207ba5fd3b153051b2e67e.zip
ramips: mt7620: use OKLI loader with Jboot devices
Jboot devices have problem with >2MB kernelsize. The only way to avoid this problem is use small loader. This patch switch all mt7620 Jboot devices to lzma OKLI loader. Suggested-by: Szabolcs Hubai <szab.hu@gmail.com> Co-authored-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Diffstat (limited to 'target/linux/ramips/image')
-rw-r--r--target/linux/ramips/image/Makefile10
-rw-r--r--target/linux/ramips/image/mt7620.mk16
2 files changed, 21 insertions, 5 deletions
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index d523a62e0b..ac256cf1ae 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -89,6 +89,16 @@ define Build/mkdlinkfw-factory
mv $@.new $@
endef
+define Build/mkdlinkfw-loader
+ -$(STAGING_DIR_HOST)/bin/mkdlinkfw \
+ -k $(KDIR)/loader-$(DEVICE_NAME).bin \
+ -r $@ \
+ -o $@.new \
+ $(if $(DLINK_IMAGE_OFFSET), -O $(DLINK_IMAGE_OFFSET)) \
+ -s $(DLINK_FIRMWARE_SIZE)
+ mv $@.new $@
+endef
+
define Build/netis-tail
echo -n $(1) >> $@
echo -n $(UIMAGE_NAME)-yun | $(MKHASH) md5 | \
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 17a536e69f..fbf37144b9 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -61,13 +61,18 @@ TARGET_DEVICES += alfa-network_tube-e4g
define Device/amit_jboot
DLINK_IMAGE_OFFSET := 0x10000
- KERNEL := $(KERNEL_DTB)
- KERNEL_SIZE := 2048k
+ KERNEL := $(KERNEL_DTB) | uImage lzma -M 0x4f4b4c49
+ LOADER_FLASH_OFFS := 0x20000
+ LOADER_TYPE := bin
+ COMPILE := loader-$(1).bin
+ COMPILE/loader-$(1).bin := loader-okli-compile | pad-to 64k | lzma | \
+ pad-to 65480
IMAGES += factory.bin
- IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
- IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
+ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | mkdlinkfw-loader | \
+ pad-rootfs | append-metadata
+ IMAGE/factory.bin := append-kernel | append-rootfs | mkdlinkfw-loader | \
+ pad-rootfs | mkdlinkfw-factory
DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci
- DEFAULT := n
endef
define Device/asus_rp-n53
@@ -194,6 +199,7 @@ define Device/dlink_dir-510l
$(Device/amit_jboot)
SOC := mt7620a
IMAGE_SIZE := 14208k
+ LOADER_FLASH_OFFS := 0x220000
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DIR-510L
DEVICE_PACKAGES += kmod-mt76x0e