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