dc61f8f79e broke ufs provisioning by requiring base 10 for unsigned
attributes (provisioning xml have some values in hexadecimal). strtoul()
would return 0 for these values and provisioning would fail strangely.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
On db410c writes sometimes fails becasue the device had more log entries
to read after the <response> and refuses writes until these are drained.
Deal with this by attempting a read when write fails with a timeout.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
WIth the transition from qcserial to USBFS we no longer receive multiple
messages in a single read, so we can remove the code that decode the
buffer piecemeal.
While reworking this, also introduce a mechanism so that the parsers can
pass values back to the caller of the read.
And modify the timeout handling so that the caller always has to pass a
timeout, and bump the timeouts slightly, as they are all fatal anyways.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
qdl_write() is always called with eot=true, so drop the parameter.
As a length of 0 means we're not entering the loop and we're now always
entering the conditonal block at the end we can remove the first chunk.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
NAND based devices comes with a few minor tweaks to the program tag and
an additional erase tag, split the program code and add the handling of
the erase tag.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Remove the dummy sleep and reliance on USB read timeout while waiting
for the firehose payload to launch by rolling our own timeout handling
in firehose_read. While at it extend the firehose program timeouts, to
avoid issues seen when these operations for some reason takes a little
bit longer to return.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The SDX55 shows up with bInterfaceProtocol of 17, so allow this to get
past the USB filtering routine.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The downstream tool has a 3 second delay to allow the firehose payload
to boot. Adding the same makes db820c successfully enter firehose mode.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Upon booting the firehose payload some platforms will issue log messages
others won't. Rather than waiting for 10 seconds on the ones that
doesn't wait only for a second.
Hopefully this is long enough, but the firmware synchronization and
handling of incoming log messages should be reviewed further.
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>
On db410c the target sends log entries after the response and refuse to
serve any subsequent requests until these are consumed, so continue
reading log entries until we get a timeout.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
We should return in case we haven't reached the end of the Sahara
init, which is when we set done to true. If done is not set to true
before returning from sahara_run() , it means something went wrong.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
A full build will contain both xbl_a and xbl_b, so matching on the
prefix of "xbl" will find two entries which we consider invalid.
Explicitly search for "xbl_a" instead.
Fixes: 5ea1e20c01 ("program: Match xbl in a/b scenarios")
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 devices implementing a/b updates the xbl partiiton will be named
xbl_a and xbl_b, extend the match for finding the bootable partition to
support this.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
It was assumed that we should send all the data following a "program"
request to the device, before sending a ZLP. But on SDM845 it's seen
that not sending a ZLP after each chunk sometimes causes the
communication to stall.
Given that the "program" request already carries the information about
how much data will be transferred there should be no issues with sending
additional ZLPs, so do this.
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>