Skip to content

Add Qualcomm IQ9075 recovery support and improve sparse image handling - #94

Merged
rgantois merged 2 commits into
bootlin:mainfrom
BakyarajM:qcom-iq9075-upstream
Aug 17, 2026
Merged

Add Qualcomm IQ9075 recovery support and improve sparse image handling#94
rgantois merged 2 commits into
bootlin:mainfrom
BakyarajM:qcom-iq9075-upstream

Conversation

@BakyarajM

Copy link
Copy Markdown
Contributor

snagrecover: qcom: Add IQ9075 support

Add support for Qualcomm IQ9075 devices in snagrecover.

Implement Qualcomm Sahara protocol support to communicate with
Qualcomm devices in EDL mode and perform device recovery.

Reference:
https://github.com/torvalds/linux/blob/master/drivers/accel

_Note:
The U-Boot changes required to support snagrecover are currently
under review. Therefore, the U-Boot image preparation section in
docs/snagrecover.md is marked as TBD.

The documentation will be updated and the TBD item resolved before
the final upstream submission._

snagflash: Improve sparse file handling

Handle sparse chunks larger than max-download-size and preserve
DONT_CARE prefix and suffix regions when splitting sparse images.

Ignore CRC32 chunks from the source sparse image during splitting,
as the original CRC32 is no longer valid once the image is split or
modified.

Fix fastboot flash argument parsing for UFS flash type by splitting
only on the first ':' character, preserving target identifiers in
the format : while maintaining compatibility with
other flash types.

Replace the existing split() implementation with the streaming-based
split_streaming() generator to enable more memory-efficient
processing of large sparse images.

_Future enhancements:

  • Generate and append a new CRC32 chunk for each split sparse image
    based on its modified content.
  • Convert raw images to sparse format and flash them as multiple
    sparse images when the image size exceeds the target's
    max-download-size limit._

Reference:
https://android.googlesource.com/platform/system/core/+/refs/heads/main/libsparse/

Signed-off-by: Bakyaraj Moorthy bmoorthy@qti.qualcomm.com

@rgantois rgantois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi, thanks a lot for the contribution! I've requested a few modifications. For the changes in snagflash/android_sparse_file/utils.py, I'll do a more in depth review once you've implemented the formatting changes I've requested. For all other files, no further review should be required once the current requested changes are implemented.

Comment thread docs/snagrecover.md Outdated
Comment thread docs/snagrecover.md
Comment thread docs/snagrecover.md Outdated
Comment thread docs/snagrecover.md
Comment thread docs/snagrecover.md Outdated
Comment thread src/snagrecover/protocols/fastboot.py Outdated
Comment thread src/snagrecover/protocols/fastboot.py Outdated
Comment thread src/snagflash/android_sparse_file/utils.py
Comment thread src/snagflash/android_sparse_file/utils.py Outdated
Comment thread src/snagflash/android_sparse_file/utils.py
Add support for Qualcomm IQ9075 in snagrecover.

Implement Qualcomm Sahara protocol support to communicate with
Qualcomm devices in EDL mode and perform device recovery.

Reference:
https://github.com/torvalds/linux/blob/master/drivers/accel/qaic/sahara.c

Signed-off-by: Bakyaraj Moorthy <bmoorthy@qti.qualcomm.com>
Handle sparse chunks larger than max-download-size and preserve
DONT_CARE prefix and suffix regions when splitting sparse images.

Ignore CRC32 chunks from the source sparse image during splitting,
as the original CRC32 is no longer valid once the image is split or
modified.

Fix fastboot flash argument parsing for UFS flash type by splitting
only on the first ':' character, preserving target identifiers in
the format <lun>:<partition> while maintaining compatibility with
other flash types.

Replace the existing split() implementation with the streaming-based
split_streaming() generator to enable more memory-efficient
processing of large sparse images.

Future enhancements:
- Generate and append a new CRC32 chunk for each split sparse image
  based on its modified content.
- Convert raw images to sparse format and flash them as multiple
  sparse images when the image size exceeds the target's
  max-download-size limit.

Reference:
https://android.googlesource.com/platform/system/core/+/refs/heads/main/libsparse/

Signed-off-by: Bakyaraj Moorthy <bmoorthy@qti.qualcomm.com>
@BakyarajM
BakyarajM force-pushed the qcom-iq9075-upstream branch from 35aa3e4 to 407669e Compare August 9, 2026 11:11
@BakyarajM

Copy link
Copy Markdown
Contributor Author

Hi, thanks a lot for the contribution! I've requested a few modifications. For the changes in snagflash/android_sparse_file/utils.py, I'll do a more in depth review once you've implemented the formatting changes I've requested. For all other files, no further review should be required once the current requested changes are implemented.

@BakyarajM BakyarajM closed this Aug 9, 2026
@BakyarajM BakyarajM reopened this Aug 9, 2026
@BakyarajM

Copy link
Copy Markdown
Contributor Author

Hi, thanks for the detailed review!
I've replied individually to each review comment thread with more details. All addressed changes for the comments are now pushed — please take another look.

@BakyarajM
BakyarajM requested a review from rgantois August 9, 2026 11:52
@rgantois

Copy link
Copy Markdown
Collaborator

Looks good to me! Thanks a lot!

@rgantois
rgantois merged commit bd98008 into bootlin:main Aug 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants