linux-msm / qdl

BSD 3-Clause "New" or "Revised" License
196 stars 76 forks source link

Add support for <read> operations #53

Closed cpfair closed 3 weeks ago

cpfair commented 5 months ago

These operations follow a similar syntax to <program> operations - just moving data in the other direction.

To avoid shadowing the read function, I used read_op for types/functions/variables (breaking the existing convention).

Tested on a QCS6490 SoC.

andersson commented 1 month ago

As you can see in the nbdkit branch, I find the "read" operation quite useful. But is the "read" operation in an xml file used because it follows the current pattern, or is this an existing use case?

How do you use this? What are you actually putting in your XML file? Would it be better UX to make a new "qdl-read" tool that just takes the physical partition, and optional start and length parameters and do the read?

cpfair commented 1 month ago

<read ...> operations in QFIL XML files are found in the wild (e.g. this github search). This PR was intended to make files like these work with qdl.

I agree that a qdl-read tool would be a useful addition. Perhaps it could be as simple as a qdl --read flag, which takes a regular QFIL XML file but performs reads instead of writes.

andersson commented 3 weeks ago

I didn't want to include the merge commit in the history, and the code needed a few small fixups (missing stdlib.h and CodeQL complained about the transfer-speed-print). So rebased it, fixed those and merged it in the form of #74. Thank you for your contribution!