Skip to content
37 changes: 36 additions & 1 deletion classes-recipe/image_types_qcom.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ QCOM_DTB_FILE ?= "dtb.bin"

QCOM_BOOT_FILES_SUBDIR ?= ""
QCOM_PARTITION_FILES_SUBDIR ??= "${QCOM_BOOT_FILES_SUBDIR}"
QCOM_PARTITION_FILES_SUBDIR_SPINOR ??= ""

QCOM_PARTITION_CONF ?= "qcom-partition-conf"

Expand Down Expand Up @@ -87,7 +88,9 @@ create_qcomflash_pkg() {
install -m 0644 ${rawpg} .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meanwhile, copy the programer outside
of spinor folder to be part of NVME flat build.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVME flat build include partition bins, hlos images efi.bin, rootfs.img and programmer to support build flash.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not an answer for the question. Please add a comment that you are reusing SPI-NOR programmer for NVMe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe it's too platform specific. Should it be done in bootbins?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not addressed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of qcom flashable images deployment, should be implemented in create_qcomflash_pkg().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't understand your response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with below (in create_qcomflash_pkg):
if [ -e "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/xbl_s_devprg_ns.melf" ]; then
install -m 0644 "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/xbl_s_devprg_ns.melf" .
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is still machine-specific. Move that part to the IQ-X7181 boot binaries recipe.

done

if [ -n "${QCOM_CDT_FILE}" ]; then
# check CDT file existence and install as per need, for iq-x7181, CDT file will be part of spinor build, which will
# be placed under spinor subfolder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this comment more generic saying this is due spinor, we will have other spinor devices later.

if [ -n "${QCOM_CDT_FILE}" ] && [ -e "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/${QCOM_CDT_FILE}.bin" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why are you copying the CDT to the main folder since it is only really used by spinor?

It should just copy the CDT (provided by the build) to the right destination folder, which could be the main folder itself (e.g. ufs) and inside spinor in your case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added condition here is to avoid copy on Hamoa as CDT file not present in this folder, it will report error without this.
"-e ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/${QCOM_CDT_FILE}.bin"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QCOM_BOOT_IMG_SUBDIR should contain spinor, as raised before, then this would have to be changed if you want avoid copying, or just install CDT to the parent folder (as done by other machines) and then copy it here to the right destination folder, which is under spinor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The create_qcomflash_pkg function only support one flat build currently, I updated PR using QCOM_BOOT_IMG_SUBDIR (contain spinor) to take care spinor flashable pkg in subfolder, and QCOM_BOOT_FILES_SUDBDIR pointing to the parent folder to take care of nvme flashable images.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be handled in a generic code instead of creating extra copies. We know that CDT is either in the root folder or in the spinor/ subfolder.

install -m 0644 ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/${QCOM_CDT_FILE}.bin cdt.bin
fi

Expand Down Expand Up @@ -126,12 +129,44 @@ create_qcomflash_pkg() {
install -m 0644 "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/${xbl_config}" xbl_config.elf
fi

# programmer
if [ -e "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/xbl_s_devprg_ns.melf" ]; then
install -m 0644 "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/xbl_s_devprg_ns.melf" .
fi

# sail nor firmware
if [ -d "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/sail_nor" ]; then
install -d sail_nor
find "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/sail_nor" -maxdepth 1 -type f -exec install -m 0644 {} sail_nor \;
fi

# spinor firmware, partition bins, CDT etc.
if [ -d "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/spinor" ]; then
install -d spinor
find "${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/spinor" -maxdepth 1 -type f -exec install -m 0644 {} spinor \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You copied over the xml files before, and then you replace them later, you should probably not copy them over in the first place.


# partition bins for spinor
for pbin in `find ${DEPLOY_DIR_IMAGE}/${QCOM_PARTITION_FILES_SUBDIR_SPINOR} -maxdepth 1 -type f -name 'gpt_main*.bin' \
-o -name 'gpt_backup*.bin' -o -name 'patch*.xml'`; do
install -m 0644 ${pbin} spinor
done

# skip BLANK_GPT and WIPE_PARTITIONS for rawprogram xml files
for rawpg in `find ${DEPLOY_DIR_IMAGE}/${QCOM_PARTITION_FILES_SUBDIR_SPINOR} -maxdepth 1 -type f -name 'rawprogram*.xml' \
! -name 'rawprogram*_BLANK_GPT.xml' ! -name 'rawprogram*_WIPE_PARTITIONS.xml'`; do
install -m 0644 ${rawpg} spinor
done

for zeros in `find ${DEPLOY_DIR_IMAGE}/${QCOM_PARTITION_FILES_SUBDIR_SPINOR} -maxdepth 1 -type f -name 'zeros_*.bin'`; do
install -m 0644 ${zeros} spinor
done

# rename CDT file to match the filename in partition conf
if [ -n "${QCOM_CDT_FILE}" ]; then
install -m 0644 ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/spinor/${QCOM_CDT_FILE}.bin spinor/cdt.bin
fi
fi

# Create symlink to ${QCOMFLASH_DIR} dir
ln -rsf ${QCOMFLASH_DIR} ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.qcomflash

Expand Down