bkerler / edl

Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :)
GNU General Public License v3.0
1.47k stars 358 forks source link

write op9p doesn't work #423

Open 532910 opened 1 year ago

532910 commented 1 year ago

While read works fine:

% ./edl rf lun1.bin --memory=ufs --lun=1 
Keystone library is missing (optional).
Qualcomm Sahara / Firehose Client V3.61 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
main - Device detected :)
main - Mode detected: firehose
main - Trying to connect to firehose loader ...
firehose - Chip serial num: 1174444770 (0x46009ae2)
firehose - Supported Functions (15):
firehose - program
firehose - read
firehose - nop
firehose - patch
firehose - configure
firehose - setbootablestoragedrive
firehose - erase
firehose - power
firehose - firmwarewrite
firehose - getstorageinfo
firehose - benchmark
firehose - emmc
firehose - ufs
firehose - fixgpt
firehose - getsha256digest
firehose - End of supported functions 15
firehose
firehose - [LIB]: Couldn't detect MaxPayloadSizeFromTargetinBytes
firehose
firehose - [LIB]: Couldn't detect TargetName
firehose - TargetName=Unknown
firehose - MemoryName=UFS
firehose - Version=1
firehose - Trying to read first storage sector...
firehose - Running configure...
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - 0x1
firehose_client - Supported functions:
-----------------
program,read,nop,patch,configure,setbootablestoragedrive,erase,power,firmwarewrite,getstorageinfo,benchmark,emmc,ufs,fixgpt,getsha256digest
Dumping flash with sector count 2076 as lun1.bin.
firehose - 
Reading from physical partition 1, sector 0, sectors 2076
Progress: |██████████| 100.0% Read (Sector 0x81C of 0x81C, ) 209.28 MB/s                                                                                     

write does nothing:

% ./edl wf lun1.bin --memory=ufs --lun=1 
Keystone library is missing (optional).
Qualcomm Sahara / Firehose Client V3.61 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
main - Device detected :)
main - Mode detected: firehose
main - Trying to connect to firehose loader ...
firehose - Chip serial num: 1174444770 (0x46009ae2)
firehose - Supported Functions (15):
firehose - program
firehose - read
firehose - nop
firehose - patch
firehose - configure
firehose - setbootablestoragedrive
firehose - erase
firehose - power
firehose - firmwarewrite
firehose - getstorageinfo
firehose - benchmark
firehose - emmc
firehose - ufs
firehose - fixgpt
firehose - getsha256digest
firehose - End of supported functions 15
firehose
firehose - [LIB]: Couldn't detect MaxPayloadSizeFromTargetinBytes
firehose
firehose - [LIB]: Couldn't detect TargetName
firehose - TargetName=Unknown
firehose - MemoryName=UFS
firehose - Version=1
firehose - Trying to read first storage sector...
firehose - Running configure...
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - 0x1
firehose_client - Supported functions:
-----------------
program,read,nop,patch,configure,setbootablestoragedrive,erase,power,firmwarewrite,getstorageinfo,benchmark,emmc,ufs,fixgpt,getsha256digest
firehose - 
Writing to physical partition 1, sector 0, sectors 2076
Done |----------|   0.0% Write (Sector 0x0 of 0x81C) 0.00 MB/s                                                                                               Wrote lun1.bin to sector 0.
532910 commented 1 year ago

wl breaks the same way:

% ./edl wl dumps --memory=ufs --lun=1
Keystone library is missing (optional).
Qualcomm Sahara / Firehose Client V3.61 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
main - Device detected :)
main - Mode detected: firehose
main - Trying to connect to firehose loader ...
firehose - Chip serial num: 1174444770 (0x46009ae2)
firehose - Supported Functions (15):
firehose - program
firehose - read
firehose - nop
firehose - patch
firehose - configure
firehose - setbootablestoragedrive
firehose - erase
firehose - power
firehose - firmwarewrite
firehose - getstorageinfo
firehose - benchmark
firehose - emmc
firehose - ufs
firehose - fixgpt
firehose - getsha256digest
firehose - End of supported functions 15
firehose
firehose - [LIB]: Couldn't detect MaxPayloadSizeFromTargetinBytes
firehose
firehose - [LIB]: Couldn't detect TargetName
firehose - TargetName=Unknown
firehose - MemoryName=UFS
firehose - Version=1
firehose - Trying to read first storage sector...
firehose - Running configure...
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - {'ERROR': '[ffu]FWversion', 'UFS fInitialized': '0x1', 'UFS Current LUN Number: ': ' 0xd0', 'UFS Total Active LU': '0x6', 'UFS wManufacturerID': '0x1ad', 'UFS Boot Partition Enabled': '0x1', 'UFS Raw Device Capacity: ': ' 0x1dcbc000', 'UFS Min Block Size': '0x8', 'UFS Erase Block Size': '0x2000', 'UFS Allocation Unit Size': '0x1', 'UFS RPMB ReadWrite Size: ': ' 0x40', 'UFS Number of Allocation Uint for This LU': '0x0', 'UFS Logical Block Size': '0x0', 'UFS Provisioning Type': '0x0', 'UFS LU Write Protect': '0x0', 'UFS Boot LUN ID: ': ' 0x0', 'UFS Memory Type': '0x0', 'UFS LU Total Blocks': '0x0', 'UFS Supported Memory Types': '0x8079', 'UFS dEnhanced1MaxNAllocU': '0xee5e', 'UFS wEnhanced1CapAdjFac': '0x300', 'UFS dEnhanced2MaxNAllocU: ': ' 0xee5e', 'UFS wEnhanced2CapAdjFac': '0x300', 'UFS dEnhanced3MaxNAllocU': '0xee5e', 'UFS wEnhanced3CapAdjFac': '0x300', 'UFS dEnhanced4MaxNAllocU': '0x0', 'UFS wEnhanced4CapAdjFac': '0x0', 'UFS LUN Enable Bitmask': '0x3f', 'UFS Logical Block Count': '0x0', 'UFS bConfigDescrLock': '0x0', 'UFS iManufacturerName String Index': '0x1', 'UFS iProductName String Index': '0x2', 'UFS iSerialNumber String Index': '0x3', 'UFS iOemID String Index': '0x4', 'UFS_High_Priority_LUN': '0x0', 'UFS Inquiry Command Output': 'SKhynix HN8T15BZGKX016  A043 '}
firehose - 0x1
firehose_client - Supported functions:
-----------------
program,read,nop,patch,configure,setbootablestoragedrive,erase,power,firmwarewrite,getstorageinfo,benchmark,emmc,ufs,fixgpt,getsha256digest
Writing dumps/xbl_config_a.bin to partition xbl_config_a.
firehose - 
Writing to physical partition 1, sector 1542, sectors 128
Done |----------|   0.0% Write (Sector 0x0 of 0x80) 0.00 MB/s                                                                                                Writing dumps/xbl_a.bin to partition xbl_a.
firehose - 
Writing to physical partition 1, sector 6, sectors 1536
Done |----------|   0.0% Write (Sector 0x0 of 0x600) 0.00 MB/s                                                                                               Couldn't write partition. Either wrong memorytype given or no gpt partition.
532910 commented 11 months ago

@bkerler can I help somehow with this issue?

bkerler commented 9 months ago

can you capture the usb comm using wireshark and upload the pcap file ?

nilz3000 commented 9 months ago

Hey @bkerler, a pcap for "edl wf test.bin --memory=ufs --lun=1 --devicemodel=19815" with OP9p is attached. op9p-edl.tar.gz