Move the USB functions to a separate file, so that we can build the
nbdkit plugin without including qdl.c.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Move the call to set_bootable out of firehose_run(), with the goal of
removing firehose_run()
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
By extracting the initial parts of firehose_run() we get closer to being
able to reuse the firehose code in the upcoming nbdkit plugin.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Expose firehose_reset() and call this from the main() function instead,
allowing the code to be reused between qdl and the nbdkit plugin.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
It's perfectly normal to "poll" for incoming messages, so silence the
warning printout in the usb accessor functions.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Add support back for waiting for an EDL device to appear. This is useful
when paired with some automation scripts that introduces "arbitrary"
delays in the process of entering EDL mode.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The nop was added to mitigate the fact that there's a rather long delay
in the response when sending out the first command. Increasing the write
timeout removes this problem and it's possible to just send the
configure as the first command without issues.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
On some newer platforms the device ignore the configure request to
disable ZLP, causing the Firehose program request to stall, when the
device is waiting for a ZLP to end a transfer.
Mitigate this by circumventing the qcserial driver and drive the USB
traffic directly using USBFS. The tool will attempt to detach qcserial
from the device, in case it's already attached, so no changes are needed
in the kernel or system configuration.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Added qdl support for emmc storage on platforms with UFS support. Use
option --s emmc or ufs as a argument to qdl command, if not specified
any option the default storage would be ufs
Tested-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Laxman <itsmelaxman91@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Since it is by no means certain that the current tty is ttyUSB1,
do not assume it to be so.
Unfortunately we do not know the current tty in main().
It would be possible to refactor the code so that we could print
the current tty, but since the only consumer of that information
would be this error message, that refactoring seems unjustified.
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Let the programmer search for files beyond the current folder. When --include is
used , the programmmer will first look for files in the specified folder, and it
will then fallback to looking at the current folder.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In the case that we find a "data" tag, but not a "program" or "ufs"
child node type might have been left unitialized. Fix this by
initializing type.
Also fix up the styling of the multiline blocks.
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>
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>