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