From: Chuanhong Guo Date: Sun, 13 Nov 2022 13:29:26 +0000 (+0800) Subject: rockchip: use LZMA FIT for kernel image X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c984fc762412f206ebeb3e873742988ff760fb90;p=openwrt%2Fstaging%2Fxback.git rockchip: use LZMA FIT for kernel image Use LZMA compressed kernel to save some space in boot partition. Fixes: #11197 Tested-by: Tianling Shen [NanoPi R2S] Signed-off-by: Chuanhong Guo --- diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index e4db1e5d58..e232166e51 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -16,7 +16,6 @@ define Build/boot-common rm -fR $@.boot mkdir -p $@.boot - $(CP) $(DTS_DIR)/$(DEVICE_DTS).dtb $@.boot/rockchip.dtb $(CP) $(IMAGE_KERNEL) $@.boot/kernel.img endef @@ -48,7 +47,7 @@ endef ### Devices ### define Device/Default PROFILES := Default - KERNEL := kernel-bin + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb IMAGES := sysupgrade.img.gz DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) endef diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 6cc31f1d8c..f95416323d 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -2,6 +2,9 @@ # # Copyright (C) 2020 Tobias Maedel +# FIT will be loaded at 0x02080000. Leave 16M for that, align it to 2M and load the kernel after it. +KERNEL_LOADADDR := 0x03200000 + define Device/friendlyarm_nanopi-r2s DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2S diff --git a/target/linux/rockchip/image/mmc.bootscript b/target/linux/rockchip/image/mmc.bootscript index b70a62c4c7..9269fda9cf 100644 --- a/target/linux/rockchip/image/mmc.bootscript +++ b/target/linux/rockchip/image/mmc.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 console=tty1 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r} diff --git a/target/linux/rockchip/image/nanopi-r2s.bootscript b/target/linux/rockchip/image/nanopi-r2s.bootscript index 5198881a26..8f961d3732 100644 --- a/target/linux/rockchip/image/nanopi-r2s.bootscript +++ b/target/linux/rockchip/image/nanopi-r2s.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff130000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r} diff --git a/target/linux/rockchip/image/nanopi-r4s.bootscript b/target/linux/rockchip/image/nanopi-r4s.bootscript index abe9c24ee3..1e53200027 100644 --- a/target/linux/rockchip/image/nanopi-r4s.bootscript +++ b/target/linux/rockchip/image/nanopi-r4s.bootscript @@ -2,7 +2,6 @@ part uuid mmc ${devnum}:2 uuid setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb load mmc ${devnum}:1 ${kernel_addr_r} kernel.img -booti ${kernel_addr_r} - ${fdt_addr_r} +bootm ${kernel_addr_r}