xref: /openbmc/u-boot/doc/README.android-fastboot (revision 3aab70afc531d1eea0e6fcfcf49001163ad13137)
1*3aab70afSSebastian SiewiorAndroid Fastboot
2*3aab70afSSebastian Siewior~~~~~~~~~~~~~~~~
3*3aab70afSSebastian Siewior
4*3aab70afSSebastian SiewiorOverview
5*3aab70afSSebastian Siewior========
6*3aab70afSSebastian SiewiorThe protocol that is used over USB is described in
7*3aab70afSSebastian SiewiorREADME.android-fastboot-protocol in same directory.
8*3aab70afSSebastian Siewior
9*3aab70afSSebastian SiewiorThe current implementation does not yet support the flash and erase
10*3aab70afSSebastian Siewiorcommands.
11*3aab70afSSebastian Siewior
12*3aab70afSSebastian SiewiorClient installation
13*3aab70afSSebastian Siewior===================
14*3aab70afSSebastian SiewiorThe counterpart to this gadget is the fastboot client which can
15*3aab70afSSebastian Siewiorbe found in Android's platform/system/core repository in the fastboot
16*3aab70afSSebastian Siewiorfolder. It runs on Windows, Linux and even OSX. Linux user are lucky since
17*3aab70afSSebastian Siewiorthey only need libusb.
18*3aab70afSSebastian SiewiorWindows users need to bring some time until they have Android SDK (currently
19*3aab70afSSebastian Siewiorhttp://dl.google.com/android/installer_r12-windows.exe) installed. You
20*3aab70afSSebastian Siewiorneed to install ADB package which contains the required glue libraries for
21*3aab70afSSebastian Siewioraccessing USB. Also you need "Google USB driver package" and "SDK platform
22*3aab70afSSebastian Siewiortools". Once installed the usb driver is placed in your SDK folder under
23*3aab70afSSebastian Siewiorextras\google\usb_driver. The android_winusb.inf needs a line like
24*3aab70afSSebastian Siewior
25*3aab70afSSebastian Siewior   %SingleBootLoaderInterface% = USB_Install, USB\VID_0451&PID_D022
26*3aab70afSSebastian Siewior
27*3aab70afSSebastian Siewioreither in the [Google.NTx86] section for 32bit Windows or [Google.NTamd64]
28*3aab70afSSebastian Siewiorfor 64bit Windows. VID and PID should match whatever the fastboot is
29*3aab70afSSebastian Siewioradvertising.
30*3aab70afSSebastian Siewior
31*3aab70afSSebastian SiewiorBoard specific
32*3aab70afSSebastian Siewior==============
33*3aab70afSSebastian SiewiorThe fastboot gadget relies on the USB download gadget, so the following
34*3aab70afSSebastian Siewioroptions must be configured:
35*3aab70afSSebastian Siewior
36*3aab70afSSebastian SiewiorCONFIG_USBDOWNLOAD_GADGET
37*3aab70afSSebastian SiewiorCONFIG_G_DNL_VENDOR_NUM
38*3aab70afSSebastian SiewiorCONFIG_G_DNL_PRODUCT_NUM
39*3aab70afSSebastian SiewiorCONFIG_G_DNL_MANUFACTURER
40*3aab70afSSebastian Siewior
41*3aab70afSSebastian SiewiorThe fastboot function is enabled by defining CONFIG_CMD_FASTBOOT and
42*3aab70afSSebastian SiewiorCONFIG_ANDROID_BOOT_IMAGE.
43*3aab70afSSebastian Siewior
44*3aab70afSSebastian SiewiorThe fastboot protocol requires a large memory buffer for downloads. This
45*3aab70afSSebastian Siewiorbuffer should be as large as possible for a platform. The location of the
46*3aab70afSSebastian Siewiorbuffer and size are set with CONFIG_USB_FASTBOOT_BUF_ADDR and
47*3aab70afSSebastian SiewiorCONFIG_USB_FASTBOOT_BUF_SIZE.
48*3aab70afSSebastian Siewior
49*3aab70afSSebastian SiewiorIn Action
50*3aab70afSSebastian Siewior=========
51*3aab70afSSebastian SiewiorEnter into fastboot by executing the fastboot command in u-boot and you
52*3aab70afSSebastian Siewiorshould see:
53*3aab70afSSebastian Siewior|GADGET DRIVER: usb_dnl_fastboot
54*3aab70afSSebastian Siewior
55*3aab70afSSebastian SiewiorOn the client side you can fetch the bootloader version for instance:
56*3aab70afSSebastian Siewior|>fastboot getvar bootloader-version
57*3aab70afSSebastian Siewior|bootloader-version: U-Boot 2014.04-00005-gd24cabc
58*3aab70afSSebastian Siewior|finished. total time: 0.000s
59*3aab70afSSebastian Siewior
60*3aab70afSSebastian Siewioror initiate a reboot:
61*3aab70afSSebastian Siewior|>fastboot reboot
62*3aab70afSSebastian Siewior
63*3aab70afSSebastian Siewiorand once the client comes back, the board should reset.
64*3aab70afSSebastian Siewior
65*3aab70afSSebastian SiewiorYou can also specify a kernel image to boot. You have to either specify
66*3aab70afSSebastian Siewiorthe an image in Android format _or_ pass a binary kernel and let the
67*3aab70afSSebastian Siewiorfastboot client wrap the Android suite around it. On OMAP for instance you
68*3aab70afSSebastian Siewiortake zImage kernel and pass it to the fastboot client:
69*3aab70afSSebastian Siewior
70*3aab70afSSebastian Siewior|>fastboot -b 0x80000000 -c "console=ttyO2 earlyprintk root=/dev/ram0
71*3aab70afSSebastian Siewior|	mem=128M" boot zImage
72*3aab70afSSebastian Siewior|creating boot image...
73*3aab70afSSebastian Siewior|creating boot image - 1847296 bytes
74*3aab70afSSebastian Siewior|downloading 'boot.img'...
75*3aab70afSSebastian Siewior|OKAY [  2.766s]
76*3aab70afSSebastian Siewior|booting...
77*3aab70afSSebastian Siewior|OKAY [ -0.000s]
78*3aab70afSSebastian Siewior|finished. total time: 2.766s
79*3aab70afSSebastian Siewior
80*3aab70afSSebastian Siewiorand on the gadget side you should see:
81*3aab70afSSebastian Siewior|Starting download of 1847296 bytes
82*3aab70afSSebastian Siewior|........................................................
83*3aab70afSSebastian Siewior|downloading of 1847296 bytes finished
84*3aab70afSSebastian Siewior|Booting kernel..
85*3aab70afSSebastian Siewior|## Booting Android Image at 0x81000000 ...
86*3aab70afSSebastian Siewior|Kernel load addr 0x80008000 size 1801 KiB
87*3aab70afSSebastian Siewior|Kernel command line: console=ttyO2 earlyprintk root=/dev/ram0 mem=128M
88*3aab70afSSebastian Siewior|   Loading Kernel Image ... OK
89*3aab70afSSebastian Siewior|OK
90*3aab70afSSebastian Siewior|
91*3aab70afSSebastian Siewior|Starting kernel ...
92