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