[openwrt/openwrt] rockchip: use LZMA FIT for kernel image

LEDE Commits lede-commits at lists.infradead.org
Mon Nov 14 07:10:26 PST 2022


981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c984fc762412f206ebeb3e873742988ff760fb90

commit c984fc762412f206ebeb3e873742988ff760fb90
Author: Chuanhong Guo <gch981213 at gmail.com>
AuthorDate: Sun Nov 13 21:29:26 2022 +0800

    rockchip: use LZMA FIT for kernel image
    
    Use LZMA compressed kernel to save some space in boot partition.
    
    Fixes: #11197
    Tested-by: Tianling Shen <cnsztl at immortalwrt.org> [NanoPi R2S]
    Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
---
 target/linux/rockchip/image/Makefile              | 3 +--
 target/linux/rockchip/image/armv8.mk              | 3 +++
 target/linux/rockchip/image/mmc.bootscript        | 3 +--
 target/linux/rockchip/image/nanopi-r2s.bootscript | 3 +--
 target/linux/rockchip/image/nanopi-r4s.bootscript | 3 +--
 5 files changed, 7 insertions(+), 8 deletions(-)

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}




More information about the lede-commits mailing list