summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-21 17:08:19 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-24 08:32:57 +0200
commit46ff98b011c86511a8585a01fa3c4fbb774c9c54 (patch)
tree654c7efa4d52e7ba7df8abec8950b4616d6b67f2
parent530731353d561c5fef04282448d743109bf93aea (diff)
downloadbarebox-46ff98b011c86511a8585a01fa3c4fbb774c9c54.tar.gz
barebox-46ff98b011c86511a8585a01fa3c4fbb774c9c54.tar.xz
Documentation: Add documentation for Fastboot and Composite Multifunction Gadget
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--Documentation/user/usb.rst48
1 files changed, 48 insertions, 0 deletions
diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst
index f67a2f13d4..7cdd6ac814 100644
--- a/Documentation/user/usb.rst
+++ b/Documentation/user/usb.rst
@@ -95,3 +95,51 @@ USB serial console
barebox can provide a serial console over USB. This can be initialized with the
:ref:`command_usbserial` command. Once the host is plugged in it should show a
new serial device, on Linux for example ``/dev/ttyACM0``.
+
+Android Fastboot support
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+barebox has support for the android fastboot protocol. There is no dedicated command
+for initializing the fastboot protocol, instead it is integrated into the Multifunction
+Composite Gadget, see :`ref:command_usbgadget` for a usage description.
+
+The Fastboot gadget supports the following commands:
+
+- fastboot flash
+- fastboot getvar
+- fastboot boot
+- fastboot reboot
+
+**NOTE** ``fastboot erase`` is not yet implemented. This means flashing MTD partitions
+does not yet work.
+
+The barebox Fastboot gadget supports the following non standard extensions:
+
+- ``fastboot getvar all``
+ Shows a list of all variables
+- ``fastboot oem getenv <varname>``
+ Shows a barebox environment variable
+- ``fastboot oem setenv <varname>=<value>``
+ Sets a barebox environment variable
+- ``fastboot oem exec <cmd>``
+ executes a shell command. Note the output can't be seen on the host, but the fastboot
+ command returns successfully when the barebox command was successful and it fails when
+ the barebox command fails.
+
+USB Composite Multifunction Gadget
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+With the Composite Multifunction Gadget it is possible to create a USB device with
+multiple functions. A useful combination is creating a Fastboot gadget and a USB serial
+console. This combination can be created with:
+
+.. code-block:: sh
+
+ usbgadget -A /dev/mmc2.0(root),/dev/mmc2.1(data) -a
+
+The ``-A`` option will create a Fastboot function providing ``/dev/mmc2.0`` as root
+partition and ``/dev/mmc2.1`` as data partition. The ``-a`` option will create a
+USB CDC ACM compliant serial device.
+
+Unlike the :ref:`command_dfu` command the ``usbgadget`` command returns immediately
+after creating the gadget. The gadget can be removed with ``usbgadget -d``.