blob: 167760968ff56e5ede39c7395cc4cffbc9f01d7e [file] [log] [blame]
Sebastian Siewior3aab70a2014-05-05 15:08:10 -05001Android Fastboot
2~~~~~~~~~~~~~~~~
3
4Overview
5========
6The protocol that is used over USB is described in
7README.android-fastboot-protocol in same directory.
8
Steve Raed1b5ed02014-08-26 11:47:28 -07009The current implementation does not yet support the erase command or the
10"oem format" command, and there is minimal support for the flash command;
11it only supports eMMC devices.
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050012
13Client installation
14===================
15The counterpart to this gadget is the fastboot client which can
16be found in Android's platform/system/core repository in the fastboot
17folder. It runs on Windows, Linux and even OSX. Linux user are lucky since
18they only need libusb.
19Windows users need to bring some time until they have Android SDK (currently
20http://dl.google.com/android/installer_r12-windows.exe) installed. You
21need to install ADB package which contains the required glue libraries for
22accessing USB. Also you need "Google USB driver package" and "SDK platform
23tools". Once installed the usb driver is placed in your SDK folder under
24extras\google\usb_driver. The android_winusb.inf needs a line like
25
26 %SingleBootLoaderInterface% = USB_Install, USB\VID_0451&PID_D022
27
28either in the [Google.NTx86] section for 32bit Windows or [Google.NTamd64]
29for 64bit Windows. VID and PID should match whatever the fastboot is
30advertising.
31
32Board specific
33==============
34The fastboot gadget relies on the USB download gadget, so the following
35options must be configured:
36
37CONFIG_USBDOWNLOAD_GADGET
38CONFIG_G_DNL_VENDOR_NUM
39CONFIG_G_DNL_PRODUCT_NUM
40CONFIG_G_DNL_MANUFACTURER
41
Barnes, Clifton A183cbff2014-07-22 11:23:56 -040042NOTE: The CONFIG_G_DNL_VENDOR_NUM must be one of the numbers supported by
43the fastboot client. The list of vendor IDs supported can be found in the
44fastboot client source code (fastboot.c) mentioned above.
45
Sebastian Siewior3aab70a2014-05-05 15:08:10 -050046The fastboot function is enabled by defining CONFIG_CMD_FASTBOOT and
47CONFIG_ANDROID_BOOT_IMAGE.
48
49The fastboot protocol requires a large memory buffer for downloads. This
50buffer should be as large as possible for a platform. The location of the
51buffer and size are set with CONFIG_USB_FASTBOOT_BUF_ADDR and
52CONFIG_USB_FASTBOOT_BUF_SIZE.
53
54In Action
55=========
56Enter into fastboot by executing the fastboot command in u-boot and you
57should see:
58|GADGET DRIVER: usb_dnl_fastboot
59
60On the client side you can fetch the bootloader version for instance:
61|>fastboot getvar bootloader-version
62|bootloader-version: U-Boot 2014.04-00005-gd24cabc
63|finished. total time: 0.000s
64
65or initiate a reboot:
66|>fastboot reboot
67
68and once the client comes back, the board should reset.
69
70You can also specify a kernel image to boot. You have to either specify
71the an image in Android format _or_ pass a binary kernel and let the
72fastboot client wrap the Android suite around it. On OMAP for instance you
73take zImage kernel and pass it to the fastboot client:
74
75|>fastboot -b 0x80000000 -c "console=ttyO2 earlyprintk root=/dev/ram0
76| mem=128M" boot zImage
77|creating boot image...
78|creating boot image - 1847296 bytes
79|downloading 'boot.img'...
80|OKAY [ 2.766s]
81|booting...
82|OKAY [ -0.000s]
83|finished. total time: 2.766s
84
85and on the gadget side you should see:
86|Starting download of 1847296 bytes
87|........................................................
88|downloading of 1847296 bytes finished
89|Booting kernel..
90|## Booting Android Image at 0x81000000 ...
91|Kernel load addr 0x80008000 size 1801 KiB
92|Kernel command line: console=ttyO2 earlyprintk root=/dev/ram0 mem=128M
93| Loading Kernel Image ... OK
94|OK
95|
96|Starting kernel ...