public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] usb: dfu: introduce dfuMANIFEST state
@ 2014-03-12 10:01 Heiko Schocher
  2014-03-12 10:01 ` [U-Boot] [PATCH 1/3] usb, dfu: extract flush code into seperate function Heiko Schocher
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Heiko Schocher @ 2014-03-12 10:01 UTC (permalink / raw)
  To: u-boot

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 dfu_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 [1] 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.


Patch 0002-usb-dfu-introduce-dfuMANIFEST-state.patch shows
following checkpatch errors, but I think they are OK, as the
hole file uses CamelCase for the statenames as this in sync
with [1]

CHECK: Avoid CamelCase: <DFU_STATE_dfuMANIFEST>
#103: FILE: drivers/usb/gadget/f_dfu.c:190:
+		f_dfu->dfu_state = DFU_STATE_dfuMANIFEST;

CHECK: Avoid CamelCase: <DFU_STATE_dfuIDLE>
#156: FILE: drivers/usb/gadget/f_dfu.c:491:
+		f_dfu->dfu_state = DFU_STATE_dfuIDLE;

CHECK: Avoid CamelCase: <DFU_STATE_dfuERROR>
#166: FILE: drivers/usb/gadget/f_dfu.c:501:
+		f_dfu->dfu_state = DFU_STATE_dfuERROR;

total: 0 errors, 0 warnings, 3 checks, 133 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

[1]:
http://www.usb.org/developers/devclass_docs/usbdfu10.pdf

Heiko Schocher (3):
  usb, dfu: extract flush code into seperate function
  usb: dfu: introduce dfuMANIFEST state
  am335x, dfu: add DFU_MANIFEST_POLL_TIMEOUT to the siemens boards

 README                                 |  5 +++
 drivers/dfu/dfu.c                      | 45 +++++++++++++------------
 drivers/usb/gadget/f_dfu.c             | 60 +++++++++++++++++++++++++++++-----
 include/configs/siemens-am33x-common.h |  1 +
 include/dfu.h                          |  4 +++
 5 files changed, 86 insertions(+), 29 deletions(-)

Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-03-17 10:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 10:01 [U-Boot] [PATCH 0/3] usb: dfu: introduce dfuMANIFEST state Heiko Schocher
2014-03-12 10:01 ` [U-Boot] [PATCH 1/3] usb, dfu: extract flush code into seperate function Heiko Schocher
2014-03-12 11:43   ` Marek Vasut
2014-03-13  5:31     ` Heiko Schocher
2014-03-13 12:38       ` Marek Vasut
2014-03-14 10:36       ` Lukasz Majewski
2014-03-12 10:01 ` [U-Boot] [PATCH 2/3] usb: dfu: introduce dfuMANIFEST state Heiko Schocher
2014-03-14 10:47   ` Lukasz Majewski
2014-03-17  6:34     ` Heiko Schocher
2014-03-17  9:46       ` Lukasz Majewski
2014-03-17 10:11         ` Heiko Schocher
2014-03-17 10:42           ` Lukasz Majewski
2014-03-12 10:01 ` [U-Boot] [PATCH 3/3] am335x, dfu: add DFU_MANIFEST_POLL_TIMEOUT to the siemens boards Heiko Schocher
2014-03-14 10:48   ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox