Merge DFU support into mainline U-Boot


 * Summary: Merge DFU support into mainline U-Boot


 * Proposer: Stefan Schmidt

Description
The USB Implementers Forum have created an official Device Firmware Upgrade (DFU) USB device class. This simplifies and standardizes the process of upgrading firmware greatly as the device is able to describe named partitions. The user merely selects the target partition by name and specifies the file to write to it. It is even bidirectional -- DFU may be used to extract the firmware from the device. This leads to obvious and trivial methods for backing up and restoring not only the devices operating code, but even the user's personal data and configuration settings.

Openmoko has implemented support for this spec in their fork of U-Boot. Their U-Boot appears to be in good shape though as it is maintained in a git repo forked from the mainline tree around version 1.3.2. This should ease the process of reviewing changes and updating to newer versions greatly.

The dfu-utils userspace package (based on libusb, so portable to Windows/MAC OSX/BSDs/etc...) can be used for device detection, partition selection, flash read and flash write. Only a USB cable is needed to attach the device to your computer -- no need to talk to the device yourself over something messy like a serial console let alone be forced to run the commands yourself (load/erase/write/etc...). This makes it a lot easier to update the firmware during development as well as doing an update in the field by the customer or field service engineer.

The Openmoko patches will be updated to work with the U-Boot git version, remaining bugs will get fixed, review incorporated and worked on until merged into U-Boot mainline.

Related work

 * DFU Utilities: http://dfu-util.gnumonks.org/
 * USB DFU Spec: http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

Scope
This should take about a month to update, test, and merge.

Contractor Candidates
As the current maintainer and core developer of the dfu-utils and someone who has worked at Openmoko during the development of the DFU implementation I would nominate myself.

Comments
Not related to this proposal, but note that the DFU patches in openmoko have been used for adding DFU support in Barebox:

http://www.barebox.org/documentation/barebox-2010.12.0/dfu_command.html

Status
This project is in progress but has stalled. Patches have been posted but none have been integrated into U-Boot mainline. Three different sets have been posted:


 * DFU support for NAND flashing on devices using the old gadget framework
 * DFU support for MMC and fat on devices using the new gadget framework with a split into different flashing backends
 * NAND backend and merge of the DFU protocol implementation for old and new gadget framework devices. This is not ready yet, but can be used as a base for improvements and merging., ,