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