README.android-fastboot 3.3 KB

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