u-boot/drivers/usb
Patrick Delaunay 86b6a38863 dfu: handle short frame result of UPLOAD in state_dfu_idle
In DFU v1.1 specification [1] the DFU_UPLOAD (Short Frame)
is handled only in dfuUPLOADIDLE state:

- Figure A.1 Interface state transition diagram

- the state description in chapter A.2

A.2.3 State 2 dfuIDLE
  on Receipt of the DFU_UPLOAD request,and bitCanUpload = 1
  the Next State is dfuUPLOADIDLE

A.2.10 State 9 dfuUPLOAD-IDLE
  When the length of the data transferred by the device in response
  to a DFU_UPLOAD request is less than wLength. (Short frame)
  the Next State is dfuIDLE

In current code, when an UPLOAD is completely performed after the first
request (for example with wLength=200 and data read = 9), the DFU state
stay at dfuUPLOADIDLE until receiving a DFU_UPLOAD or a DFU_ABORT request
even it is unnecessary as the previous DFU_UPLOAD request already reached
the EOF.

This patch proposes to finish the DFU uploading (don't go to dfuUPLOADIDLE)
and completes the control-read operation (go to DFU_STATE_dfuIDLE) when
the first UPLOAD response has a short frame as an end of file (EOF)
indicator even if it is not explicitly allowed in the DFU specification
but this seems logical.

[1] https://www.usb.org/sites/default/files/DFU_1.1.pdf

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-01-28 10:21:51 -05:00
..
cdns3 usb: cdns3: cdns3-ti: Add compatible for AM64 SoC 2021-11-17 17:09:47 -05:00
common usb: common: silence dubious errors 2021-11-09 17:18:23 +05:30
dwc3 usb: dwc3: add layerscape support 2021-11-09 17:18:23 +05:30
emul usb: Enforce DM_USB migration for USB_HOST devices. 2021-07-18 21:05:31 -04:00
eth WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
gadget dfu: handle short frame result of UPLOAD in state_dfu_idle 2022-01-28 10:21:51 -05:00
host acpi refactoring to allow non-x86 use 2022-01-27 14:14:47 -05:00
mtu3 usb: mtu3: flush cache for the first GPD when allocate GPD ring 2021-11-03 08:47:57 +01:00
musb drivers/usb/musb/musb_udc.c: Fix spelling of "mismatch". 2022-01-13 07:57:49 -05:00
musb-new doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
phy usb: phy: ti: Remove non-DM PHY code 2021-09-27 21:38:34 -04:00
ulpi common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
Kconfig usb: Enforce DM_USB migration for USB_HOST devices. 2021-07-18 21:05:31 -04:00