From 2a5460b11b9718ed5f398fcc381edc89bce72695 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 29 Jun 2020 16:18:57 +0800 Subject: [PATCH] layerscape: define IMAGE_SIZE and LS_SYSUPGRADE_IMAGE_SIZE Define 64m IMAGE_SIZE for flash firmware.bin since the flash size is 64MB. Define 48m LS_SYSUPGRADE_IMAGE_SIZE for flash sysupgrade.bin which contains maximum 16MB kernel and 32MB rootfs according to memory map. Signed-off-by: Yangbo Lu --- target/linux/layerscape/image/Makefile | 3 +++ target/linux/layerscape/image/armv7.mk | 6 ++++-- target/linux/layerscape/image/armv8_64b.mk | 19 +++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index f5a5ad9980..8a38a25041 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -11,6 +11,9 @@ LS_SD_ROOTFSPART_OFFSET = 64 LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024))) +# The limitation of flash sysupgrade.bin is 16MB kernel + 32MB rootfs +LS_SYSUPGRADE_IMAGE_SIZE = 48m + define Build/ls-clean rm -f $@ endef diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 9bcf72f2cb..e06c99c338 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -13,8 +13,10 @@ define Device/Default KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ - append-rootfs | pad-rootfs | check-size 50331649 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1021atwr @@ -30,7 +32,7 @@ define Device/ls1021atwr ls-append $(1)-uboot-env.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1021a-twr endef TARGET_DEVICES += ls1021atwr diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 9512e0d8ad..ea17e02c52 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -12,8 +12,10 @@ define Device/Default KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ - append-rootfs | pad-rootfs | check-size 50331649 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1012afrdm @@ -33,9 +35,10 @@ define Device/ls1012afrdm ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size IMAGE/sysupgrade.bin := append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 50331648 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb SUPPORTED_DEVICES := fsl,ls1012a-frdm @@ -58,7 +61,7 @@ define Device/ls1012ardb ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1012a-rdb endef TARGET_DEVICES += ls1012ardb @@ -112,7 +115,7 @@ define Device/ls1043ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1043a-rdb endef TARGET_DEVICES += ls1043ardb @@ -164,7 +167,7 @@ define Device/ls1046ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1046a-rdb endef TARGET_DEVICES += ls1046ardb @@ -219,7 +222,7 @@ define Device/ls1088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1088a-rdb endef TARGET_DEVICES += ls1088ardb @@ -276,7 +279,7 @@ define Device/ls2088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls2088a-rdb endef TARGET_DEVICES += ls2088ardb -- 2.30.2