26 Commits

Author SHA1 Message Date
Bjorn Andersson
4a72fc8723 firehose: Read back max payload size
The max payload size is negotiated through the configure and configure
response messages. Update the max payload size based on the
configuration response value, if present.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
v1.0
2017-11-28 20:33:45 -08:00
Bjorn Andersson
4c2ea2c10c firehose: Don't pad partitions with zeros
During program it's recommended to reduce the num_sectors to only cover
the sectors containing data to be written and not write zero-block in
the rest. This reduce the time spent sending unnecessary blocks of
zeros.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28 19:06:51 -08:00
Bjorn Andersson
4922fdffbf firehose: Write max_payload_size chunks at a time
Reduce the number of write operations by batching up sectors in a
max_payload_size sized buffer and write them in one chunk. Using the
qcserial driver will still chop up the USB traffic in 4kB chunks, so no
measurable perfomance improvement is seen.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28 18:58:42 -08:00
Bjorn Andersson
34a47b4d29 firehose: Bump max payload size config parameter
The MaxPayloadSizeToTargetInBytes parameter of the configure command is
supposed to set the maximum size of the transfer unit. This size is
however limited by the use of the in-kernel qcserial driver and the use
of sector-sized writes. Yet increasing it, drastically bumps the
transfer speed, so leave it high.

NB. The max payload size supported by the device is part of the
configure response, if the device supports a value less than the
requested size - which we just ignore today.

Suggested-by: Kirill Kapranov <c_kkapra@qti.qualcomm.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28 17:40:24 -08:00
Bjorn Andersson
c4852c48bf firehose: Inform about flash speed
To aid fixing performance problems, calculate and print out the program
rate.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28 17:40:24 -08:00
Bjorn Andersson
0793d016cd firehose: Set bootable device based on xbl/sbl1
This bootable device is not always partition number 1. Search the
program entries for an entry that has the label xbl or sbl1 and use the
partition number to mark the boot partition bootable.

Reported-by: Kirill Kapranov <kkapra@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-06 23:25:33 -08:00
Bjorn Andersson
25157ae50d sahara: Ignore DONE response code
The DONE message contains a return code denoting if the firmware is done
(1) requesting files from the host, or if there are more requests to
come (0). Unfortunately on some platforms the ROM code sends 0
regardless, so we just have to assume that we're done.

This assumes that there is only ever one image to transfer.

Reported-by: Kirill Kapranov <kkapra@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-06 23:05:10 -08:00
Bjorn Andersson
6edc9372f0 Makefile: implement GNU Coding Standard for Makefiles
GNU coding standards notably specifies:
 * install files with the $(DESTDIR) to the target system image
 * install files with the $(prefix), not $(PREFIX)
 * the default value of $(prefix) should be /usr/local

as per
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html.

Suggested-by: Kirill Kapranov <kkapra@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-06 22:55:11 -08:00
Bjorn Andersson
02659d718f Add LICENSE file
Merge license headers into the LICENSE file.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-10-04 19:33:09 -07:00
Bjorn Andersson
4c4dbd0317 qdl: Increase tty path buffer size
Rename "buf" to "path" to clarify things and increase the size to
PATH_MAX in order to silence a compile time warning the snprintf() in
find_qdl_tty() might be truncated.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-24 21:04:49 -07:00
Bjorn Andersson
2944120b10 sahara: Compare, don't assign in assert
Two assert incorrectly assigned the desired values rather than verify
that they where correct, fix this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-24 14:36:00 -07:00
Bjorn Andersson
8f36c1e659 qdl: Remove unused functions
Remove some left over functions from development, they can be added back
as needed in the future.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-24 14:34:35 -07:00
Bjorn Andersson
4081f059c1 program: Drop readback from parser
Not all program XML tags contain the readback attribute and as we don't
care about the value at this point lets just stop caring about it for
now.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-24 14:32:14 -07:00
Bjorn Andersson
0bb387615b qdl: Update README and add license header
This adds a license header to all files and updates the README with
information on building the project.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-07-24 23:46:13 -07:00
Bjorn Andersson
c93907cfae qdl: Support multi-xml responses
Unsolicited log messages are put in the device buffer as independant xml
documents and upon reading the response packet we might get a multiple
of xml documents in one go; we must feed them to the parser one by one.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-23 15:11:14 -07:00
Bjorn Andersson
a29f44cc07 qdl: Make failed program or patch operation stop execution
Failures to apply program or patch operations are silently ignored,
forcing the user to inspect the logs to conclude if the flashing
succeded. Instead make the operations halt execution.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-21 11:55:16 -07:00
Bjorn Andersson
63f64d0bbf qdl: Print error message on firehose_write errors
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-21 11:48:44 -07:00
Nicolas Dechesne
000ec0909a firehose: fixup typo
This typo was introduced in 1611c78335 when the
code was reworked.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2016-09-21 17:11:50 +02:00
Nicolas Dechesne
1f28fb0259 qdl.h: remove unexisting function reference
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2016-09-21 12:47:53 +02:00
Bjorn Andersson
1611c78335 qdl: Add --debug for dumping firehose traffic
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-27 13:09:16 -07:00
Bjorn Andersson
0a0580cff5 qdl: Correct spelling of "data" and add "contents"
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-08 16:08:46 -07:00
Bjorn Andersson
1a0e6a51d9 qdl: Add README
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-08 11:51:45 -07:00
Bjorn Andersson
4c8ba17cbc qdl: Detect xml file type and simplify usage
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-08 11:47:58 -07:00
Bjorn Andersson
e72a9a1135 qdl: Add gitignore
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-08 11:27:19 -07:00
Bjorn Andersson
da68b4add8 qdl: Support for program and patch
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-07-08 11:26:26 -07:00