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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>