Skip to content
Snippets Groups Projects
Commit 4b3bb0cd authored by Mikhail Kshevetskiy's avatar Mikhail Kshevetskiy
Browse files

airoha: add atf-2.10 blobs to emmc production image

parent 5da02848
No related branches found
No related tags found
1 merge request!1411atf-2.10 building
...@@ -293,6 +293,15 @@ define Build/append_emmc_production_image ...@@ -293,6 +293,15 @@ define Build/append_emmc_production_image
$(call Build/pad-to,1K) $(call Build/pad-to,1K)
mv $@ $@.sysupgrade.itb mv $@ $@.sysupgrade.itb
mv $@.bak $@ mv $@.bak $@
# generate fit image with atf blobs to put inside production image (must fit in 2M)
touch $@.its
mv $@.its $@.its.bak
$(Build/prepare-atf-blobs)
echo '/dts-v1/;' > $@.its
$(call airoha-aarch64-atf-blobs-its, description = "ATF-2.10 BL31/BL32 images";)
mv $@.its $@.boot1.its
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -E -B 0x1000 -r -f $@.boot1.its $@.boot1.fit
mv $@.its.bak $@.its
# create GPT image with env1, env2, sysupgrade partitions # create GPT image with env1, env2, sysupgrade partitions
# * GPT image size will be calculated automatically (-d 0) # * GPT image size will be calculated automatically (-d 0)
# * put Primary GPT entry table at 512K offset (-e 512K) # * put Primary GPT entry table at 512K offset (-e 512K)
...@@ -301,7 +310,7 @@ define Build/append_emmc_production_image ...@@ -301,7 +310,7 @@ define Build/append_emmc_production_image
# * env2 partition will start at 2560K offset (just after env1) # * env2 partition will start at 2560K offset (just after env1)
# * sysupgrade partition will start at 3M offset (just after env2). # * sysupgrade partition will start at 3M offset (just after env2).
# ptgen uses sizes in KB, so divide sysupgrade image size to 1024 # ptgen uses sizes in KB, so divide sysupgrade image size to 1024
ptgen -o $@.img -g -d 0 -e 512K -a 100 -N env1 -p 512K@2M -N env2 -p 512K -N sysupgrade -p "$$(( $$(stat --format=%s $@.sysupgrade.itb) / 1024 ))K" ptgen -o $@.img -g -d 0 -e 512K -a 100 -N env1 -p 512K@2M -N env2 -p 512K -N boot1 -p 2M -N sysupgrade -p "$$(( $$(stat --format=%s $@.sysupgrade.itb) / 1024 ))K"
# write bootloader with 2K offset to GPT image (after PMBR and PGPT header, but before Primary GPT entry table) # write bootloader with 2K offset to GPT image (after PMBR and PGPT header, but before Primary GPT entry table)
dd bs=2K seek=1 conv=notrunc of=$@.img if=$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-emmc.fip dd bs=2K seek=1 conv=notrunc of=$@.img if=$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-emmc.fip
# generate 1-st environment (-s 0) # generate 1-st environment (-s 0)
...@@ -324,8 +333,10 @@ define Build/append_emmc_production_image ...@@ -324,8 +333,10 @@ define Build/append_emmc_production_image
-O "mmc dev 0 && part size mmc 0 sysupgrade __size && read mmc "0#sysupgrade" \$${loadaddr} 0 \$${__size} && env delete __size && source \$${loadaddr}:u-boot-script && run __script_emmc_write_production && env set once true && env save" -O "mmc dev 0 && part size mmc 0 sysupgrade __size && read mmc "0#sysupgrade" \$${loadaddr} 0 \$${__size} && env delete __size && source \$${loadaddr}:u-boot-script && run __script_emmc_write_production && env set once true && env save"
# write 2-nd environment with 2560K offset (env2 partition) to GPT image # write 2-nd environment with 2560K offset (env2 partition) to GPT image
dd bs=2560K seek=1 conv=notrunc of=$@.img if=$@.env2 dd bs=2560K seek=1 conv=notrunc of=$@.img if=$@.env2
# write sysupgrade image with 3M offset (sysupgrade partition) to GPT image # write atf blob image with 3M offset (boot1 partition) to GPT image
dd bs=3M seek=1 conv=notrunc of=$@.img if=$@.sysupgrade.itb dd bs=3M seek=1 conv=notrunc of=$@.img if=$@.boot1.fit
# write sysupgrade image with 5M offset (sysupgrade partition) to GPT image
dd bs=5M seek=1 conv=notrunc of=$@.img if=$@.sysupgrade.itb
# add GPT image to the current target file # add GPT image to the current target file
cat $@.img >> $@ cat $@.img >> $@
# remove temporary files # remove temporary files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment