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