blob: d6e2be09cf72f68829d87ead00b30d6c587c0fc0 [file] [log] [blame]
Alex Kiernan65de9552018-05-29 15:30:39 +00001menu "Fastboot support"
Steve Rae437689f2016-08-15 17:26:26 -07002
Alex Kiernan65de9552018-05-29 15:30:39 +00003config FASTBOOT
4 bool
5 imply ANDROID_BOOT_IMAGE
6 imply CMD_FASTBOOT
Dmitrii Merkurev308252d2023-04-12 19:49:30 +01007 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 Rae437689f2016-08-15 17:26:26 -070014
Tom Rini5e384862024-04-10 20:00:32 -060015 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 Rae437689f2016-08-15 17:26:26 -070019config USB_FUNCTION_FASTBOOT
20 bool "Enable USB fastboot gadget"
Alex Kiernan65de9552018-05-29 15:30:39 +000021 depends on USB_GADGET
22 default y if ARCH_SUNXI && USB_MUSB_GADGET
23 select FASTBOOT
Maxime Ripard6d7dfe22017-09-07 10:29:51 +020024 select USB_GADGET_DOWNLOAD
Steve Rae437689f2016-08-15 17:26:26 -070025 help
26 This enables the USB part of the fastboot gadget.
27
Alex Kiernand5aa57c2018-05-29 15:30:53 +000028config 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 Gmeiner7fd97aa2022-01-13 08:40:06 +010035config 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 Merkurev308252d2023-04-12 19:49:30 +010042config 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 Kiernan65de9552018-05-29 15:30:39 +000049if FASTBOOT
Steve Rae437689f2016-08-15 17:26:26 -070050
51config FASTBOOT_BUF_ADDR
52 hex "Define FASTBOOT buffer address"
Tom Rinib5bf5622017-08-25 17:50:27 -040053 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 Rinif18679c2023-08-02 11:09:43 -040063 default 0x0 if SANDBOX
Steve Rae437689f2016-08-15 17:26:26 -070064 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
69config FASTBOOT_BUF_SIZE
70 hex "Define FASTBOOT buffer size"
Tom Rinib5bf5622017-08-25 17:50:27 -040071 default 0x8000000 if ARCH_ROCKCHIP
72 default 0x6000000 if ARCH_ZYNQMP
73 default 0x2000000 if ARCH_SUNXI
Jens Wiklanderf1edae92018-09-25 16:40:23 +020074 default 0x8192 if SANDBOX
Tom Rinib5bf5622017-08-25 17:50:27 -040075 default 0x7000000
Steve Rae437689f2016-08-15 17:26:26 -070076 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 Protsenko97bb3f82016-10-24 18:41:10 +030081config FASTBOOT_USB_DEV
82 int "USB controller number"
Alex Kiernan65de9552018-05-29 15:30:39 +000083 depends on USB_FUNCTION_FASTBOOT
Semen Protsenko97bb3f82016-10-24 18:41:10 +030084 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 Rae437689f2016-08-15 17:26:26 -070090config FASTBOOT_FLASH
91 bool "Enable FASTBOOT FLASH command"
Jagan Teki04aae032019-11-19 13:56:18 +053092 default y if ARCH_SUNXI || ARCH_ROCKCHIP
Miquel Raynald0935362019-10-03 19:50:03 +020093 depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
Alex Kiernanc568bcb2018-05-29 15:30:52 +000094 select IMAGE_SPARSE
Steve Rae437689f2016-08-15 17:26:26 -070095 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 Schocher3a994482021-02-10 09:29:03 +0100100config FASTBOOT_UUU_SUPPORT
Sean Anderson421bec02022-12-16 13:20:16 -0500101 bool "Enable UUU support"
Heiko Schocher3a994482021-02-10 09:29:03 +0100102 help
Sean Anderson421bec02022-12-16 13:20:16 -0500103 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 Schocher3a994482021-02-10 09:29:03 +0100108
Patrick Delaunay99a8e032017-12-07 18:26:17 +0100109choice
110 prompt "Flash provider for FASTBOOT"
111 depends on FASTBOOT_FLASH
112
113config FASTBOOT_FLASH_MMC
114 bool "FASTBOOT on MMC"
115 depends on MMC
116
117config FASTBOOT_FLASH_NAND
118 bool "FASTBOOT on NAND"
Miquel Raynald0935362019-10-03 19:50:03 +0200119 depends on MTD_RAW_NAND && CMD_MTDPARTS
Patrick Delaunay99a8e032017-12-07 18:26:17 +0100120
121endchoice
122
Steve Rae437689f2016-08-15 17:26:26 -0700123config FASTBOOT_FLASH_MMC_DEV
124 int "Define FASTBOOT MMC FLASH default device"
Patrick Delaunay99a8e032017-12-07 18:26:17 +0100125 depends on FASTBOOT_FLASH_MMC
Jagan Teki04aae032019-11-19 13:56:18 +0530126 default 0 if ARCH_ROCKCHIP
Maxime Ripard65cefba2017-08-23 10:12:22 +0200127 default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
128 default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
Steve Rae437689f2016-08-15 17:26:26 -0700129 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 Kiernandc405852018-05-29 15:30:51 +0000134config 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 Delaunay2579b0e2021-01-27 14:46:47 +0100141config FASTBOOT_MMC_BOOT_SUPPORT
142 bool "Enable EMMC_BOOT flash/erase"
143 depends on FASTBOOT_FLASH_MMC
developer6a105562020-01-16 16:11:42 +0800144 help
145 The fastboot "flash" and "erase" commands normally does operations
Patrick Delaunay2579b0e2021-01-27 14:46:47 +0100146 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.
developer6a105562020-01-16 16:11:42 +0800150
151config FASTBOOT_MMC_BOOT1_NAME
152 string "Target name for updating EMMC_BOOT1"
Patrick Delaunay2579b0e2021-01-27 14:46:47 +0100153 depends on FASTBOOT_MMC_BOOT_SUPPORT
developer6a105562020-01-16 16:11:42 +0800154 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 Delaunay2579b0e2021-01-27 14:46:47 +0100162config 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 Delaunay8b0a29a2021-01-27 14:46:46 +0100173config 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
developer6a105562020-01-16 16:11:42 +0800184config FASTBOOT_MMC_USER_NAME
Patrick Delaunay8b0a29a2021-01-27 14:46:46 +0100185 string "Target name for updating EMMC_USER"
186 depends on FASTBOOT_MMC_USER_SUPPORT
developer6a105562020-01-16 16:11:42 +0800187 default "mmc0"
188 help
Patrick Delaunay8b0a29a2021-01-27 14:46:46 +0100189 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.
developer6a105562020-01-16 16:11:42 +0800193 The default target name for erasing EMMC_USER is "mmc0".
194
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200195config FASTBOOT_GPT_NAME
196 string "Target name for updating GPT"
Alex Kiernan8cb1eab2018-05-29 15:30:42 +0000197 depends on FASTBOOT_FLASH_MMC && EFI_PARTITION
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200198 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
208config FASTBOOT_MBR_NAME
209 string "Target name for updating MBR"
Alex Kiernan8cb1eab2018-05-29 15:30:42 +0000210 depends on FASTBOOT_FLASH_MMC && DOS_PARTITION
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200211 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 Kiernanc86cde92018-05-29 15:30:54 +0000218config 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 Delaunay61687702021-01-27 14:46:48 +0100226config 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 Delaunay67af29a2021-01-27 14:46:49 +0100233config 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 Anderson421bec02022-12-16 13:20:16 -0500240config 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 Agorriae64262d2024-01-05 09:22:11 +0200248config 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. MORIN3d2561f2016-11-13 22:26:13 +0100255endif # FASTBOOT
Alex Kiernan65de9552018-05-29 15:30:39 +0000256
257endmenu