diff options
author | Pawel Dembicki <paweldembicki@gmail.com> | 2020-08-19 12:13:26 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-10-26 00:40:12 +0100 |
commit | 3605eff88190af9cc2905ba750252c1643a1bc7d (patch) | |
tree | 478a38f0a5e5e459131fa6cd9e360731c1e8a878 /target/linux/layerscape/image | |
parent | 6180005debe3f2502e5c2e1839f05682338990b4 (diff) | |
download | upstream-3605eff88190af9cc2905ba750252c1643a1bc7d.tar.gz upstream-3605eff88190af9cc2905ba750252c1643a1bc7d.tar.bz2 upstream-3605eff88190af9cc2905ba750252c1643a1bc7d.zip |
layerscape: add dtb to sysupgrade
At this moment sysupgrade replaces only kernel and rootfs.
This patch add dtb part to sysupgrade images to avoid situation
when old dtb make system broken.
Is possible to sysupgrade older images for NOR devices:
1. Firmware partition in bootargs need to be updated to:
"49m@0xf00000(firmware)". Env should be saved after changes.
2. After step one, "sysupgrade -F" will work.
Run tested: LS1046A-RDB
Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[bump PKG_RELEASE for uboot-layerscape]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/layerscape/image')
-rw-r--r-- | target/linux/layerscape/image/Makefile | 11 | ||||
-rw-r--r-- | target/linux/layerscape/image/armv7.mk | 15 | ||||
-rw-r--r-- | target/linux/layerscape/image/armv8_64b.mk | 20 |
3 files changed, 36 insertions, 10 deletions
diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 8a38a25041..08864b1316 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -11,8 +11,8 @@ 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 +# The limitation of flash sysupgrade.bin is 1MB dtb + 16MB kernel + 32MB rootfs +LS_SYSUPGRADE_IMAGE_SIZE = 49m define Build/ls-clean rm -f $@ @@ -46,6 +46,13 @@ define Build/traverse-fit @mv -f $@.new $@ endef +define Device/fix-sysupgrade + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := DTB was added to sysupgrade. Image format is different. \ + To use sysupgrade You need to change firmware partition in bootargs to "49m@0xf00000(firmware)" and saveenv. \ + After that, You can use "sysupgrade -F". +endef + include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 8a86997399..23bd3e8d82 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -16,12 +16,14 @@ define Device/Default DEVICE_DTS = $(lastword $(subst _, ,$(1))) SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m - IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + IMAGE/sysupgrade.bin = ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \ + append-kernel | pad-to 17M | \ append-rootfs | pad-rootfs | \ check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/fsl_ls1021a-twr + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A DEVICE_VARIANT := Default @@ -54,7 +56,8 @@ define Device/fsl_ls1021a-twr-sdboot append-rootfs | check-size $(LS_SD_IMAGE_SIZE) IMAGE/sysupgrade.bin := \ ls-clean | \ - ls-append-sdhead $(1) | pad-to 16M | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef @@ -67,7 +70,7 @@ define Device/fsl_ls1021a-iot-sdboot DEVICE_DTS := ls1021a-iot FILESYSTEMS := ext4 SUPPORTED_DEVICES := - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -76,5 +79,11 @@ define Device/fsl_ls1021a-iot-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef TARGET_DEVICES += fsl_ls1021a-iot-sdboot diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 6ed3e7c155..35bab47124 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -15,7 +15,8 @@ define Device/Default DEVICE_DTS = freescale/$(subst _,-,$(1)) SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m - IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + IMAGE/sysupgrade.bin = ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \ + append-kernel | pad-to 17M | \ append-rootfs | pad-rootfs | \ check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef @@ -46,6 +47,7 @@ endef TARGET_DEVICES += fsl_ls1012a-frdm define Device/fsl_ls1012a-rdb + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1012A-RDB DEVICE_PACKAGES += \ @@ -89,13 +91,15 @@ define Device/fsl_ls1012a-frwy-sdboot append-rootfs | check-size $(LS_SD_IMAGE_SIZE) IMAGE/sysupgrade.bin := \ ls-clean | \ - ls-append-sdhead $(1) | pad-to 16M | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef TARGET_DEVICES += fsl_ls1012a-frwy-sdboot define Device/fsl_ls1043a-rdb + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB DEVICE_VARIANT := Default @@ -145,13 +149,15 @@ define Device/fsl_ls1043a-rdb-sdboot append-rootfs | check-size $(LS_SD_IMAGE_SIZE) IMAGE/sysupgrade.bin := \ ls-clean | \ - ls-append-sdhead $(1) | pad-to 16M | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef TARGET_DEVICES += fsl_ls1043a-rdb-sdboot define Device/fsl_ls1046a-rdb + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB DEVICE_VARIANT := Default @@ -201,13 +207,15 @@ define Device/fsl_ls1046a-rdb-sdboot append-rootfs | check-size $(LS_SD_IMAGE_SIZE) IMAGE/sysupgrade.bin := \ ls-clean | \ - ls-append-sdhead $(1) | pad-to 16M | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef TARGET_DEVICES += fsl_ls1046a-rdb-sdboot define Device/fsl_ls1088a-rdb + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB DEVICE_VARIANT := Default @@ -262,13 +270,15 @@ define Device/fsl_ls1088a-rdb-sdboot append-rootfs | check-size $(LS_SD_IMAGE_SIZE) IMAGE/sysupgrade.bin := \ ls-clean | \ - ls-append-sdhead $(1) | pad-to 16M | \ + ls-append-sdhead $(1) | pad-to 15M | \ + ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef TARGET_DEVICES += fsl_ls1088a-rdb-sdboot define Device/fsl_ls2088a-rdb + $(Device/fix-sysupgrade) DEVICE_VENDOR := NXP DEVICE_MODEL := LS2088ARDB DEVICE_PACKAGES += \ |