Skip to content

Accept NAND-style erase tags without physical_partition_number - #305

Open
igoropaniuk wants to merge 2 commits into
linux-msm:masterfrom
igoropaniuk:fix/erase-default-partition
Open

Accept NAND-style erase tags without physical_partition_number#305
igoropaniuk wants to merge 2 commits into
linux-msm:masterfrom
igoropaniuk:fix/erase-default-partition

Conversation

@igoropaniuk

@igoropaniuk igoropaniuk commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

A user flashing a Telit FE910C04 (SDX35, NAND) reported that qdl rejects
the vendor-shipped rawprogram files with "errors while parsing erase
tag". The autogenerated NAND bundles omit physical_partition_number
from tags - NAND exposes a single physical partition - but
load_erase_tag() treated the attribute as required. The reference
fh_loader treats it as optional and defaults it to 0, so qdl was
stricter than the format it implements.

  • program: treat physical_partition_number as optional in erase tags,
    defaulting to 0 to match the reference implementation. Covered by two
    new cmocka cases in test_program_load_xml (attribute omitted ->
    partition 0; attribute present -> honored).

  • qdl: recognize erase-only XML files as program files. Found while
    verifying the above: the file type detector classified
    documents by their program/read/ufs children only, so a rawprogram
    containing nothing but erase tags - as generated for NAND wipe
    flows - failed with "failed to detect file type" even though the
    parser fully supports erase tags. The flashmap loader already
    accepts erase children; do the same here.

Verified against the reported Telit rawprogram: parsing now succeeds
and qdl proceeds to device discovery.

NAND-generated rawprogram files, such as the ones shipped with Telit
SDX35 modules, omit physical_partition_number from erase tags since
NAND exposes a single physical partition. load_erase_tag() treated
the attribute as required and rejected such files with "errors while
parsing erase tag", making qdl unable to consume otherwise valid
autogenerated NAND bundles. The reference fh_loader treats the
attribute as optional and defaults it to 0; do the same.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The file type detector classified a <data> document by looking for
program, read and ufs children, so a rawprogram file containing only
erase tags - as generated for NAND wipe flows - failed with a
confusing "failed to detect file type" error even though the program
parser fully supports erase tags. Accept erase children as program
files, matching the flashmap loader which already does so.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
@igoropaniuk
igoropaniuk requested a review from a team as a code owner August 14, 2026 14:52
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.

1 participant