xref: /openbmc/u-boot/doc/README.android-fastboot (revision 183cbff706476d75e3cb92d1332c94ff4958b4bd)
13aab70afSSebastian SiewiorAndroid Fastboot
23aab70afSSebastian Siewior~~~~~~~~~~~~~~~~
33aab70afSSebastian Siewior
43aab70afSSebastian SiewiorOverview
53aab70afSSebastian Siewior========
63aab70afSSebastian SiewiorThe protocol that is used over USB is described in
73aab70afSSebastian SiewiorREADME.android-fastboot-protocol in same directory.
83aab70afSSebastian Siewior
93aab70afSSebastian SiewiorThe current implementation does not yet support the flash and erase
103aab70afSSebastian Siewiorcommands.
113aab70afSSebastian Siewior
123aab70afSSebastian SiewiorClient installation
133aab70afSSebastian Siewior===================
143aab70afSSebastian SiewiorThe counterpart to this gadget is the fastboot client which can
153aab70afSSebastian Siewiorbe found in Android's platform/system/core repository in the fastboot
163aab70afSSebastian Siewiorfolder. It runs on Windows, Linux and even OSX. Linux user are lucky since
173aab70afSSebastian Siewiorthey only need libusb.
183aab70afSSebastian SiewiorWindows users need to bring some time until they have Android SDK (currently
193aab70afSSebastian Siewiorhttp://dl.google.com/android/installer_r12-windows.exe) installed. You
203aab70afSSebastian Siewiorneed to install ADB package which contains the required glue libraries for
213aab70afSSebastian Siewioraccessing USB. Also you need "Google USB driver package" and "SDK platform
223aab70afSSebastian Siewiortools". Once installed the usb driver is placed in your SDK folder under
233aab70afSSebastian Siewiorextras\google\usb_driver. The android_winusb.inf needs a line like
243aab70afSSebastian Siewior
253aab70afSSebastian Siewior   %SingleBootLoaderInterface% = USB_Install, USB\VID_0451&PID_D022
263aab70afSSebastian Siewior
273aab70afSSebastian Siewioreither in the [Google.NTx86] section for 32bit Windows or [Google.NTamd64]
283aab70afSSebastian Siewiorfor 64bit Windows. VID and PID should match whatever the fastboot is
293aab70afSSebastian Siewioradvertising.
303aab70afSSebastian Siewior
313aab70afSSebastian SiewiorBoard specific
323aab70afSSebastian Siewior==============
333aab70afSSebastian SiewiorThe fastboot gadget relies on the USB download gadget, so the following
343aab70afSSebastian Siewioroptions must be configured:
353aab70afSSebastian Siewior
363aab70afSSebastian SiewiorCONFIG_USBDOWNLOAD_GADGET
373aab70afSSebastian SiewiorCONFIG_G_DNL_VENDOR_NUM
383aab70afSSebastian SiewiorCONFIG_G_DNL_PRODUCT_NUM
393aab70afSSebastian SiewiorCONFIG_G_DNL_MANUFACTURER
403aab70afSSebastian Siewior
41*183cbff7SBarnes, Clifton ANOTE: The CONFIG_G_DNL_VENDOR_NUM must be one of the numbers supported by
42*183cbff7SBarnes, Clifton Athe fastboot client. The list of vendor IDs supported can be found in the
43*183cbff7SBarnes, Clifton Afastboot client source code (fastboot.c) mentioned above.
44*183cbff7SBarnes, Clifton A
453aab70afSSebastian SiewiorThe fastboot function is enabled by defining CONFIG_CMD_FASTBOOT and
463aab70afSSebastian SiewiorCONFIG_ANDROID_BOOT_IMAGE.
473aab70afSSebastian Siewior
483aab70afSSebastian SiewiorThe fastboot protocol requires a large memory buffer for downloads. This
493aab70afSSebastian Siewiorbuffer should be as large as possible for a platform. The location of the
503aab70afSSebastian Siewiorbuffer and size are set with CONFIG_USB_FASTBOOT_BUF_ADDR and
513aab70afSSebastian SiewiorCONFIG_USB_FASTBOOT_BUF_SIZE.
523aab70afSSebastian Siewior
533aab70afSSebastian SiewiorIn Action
543aab70afSSebastian Siewior=========
553aab70afSSebastian SiewiorEnter into fastboot by executing the fastboot command in u-boot and you
563aab70afSSebastian Siewiorshould see:
573aab70afSSebastian Siewior|GADGET DRIVER: usb_dnl_fastboot
583aab70afSSebastian Siewior
593aab70afSSebastian SiewiorOn the client side you can fetch the bootloader version for instance:
603aab70afSSebastian Siewior|>fastboot getvar bootloader-version
613aab70afSSebastian Siewior|bootloader-version: U-Boot 2014.04-00005-gd24cabc
623aab70afSSebastian Siewior|finished. total time: 0.000s
633aab70afSSebastian Siewior
643aab70afSSebastian Siewioror initiate a reboot:
653aab70afSSebastian Siewior|>fastboot reboot
663aab70afSSebastian Siewior
673aab70afSSebastian Siewiorand once the client comes back, the board should reset.
683aab70afSSebastian Siewior
693aab70afSSebastian SiewiorYou can also specify a kernel image to boot. You have to either specify
703aab70afSSebastian Siewiorthe an image in Android format _or_ pass a binary kernel and let the
713aab70afSSebastian Siewiorfastboot client wrap the Android suite around it. On OMAP for instance you
723aab70afSSebastian Siewiortake zImage kernel and pass it to the fastboot client:
733aab70afSSebastian Siewior
743aab70afSSebastian Siewior|>fastboot -b 0x80000000 -c "console=ttyO2 earlyprintk root=/dev/ram0
753aab70afSSebastian Siewior|	mem=128M" boot zImage
763aab70afSSebastian Siewior|creating boot image...
773aab70afSSebastian Siewior|creating boot image - 1847296 bytes
783aab70afSSebastian Siewior|downloading 'boot.img'...
793aab70afSSebastian Siewior|OKAY [  2.766s]
803aab70afSSebastian Siewior|booting...
813aab70afSSebastian Siewior|OKAY [ -0.000s]
823aab70afSSebastian Siewior|finished. total time: 2.766s
833aab70afSSebastian Siewior
843aab70afSSebastian Siewiorand on the gadget side you should see:
853aab70afSSebastian Siewior|Starting download of 1847296 bytes
863aab70afSSebastian Siewior|........................................................
873aab70afSSebastian Siewior|downloading of 1847296 bytes finished
883aab70afSSebastian Siewior|Booting kernel..
893aab70afSSebastian Siewior|## Booting Android Image at 0x81000000 ...
903aab70afSSebastian Siewior|Kernel load addr 0x80008000 size 1801 KiB
913aab70afSSebastian Siewior|Kernel command line: console=ttyO2 earlyprintk root=/dev/ram0 mem=128M
923aab70afSSebastian Siewior|   Loading Kernel Image ... OK
933aab70afSSebastian Siewior|OK
943aab70afSSebastian Siewior|
953aab70afSSebastian Siewior|Starting kernel ...
96