From 952a80baa55bf776d5c00b1394f7f94f0233d6cc Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Mon, 15 May 2023 17:55:32 +0200 Subject: [PATCH] feat(cn9130-cf-pro): add u-boot update functionality to swupdate --- .../coreos-image-swupdate-cn913x.bbclass | 18 ++++++++++++++++++ .../conf/machine/include/cn913x.inc | 1 + .../wic/cn913x-sdcard.wks.in | 5 ++--- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass diff --git a/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass b/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass new file mode 100644 index 0000000..45d224c --- /dev/null +++ b/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass @@ -0,0 +1,18 @@ + +SWUPDATE_IMAGES += "flash-image" +SWUPDATE_IMAGES_FSTYPES[flash-image] = ".bin" + +COREOS_SWUPDATE_EXTENDS_FOR:append = "cn913x" + +def coreos_swupdate_extends_images_for_cn913x(d,s): + boot0 = { + "filename" : "flash-image.bin", + "installed-directly" : "true", + "device" : "/dev/mmcblk1", + "type" : "raw", + "sha256" : swupdate_get_sha256(d, s, "flash-image.bin"), + } + + boot1 = boot0.copy() + + return [boot0, boot1] diff --git a/layers/meta-belden-marvell-bsp/conf/machine/include/cn913x.inc b/layers/meta-belden-marvell-bsp/conf/machine/include/cn913x.inc index bd5c8fd..d090783 100644 --- a/layers/meta-belden-marvell-bsp/conf/machine/include/cn913x.inc +++ b/layers/meta-belden-marvell-bsp/conf/machine/include/cn913x.inc @@ -54,6 +54,7 @@ WKS_FILE = "cn913x-sdcard.wks.in" IMAGE_FSTYPES += "wic.xz wic.bmap" MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules kernel-devicetree" +COREOS_IMAGE_SWUPDATE_EXTRACLASSES += " coreos-image-swupdate-cn913x" # No watchdog available yet EFIBOOTGUARD_TIMEOUT ?= "0" diff --git a/layers/meta-belden-marvell-bsp/wic/cn913x-sdcard.wks.in b/layers/meta-belden-marvell-bsp/wic/cn913x-sdcard.wks.in index 1b0d095..4edcac4 100644 --- a/layers/meta-belden-marvell-bsp/wic/cn913x-sdcard.wks.in +++ b/layers/meta-belden-marvell-bsp/wic/cn913x-sdcard.wks.in @@ -8,9 +8,8 @@ # Current bootloader is about 1.8MB, so if we put it at 4096S and 12288S we # have 4MiB between the first bootloader and the second copy of it -# tfa = TrustedFirmware-A -part --offset 4096S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 -part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 +part --offset 4096S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw0 +part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw1 ${WKS_PART_EFI} --ondisk mmcblk1 --offset 20480S --size 64M --extra-space 0 --overhead-factor 1 ${WKS_PART_ROOT_A} --ondisk mmcblk1 --size 2G --extra-space 0 --overhead-factor 1