Skip to content

[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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

igoropaniuk
Copy link

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>

io.c Outdated
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2025, Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Copy link
Collaborator

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.

Copy link
Author

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);
Copy link
Collaborator

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;
Copy link
Collaborator

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.

Copy link
Author

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)
Copy link
Collaborator

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.

Copy link
Author

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!

@igoropaniuk igoropaniuk force-pushed the dry_run_support branch 3 times, most recently from e3da70f to 2929f09 Compare March 27, 2025 23:13
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>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants