qdl.c, with its main method, should not be included in the nbdkit. Add
the global qdl_debug variable to nbdkit and expose it as an nbdkit
configuration option.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
With the refactoring leading up to the firehose implementation being
driven by the client code and the USB code extracted we can implement
nbdkit plugin exposing the flash storage to the host PC.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>
Implement a function to query the storage information, to allow the
nbdkit plugin to query the size of each storage device.
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>