README.android-fastboot 3.8 KB

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