8 The protocol that is used over USB and UDP is described in the
9 ``README.android-fastboot-protocol`` file in the same directory.
11 The current implementation supports the following standard commands:
16 - ``erase`` (if enabled)
17 - ``flash`` (if enabled)
20 - ``reboot-bootloader``
21 - ``set_active`` (only a stub implementation which always succeeds)
23 The following OEM commands are supported (if enabled):
25 - oem format - this executes ``gpt write mmc %x $partitions``
27 Support for both eMMC and NAND devices is included.
32 The counterpart to this is the fastboot client which can be found in
33 Android's ``platform/system/core`` repository in the fastboot
34 folder. It runs on Windows, Linux and OSX. The fastboot client is
35 part of the Android SDK Platform-Tools and can be downloaded from:
37 https://developer.android.com/studio/releases/platform-tools
45 The fastboot gadget relies on the USB download gadget, so the following
46 options must be configured:
50 CONFIG_USB_GADGET_DOWNLOAD
51 CONFIG_USB_GADGET_VENDOR_NUM
52 CONFIG_USB_GADGET_PRODUCT_NUM
53 CONFIG_USB_GADGET_MANUFACTURER
55 NOTE: The ``CONFIG_USB_GADGET_VENDOR_NUM`` must be one of the numbers
56 supported by the fastboot client. The list of vendor IDs supported can
57 be found in the fastboot client source code.
62 The fastboot protocol requires a large memory buffer for
63 downloads. This buffer should be as large as possible for a
64 platform. The location of the buffer and size are set with
65 ``CONFIG_FASTBOOT_BUF_ADDR`` and ``CONFIG_FASTBOOT_BUF_SIZE``. These
66 may be overridden on the fastboot command line using ``-l`` and
69 Fastboot environment variables
70 ==============================
75 Fastboot partition aliases can also be defined for devices where GPT
76 limitations prevent user-friendly partition names such as "boot", "system"
77 and "cache". Or, where the actual partition name doesn't match a standard
78 partition name used commonly with fastboot.
80 The current implementation checks aliases when accessing partitions by
81 name (flash_write and erase functions). To define a partition alias
82 add an environment variable similar to:
84 ``fastboot_partition_alias_<alias partition name>=<actual partition name>``
88 ``fastboot_partition_alias_boot=LNX``
93 Variables retrived through ``getvar`` can be overridden by defining
94 environment variables of the form ``fastboot.<variable>``. These are
95 looked up first so can be used to override values which would
96 otherwise be returned. Using this mechanism you can also return types
97 for NAND filesystems, as the fully parameterised variable is looked
100 ``fastboot.partition-type:boot=jffs2``
105 When executing the fastboot ``boot`` command, if ``fastboot_bootcmd`` is set then
106 that will be executed in place of ``bootm <CONFIG_FASTBOOT_BUF_ADDR>``.
111 The Fastboot implementation in U-Boot allows to write images into disk
112 partitions. Target partitions are referred on the host computer by
115 For GPT/EFI the respective partition name is used.
117 For MBR the partitions are referred by generic names according to the
120 <device type><device index letter><partition index>
122 Example: ``hda3``, ``sdb1``, ``usbda1``
124 The device type is as follows:
126 * IDE, ATAPI and SATA disks: ``hd``
128 * USB media: ``usbd``
129 * MMC and SD cards: ``mmcsd``
130 * Disk on chip: ``docd``
133 The device index starts from ``a`` and refers to the interface (e.g. USB
134 controller, SD/MMC controller) or disk index. The partition index starts
135 from ``1`` and describes the partition number on the particular device.
137 Writing Partition Table
138 =======================
140 Fastboot also allows to write the partition table to the media. This can be
141 done by writing the respective partition table image to a special target
142 "gpt" or "mbr". These names can be customized by defining the following
143 configuration options:
147 CONFIG_FASTBOOT_GPT_NAME
148 CONFIG_FASTBOOT_MBR_NAME
153 Enter into fastboot by executing the fastboot command in U-Boot for either USB:
164 link up on port 0, speed 100, full duplex
165 Using ethernet@4a100000 device
166 Listening for fastboot command on 192.168.0.102
168 On the client side you can fetch the bootloader version for instance:
172 $ fastboot getvar bootloader-version
173 bootloader-version: U-Boot 2014.04-00005-gd24cabc
174 finished. total time: 0.000s
176 or initiate a reboot:
182 and once the client comes back, the board should reset.
184 You can also specify a kernel image to boot. You have to either specify
185 the an image in Android format *or* pass a binary kernel and let the
186 fastboot client wrap the Android suite around it. On OMAP for instance you
187 take zImage kernel and pass it to the fastboot client:
191 $ fastboot -b 0x80000000 -c "console=ttyO2 earlyprintk root=/dev/ram0 mem=128M" boot zImage
192 creating boot image...
193 creating boot image - 1847296 bytes
194 downloading 'boot.img'...
198 finished. total time: 2.766s
200 and on the U-Boot side you should see:
204 Starting download of 1847296 bytes
205 ........................................................
206 downloading of 1847296 bytes finished
208 ## Booting Android Image at 0x81000000 ...
209 Kernel load addr 0x80008000 size 1801 KiB
210 Kernel command line: console=ttyO2 earlyprintk root=/dev/ram0 mem=128M
211 Loading Kernel Image ... OK