diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2020-04-27 23:20:35 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-04-29 05:24:20 +0300 |
commit | f1954f0f92a4d70fb322586199f593b7d07ec95b (patch) | |
tree | 4323a00dc80263ecd7431c50ea558df56f7f546d /meta-phosphor/classes | |
parent | 5422b0afcb212b926ef7bf9750e80eae277d3e37 (diff) | |
download | openbmc-f1954f0f92a4d70fb322586199f593b7d07ec95b.tar.xz |
image_types_phosphor: Create a image-u-boot file with spl
If a u-boot spl file is built, generate a image-u-boot file
with it so that code update can flash the u-boot mtd with
the spl.
(From meta-phosphor rev: 8fe768d9c696730eb67d48c243cbab9b228b8334)
Change-Id: I8ead2155593945602c925b26e85d2b6effc206f9
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor/classes')
-rw-r--r-- | meta-phosphor/classes/image_types_phosphor.bbclass | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass index 0259cf634..0d2ed898c 100644 --- a/meta-phosphor/classes/image_types_phosphor.bbclass +++ b/meta-phosphor/classes/image_types_phosphor.bbclass @@ -315,6 +315,22 @@ do_mk_static_nor_image() { mk_empty_image ${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd ${FLASH_SIZE} } +do_generate_image_uboot_file() { + image_dst="$1" + uboot_offset=${FLASH_UBOOT_OFFSET} + + if [ ! -z ${SPL_BINARY} ]; then + dd bs=1k conv=notrunc seek=${FLASH_UBOOT_OFFSET} \ + if=${DEPLOY_DIR_IMAGE}/u-boot-spl.${UBOOT_SUFFIX} \ + of=${image_dst} + uboot_offset=${FLASH_UBOOT_SPL_SIZE} + fi + + dd bs=1k conv=notrunc seek=${uboot_offset} \ + if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \ + of=${image_dst} +} + python do_generate_static() { import subprocess @@ -379,9 +395,9 @@ do_mk_static_symlinks() { ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.static.mtd # Maintain non-standard legacy links + do_generate_image_uboot_file ${IMGDEPLOYDIR}/image-u-boot ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/flash-${MACHINE} ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/image-bmc - ln -sf u-boot.${UBOOT_SUFFIX} ${IMGDEPLOYDIR}/image-u-boot ln -sf ${FLASH_KERNEL_IMAGE} ${IMGDEPLOYDIR}/image-kernel ln -sf ${IMAGE_LINK_NAME}.${IMAGE_BASETYPE} ${IMGDEPLOYDIR}/image-rofs ln -sf ${IMAGE_LINK_NAME}.${OVERLAY_BASETYPE} ${IMGDEPLOYDIR}/image-rwfs @@ -437,7 +453,7 @@ make_image_links() { # Create some links to help make the tar archive in the format # expected by phosphor-bmc-code-mgmt. - ln -sf ${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} image-u-boot + do_generate_image_uboot_file image-u-boot ln -sf ${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE} image-kernel ln -sf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$rofs image-rofs ln -sf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$rwfs image-rwfs |