Kconfig 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. menu "Fastboot support"
  2. config FASTBOOT
  3. bool
  4. imply ANDROID_BOOT_IMAGE
  5. imply CMD_FASTBOOT
  6. help
  7. Fastboot is a protocol used in Android devices for
  8. communicating between the device and a computer during
  9. the bootloader stage. It allows the user to flash the
  10. device firmware and unlock the bootloader.
  11. More information about the protocol and usecases:
  12. https://android.googlesource.com/platform/system/core/+/refs/heads/master/fastboot/
  13. config USB_FUNCTION_FASTBOOT
  14. bool "Enable USB fastboot gadget"
  15. depends on USB_GADGET
  16. default y if ARCH_SUNXI && USB_MUSB_GADGET
  17. select FASTBOOT
  18. select USB_GADGET_DOWNLOAD
  19. help
  20. This enables the USB part of the fastboot gadget.
  21. config UDP_FUNCTION_FASTBOOT
  22. depends on NET
  23. select FASTBOOT
  24. bool "Enable fastboot protocol over UDP"
  25. help
  26. This enables the fastboot protocol over UDP.
  27. config UDP_FUNCTION_FASTBOOT_PORT
  28. depends on UDP_FUNCTION_FASTBOOT
  29. int "Define FASTBOOT UDP port"
  30. default 5554
  31. help
  32. The fastboot protocol requires a UDP port number.
  33. config TCP_FUNCTION_FASTBOOT
  34. depends on NET
  35. select FASTBOOT
  36. bool "Enable fastboot protocol over TCP"
  37. help
  38. This enables the fastboot protocol over TCP.
  39. if FASTBOOT
  40. config FASTBOOT_BUF_ADDR
  41. hex "Define FASTBOOT buffer address"
  42. default 0x82000000 if MX6SX || MX6SL || MX6UL || MX6SLL
  43. default 0x81000000 if ARCH_OMAP2PLUS
  44. default 0x42000000 if ARCH_SUNXI && !MACH_SUN9I
  45. default 0x22000000 if ARCH_SUNXI && MACH_SUN9I
  46. default 0x60800800 if ROCKCHIP_RK3036 || ROCKCHIP_RK3188 || \
  47. ROCKCHIP_RK322X
  48. default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \
  49. ROCKCHIP_RK3399
  50. default 0x280000 if ROCKCHIP_RK3368
  51. default 0x100000 if ARCH_ZYNQMP
  52. default 0 if SANDBOX
  53. help
  54. The fastboot protocol requires a large memory buffer for
  55. downloads. Define this to the starting RAM address to use for
  56. downloaded images.
  57. config FASTBOOT_BUF_SIZE
  58. hex "Define FASTBOOT buffer size"
  59. default 0x8000000 if ARCH_ROCKCHIP
  60. default 0x6000000 if ARCH_ZYNQMP
  61. default 0x2000000 if ARCH_SUNXI
  62. default 0x8192 if SANDBOX
  63. default 0x7000000
  64. help
  65. The fastboot protocol requires a large memory buffer for
  66. downloads. This buffer should be as large as possible for a
  67. platform. Define this to the size available RAM for fastboot.
  68. config FASTBOOT_USB_DEV
  69. int "USB controller number"
  70. depends on USB_FUNCTION_FASTBOOT
  71. default 0
  72. help
  73. Some boards have USB OTG controller other than 0. Define this
  74. option so it can be used in compiled environment (e.g. in
  75. CONFIG_BOOTCOMMAND).
  76. config FASTBOOT_FLASH
  77. bool "Enable FASTBOOT FLASH command"
  78. default y if ARCH_SUNXI || ARCH_ROCKCHIP
  79. depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
  80. select IMAGE_SPARSE
  81. help
  82. The fastboot protocol includes a "flash" command for writing
  83. the downloaded image to a non-volatile storage device. Define
  84. this to enable the "fastboot flash" command.
  85. config FASTBOOT_UUU_SUPPORT
  86. bool "Enable UUU support"
  87. help
  88. This extends the fastboot protocol with the "UCmd" and "ACmd"
  89. commands, which are used by NXP's "universal update utility" (UUU).
  90. These commands allow running any shell command. Do not enable this
  91. feature if you are using verified boot, as it will allow an attacker
  92. to bypass any restrictions you have in place.
  93. choice
  94. prompt "Flash provider for FASTBOOT"
  95. depends on FASTBOOT_FLASH
  96. config FASTBOOT_FLASH_MMC
  97. bool "FASTBOOT on MMC"
  98. depends on MMC
  99. config FASTBOOT_FLASH_NAND
  100. bool "FASTBOOT on NAND"
  101. depends on MTD_RAW_NAND && CMD_MTDPARTS
  102. endchoice
  103. config FASTBOOT_FLASH_MMC_DEV
  104. int "Define FASTBOOT MMC FLASH default device"
  105. depends on FASTBOOT_FLASH_MMC
  106. default 0 if ARCH_ROCKCHIP
  107. default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
  108. default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
  109. help
  110. The fastboot "flash" command requires additional information
  111. regarding the non-volatile storage device. Define this to
  112. the eMMC device that fastboot should use to store the image.
  113. config FASTBOOT_FLASH_NAND_TRIMFFS
  114. bool "Skip empty pages when flashing NAND"
  115. depends on FASTBOOT_FLASH_NAND
  116. help
  117. When flashing NAND enable the DROP_FFS flag to drop trailing all-0xff
  118. pages.
  119. config FASTBOOT_MMC_BOOT_SUPPORT
  120. bool "Enable EMMC_BOOT flash/erase"
  121. depends on FASTBOOT_FLASH_MMC
  122. help
  123. The fastboot "flash" and "erase" commands normally does operations
  124. on eMMC userdata. Define this to enable the special commands to
  125. flash/erase eMMC boot partition.
  126. The default target name for updating eMMC boot partition 1/2 is
  127. CONFIG_FASTBOOT_MMC_BOOT1_NAME/CONFIG_FASTBOOT_MMC_BOOT2_NAME.
  128. config FASTBOOT_MMC_BOOT1_NAME
  129. string "Target name for updating EMMC_BOOT1"
  130. depends on FASTBOOT_MMC_BOOT_SUPPORT
  131. default "mmc0boot0"
  132. help
  133. The fastboot "flash" and "erase" commands support operations on
  134. EMMC_BOOT1. This occurs when the specified "EMMC_BOOT1 name" on
  135. the "fastboot flash" and "fastboot erase" commands match the value
  136. defined here.
  137. The default target name for updating EMMC_BOOT1 is "mmc0boot0".
  138. config FASTBOOT_MMC_BOOT2_NAME
  139. string "Target name for updating EMMC_BOOT2"
  140. depends on FASTBOOT_MMC_BOOT_SUPPORT
  141. default "mmc0boot1"
  142. help
  143. The fastboot "flash" and "erase" commands support operations on
  144. EMMC_BOOT2. This occurs when the specified "EMMC_BOOT2 name" on
  145. the "fastboot flash" and "fastboot erase" commands match the value
  146. defined here.
  147. The default target name for updating EMMC_BOOT2 is "mmc0boot1".
  148. config FASTBOOT_MMC_USER_SUPPORT
  149. bool "Enable eMMC userdata partition flash/erase"
  150. depends on FASTBOOT_FLASH_MMC
  151. help
  152. Define this to enable the support "flash" and "erase" command on
  153. eMMC userdata. The "flash" command only update the MBR and GPT
  154. header when CONFIG_EFI_PARTITION is supported.
  155. The "erase" command erase all the userdata.
  156. This occurs when the specified "partition name" on the
  157. fastboot command line matches the value CONFIG_FASTBOOT_MMC_USER_NAME.
  158. config FASTBOOT_MMC_USER_NAME
  159. string "Target name for updating EMMC_USER"
  160. depends on FASTBOOT_MMC_USER_SUPPORT
  161. default "mmc0"
  162. help
  163. The fastboot "flash" and "erase" command supports EMMC_USER.
  164. This occurs when the specified "EMMC_USER name" on the
  165. "fastboot flash" and the "fastboot erase" commands match the value
  166. defined here.
  167. The default target name for erasing EMMC_USER is "mmc0".
  168. config FASTBOOT_GPT_NAME
  169. string "Target name for updating GPT"
  170. depends on FASTBOOT_FLASH_MMC && EFI_PARTITION
  171. default "gpt"
  172. help
  173. The fastboot "flash" command supports writing the downloaded
  174. image to the Protective MBR and the Primary GUID Partition
  175. Table. (Additionally, this downloaded image is post-processed
  176. to generate and write the Backup GUID Partition Table.)
  177. This occurs when the specified "partition name" on the
  178. "fastboot flash" command line matches the value defined here.
  179. The default target name for updating GPT is "gpt".
  180. config FASTBOOT_MBR_NAME
  181. string "Target name for updating MBR"
  182. depends on FASTBOOT_FLASH_MMC && DOS_PARTITION
  183. default "mbr"
  184. help
  185. The fastboot "flash" command allows to write the downloaded image
  186. to the Master Boot Record. This occurs when the "partition name"
  187. specified on the "fastboot flash" command line matches the value
  188. defined here. The default target name for updating MBR is "mbr".
  189. config FASTBOOT_CMD_OEM_FORMAT
  190. bool "Enable the 'oem format' command"
  191. depends on FASTBOOT_FLASH_MMC && CMD_GPT
  192. help
  193. Add support for the "oem format" command from a client. This
  194. relies on the env variable partitions to contain the list of
  195. partitions as required by the gpt command.
  196. config FASTBOOT_CMD_OEM_PARTCONF
  197. bool "Enable the 'oem partconf' command"
  198. depends on FASTBOOT_FLASH_MMC && SUPPORT_EMMC_BOOT
  199. help
  200. Add support for the "oem partconf" command from a client. This set
  201. the mmc boot-partition for the selecting eMMC device.
  202. config FASTBOOT_CMD_OEM_BOOTBUS
  203. bool "Enable the 'oem bootbus' command"
  204. depends on FASTBOOT_FLASH_MMC && SUPPORT_EMMC_BOOT
  205. help
  206. Add support for the "oem bootbus" command from a client. This set
  207. the mmc boot configuration for the selecting eMMC device.
  208. config FASTBOOT_OEM_RUN
  209. bool "Enable the 'oem run' command"
  210. help
  211. This extends the fastboot protocol with an "oem run" command. This
  212. command allows running arbitrary U-Boot shell commands. Do not enable
  213. this feature if you are using verified boot, as it will allow an
  214. attacker to bypass any restrictions you have in place.
  215. endif # FASTBOOT
  216. endmenu