-
Notifications
You must be signed in to change notification settings - Fork 89
[RFC] qdl: add support for dry run execution #98
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
io.c
Outdated
@@ -0,0 +1,74 @@ | |||
/* | |||
* Copyright (c) 2025, Igor Opaniuk <igor.opaniuk@oss.qualcomm.com> |
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.
I'd expect something different here.
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.
Updated to the same copyright line currently used in the Linux kernel:
Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
@@ -213,23 +224,25 @@ int main(int argc, char **argv) | |||
} | |||
} while (++optind < argc); | |||
|
|||
ret = qdl_open(&qdl, serial); | |||
ret = qdl_open(qdl, serial); |
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.
This and the below renames from qdl_ to usb_ prefix is a logically separate change from the introduction of the simulation mechanism. Please perform such trivial adjustments in a separate patch (in the same PR).
usb.c
Outdated
{ | ||
struct libusb_device **devs; | ||
struct libusb_device *dev; | ||
struct qdl_device_usb *qdl_usb = (struct qdl_device_usb*) qdl; |
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.
Please introduce and use a container_of() macro for this, rather than just casting between the types.
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.
added, thanks!
usb.c
Outdated
} | ||
|
||
int usb_init(struct qdl_device **qdl) |
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.
As we don't care to differentiate between errors, please just return the struct qdl_device *, or NULL on error.
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.
fixed, thanks for the suggestion!
e3da70f
to
2929f09
Compare
2929f09
to
cfc08a3
Compare
This mode assists in validating the `rawprogram_.xml` and `patch_.xml` files, as well as the Firehose commands that are expected to be sent to the Firehose programmer. Dry run implementation is also expected to be extended for the Digests Table generation required for Firehose Validated Image Programming (VIP). Example of usage: $ qdl --dry-run --serial=0AA94EFD --debug prog_firehose_ddr.elf rawprogram*.xml patch*.xml qdl version v2.1-24-g30ac3a8-dirty This is a dry-run execution of QDL. No actual flashing has been performed waiting for programmer... FIREHOSE WRITE: <?xml version="1.0"?> <data><configure MemoryName="ufs" MaxPayloadSizeToTargetInBytes="1048576" verbose="0" ZLPAwareHost="1" SkipStorageInit="0"/></data> FIREHOSE WRITE: <?xml version="1.0"?> <data><configure MemoryName="ufs" MaxPayloadSizeToTargetInBytes="0" verbose="0" ZLPAwareHost="1" SkipStorageInit="0"/></data> accepted max payload size: 0 FIREHOSE WRITE: <?xml version="1.0"?> <data><program SECTOR_SIZE_IN_BYTES="4096" num_partition_sectors="131072" physical_partition_number="0" start_sector="6" filename="efi.bin"/></data> Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
cfc08a3
to
fbebf18
Compare
This mode assists in validating the
rawprogram_.xml
andpatch_.xml
files, as well as the Firehose commands that are expected to be sent to the Firehose programmer.Dry run implementation is also expected to be extended for the Digests Table generation required for Firehose Validated Image Programming (VIP).
Example of usage: