8000 firehose: restrict XML <erase> to NAND to prevent whole-LUN wipes on … by marlgian · Pull Request #847 · bkerler/edl · GitHub
[go: up one dir, main page]

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion edlclient/Library/firehose.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,10 @@ def cmd_erase(self, physical_partition_number, start_sector, num_partition_secto
self.info(f"\nErasing from physical partition {str(physical_partition_number)}, " +
f"sector {str(start_sector)}, sectors {str(num_partition_sectors)}")

if "erase" in self.supported_functions:
# Only use XML <erase> for NAND, where block-level erase is required.
# Many Qualcomm eMMC/UFS Firehose loaders ignore start_sector and
# num_partition_sectors in <erase> and wipe the entire physical partition (LUN).
if self.cfg.MemoryName.lower() == "nand" and "erase" in self.supported_functions:
data = f"<?xml version=\"1.0\" ?><data>\n" + \
f"<erase SECTOR_SIZE_IN_BYTES=\"{self.cfg.SECTOR_SIZE_IN_BYTES}\"" + \
f" num_partition_sectors=\"{num_partition_sectors}\"" + \
Expand Down
0