diff options
author | Heiko Schocher <hs@denx.de> | 2014-03-18 08:09:56 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-03-23 02:20:09 +0100 |
commit | 001a8319866062cd63b7b62e5bb4b85eacfde4b4 (patch) | |
tree | 9d9d6a5bd0f4aa96f7fe3466dab6ddc3d846615c /drivers/dfu | |
parent | a2199afea169c1e13881ca90a02a28e4c9ffd114 (diff) | |
download | u-boot-imx-001a8319866062cd63b7b62e5bb4b85eacfde4b4.zip u-boot-imx-001a8319866062cd63b7b62e5bb4b85eacfde4b4.tar.gz u-boot-imx-001a8319866062cd63b7b62e5bb4b85eacfde4b4.tar.bz2 |
usb: dfu: introduce dfuMANIFEST state
on nand flash using ubi, after the download of the new image into
the flash, the "rest" of the nand sectors get erased while flushing
the medium. With current u-boot version dfu-util may show:
Starting download: [##################################################] finished!
state(7) = dfuMANIFEST, status(0) = No error condition is present
unable to read DFU status
as get_status is not answered while erasing sectors, if erasing
needs some time.
So do the following changes to prevent this:
- introduce dfuManifest state
According to dfu specification
( http://www.usb.org/developers/devclass_docs/usbdfu10.pdf ) section 7:
"the device enters the dfuMANIFEST-SYNC state and awaits the solicitation
of the status report by the host. Upon receipt of the anticipated
DFU_GETSTATUS, the device enters the dfuMANIFEST state, where it
completes its reprogramming operations."
- when stepping into dfuManifest state, sending a PollTimeout
DFU_MANIFEST_POLL_TIMEOUT in ms, to the host, so the host
(dfu-util) waits the PollTimeout before sending a get_status again.
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'drivers/dfu')
-rw-r--r-- | drivers/dfu/dfu.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 1aced26..f94c412 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -218,10 +218,6 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) ret = tret; } - /* end? */ - if (size == 0) - ret = dfu_flush(dfu, buf, size, blk_seq_num); - return ret = 0 ? size : ret; } |