-
Notifications
You must be signed in to change notification settings - Fork 110
For linux msm/spinor #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
For linux msm/spinor #146
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -437,10 +437,12 @@ static int firehose_erase(struct qdl_device *qdl, struct program *program) | |
| return ret == FIREHOSE_ACK ? 0 : -1; | ||
| } | ||
|
|
||
| static int firehose_program(struct qdl_device *qdl, struct program *program, int fd) | ||
| static int firehose_program(struct qdl_device *qdl, struct program *program, | ||
| int fd, enum qdl_storage_type storage) | ||
| { | ||
| unsigned int num_sectors; | ||
| unsigned int sector_size; | ||
| unsigned int zlp_timeout = 10000; | ||
| struct stat sb; | ||
| size_t chunk_size; | ||
| xmlNode *root; | ||
|
|
@@ -454,6 +456,13 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int | |
| int n; | ||
| uint32_t fill_value; | ||
|
|
||
| /* | ||
| * ZLP has been measured to take up to 15 seconds on SPINOR devices, | ||
| * let's double it to be on the safe side... | ||
| */ | ||
| if (storage == QDL_STORAGE_SPINOR) | ||
| zlp_timeout = 30000; | ||
|
|
||
| num_sectors = program->num_sectors; | ||
| sector_size = program->sector_size ? : qdl->sector_size; | ||
|
|
||
|
|
@@ -568,7 +577,7 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int | |
|
|
||
| vip_transfer_clear_status(qdl); | ||
| } | ||
| n = qdl_write(qdl, buf, chunk_size * sector_size, 30000); | ||
| n = qdl_write(qdl, buf, chunk_size * sector_size, zlp_timeout); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The actual increase to 30s occurred in the previous commit
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for catching that, the timeout was not supposed to change in the previous commit. |
||
| if (n < 0) { | ||
| ux_err("USB write failed for data chunk\n"); | ||
| ret = firehose_read(qdl, 30000, firehose_generic_parser, NULL); | ||
|
|
@@ -1012,7 +1021,7 @@ int firehose_run(struct qdl_device *qdl, enum qdl_storage_type storage) | |
| if (ret) | ||
| return ret; | ||
|
|
||
| ret = program_execute(qdl, firehose_program); | ||
| ret = program_execute(qdl, firehose_program, storage); | ||
| if (ret) | ||
| return ret; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that
struct qdl_devicealready has some storage-related fields likesize_t sector_size, why not includeqdl_storage_typeinto this structure as well?This will remove the need to pass one more param to functions like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does make sense, we only support flashing single-storage-type anyways, so that would keep things cleaner. Thanks.