blob: b97c67bf6094fc3dce22e239c99caab15074123d [file] [log] [blame]
Alex Kiernan312a10f2018-05-29 15:30:39 +00001menu "Fastboot support"
Steve Raee016f0b2016-08-15 17:26:26 -07002
Alex Kiernan312a10f2018-05-29 15:30:39 +00003config FASTBOOT
4 bool
5 imply ANDROID_BOOT_IMAGE
6 imply CMD_FASTBOOT
Steve Raee016f0b2016-08-15 17:26:26 -07007
8config USB_FUNCTION_FASTBOOT
9 bool "Enable USB fastboot gadget"
Alex Kiernan312a10f2018-05-29 15:30:39 +000010 depends on USB_GADGET
11 default y if ARCH_SUNXI && USB_MUSB_GADGET
12 select FASTBOOT
Maxime Ripardcfa34992017-09-07 10:29:51 +020013 select USB_GADGET_DOWNLOAD
Steve Raee016f0b2016-08-15 17:26:26 -070014 help
15 This enables the USB part of the fastboot gadget.
16
Alex Kiernanf73a7df2018-05-29 15:30:53 +000017config 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 Gmeiner046bf8d2022-01-13 08:40:06 +010024config 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 Kiernan312a10f2018-05-29 15:30:39 +000031if FASTBOOT
Steve Raee016f0b2016-08-15 17:26:26 -070032
33config FASTBOOT_BUF_ADDR
34 hex "Define FASTBOOT buffer address"
Tom Rini48f62322017-08-25 17:50:27 -040035 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 Wiklander0a60a812018-09-25 16:40:23 +020045 default 0 if SANDBOX
Steve Raee016f0b2016-08-15 17:26:26 -070046 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
51config FASTBOOT_BUF_SIZE
52 hex "Define FASTBOOT buffer size"
Tom Rini48f62322017-08-25 17:50:27 -040053 default 0x8000000 if ARCH_ROCKCHIP
54 default 0x6000000 if ARCH_ZYNQMP
55 default 0x2000000 if ARCH_SUNXI
Jens Wiklander0a60a812018-09-25 16:40:23 +020056 default 0x8192 if SANDBOX
Tom Rini48f62322017-08-25 17:50:27 -040057 default 0x7000000
Steve Raee016f0b2016-08-15 17:26:26 -070058 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 Protsenko9af5ba82016-10-24 18:41:10 +030063config FASTBOOT_USB_DEV
64 int "USB controller number"
Alex Kiernan312a10f2018-05-29 15:30:39 +000065 depends on USB_FUNCTION_FASTBOOT
Semen Protsenko9af5ba82016-10-24 18:41:10 +030066 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 Raee016f0b2016-08-15 17:26:26 -070072config FASTBOOT_FLASH
73 bool "Enable FASTBOOT FLASH command"
Jagan Tekia9af59a2019-11-19 13:56:18 +053074 default y if ARCH_SUNXI || ARCH_ROCKCHIP
Miquel Raynal88718be2019-10-03 19:50:03 +020075 depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
Alex Kiernanc232d142018-05-29 15:30:52 +000076 select IMAGE_SPARSE
Steve Raee016f0b2016-08-15 17:26:26 -070077 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 Schocherbc820d52021-02-10 09:29:03 +010082config FASTBOOT_UUU_SUPPORT
83 bool "Enable FASTBOOT i.MX UUU special command"
Heiko Schocherbc820d52021-02-10 09:29:03 +010084 help
85 The fastboot protocol includes "UCmd" and "ACmd" command.
86 Be aware that you provide full access to any U-Boot command,
87 including working with memory and may open a huge backdoor,
88 when enabling this option.
89
Patrick Delaunayb0cce3f2017-12-07 18:26:17 +010090choice
91 prompt "Flash provider for FASTBOOT"
92 depends on FASTBOOT_FLASH
93
94config FASTBOOT_FLASH_MMC
95 bool "FASTBOOT on MMC"
96 depends on MMC
97
98config FASTBOOT_FLASH_NAND
99 bool "FASTBOOT on NAND"
Miquel Raynal88718be2019-10-03 19:50:03 +0200100 depends on MTD_RAW_NAND && CMD_MTDPARTS
Patrick Delaunayb0cce3f2017-12-07 18:26:17 +0100101
102endchoice
103
Steve Raee016f0b2016-08-15 17:26:26 -0700104config FASTBOOT_FLASH_MMC_DEV
105 int "Define FASTBOOT MMC FLASH default device"
Patrick Delaunayb0cce3f2017-12-07 18:26:17 +0100106 depends on FASTBOOT_FLASH_MMC
Jagan Tekia9af59a2019-11-19 13:56:18 +0530107 default 0 if ARCH_ROCKCHIP
Maxime Ripardde86fc32017-08-23 10:12:22 +0200108 default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
109 default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
Steve Raee016f0b2016-08-15 17:26:26 -0700110 help
111 The fastboot "flash" command requires additional information
112 regarding the non-volatile storage device. Define this to
113 the eMMC device that fastboot should use to store the image.
114
Alex Kiernan4085b902018-05-29 15:30:51 +0000115config FASTBOOT_FLASH_NAND_TRIMFFS
116 bool "Skip empty pages when flashing NAND"
117 depends on FASTBOOT_FLASH_NAND
118 help
119 When flashing NAND enable the DROP_FFS flag to drop trailing all-0xff
120 pages.
121
Patrick Delaunay3acbc7b2021-01-27 14:46:47 +0100122config FASTBOOT_MMC_BOOT_SUPPORT
123 bool "Enable EMMC_BOOT flash/erase"
124 depends on FASTBOOT_FLASH_MMC
mingming lee1fdbad02020-01-16 16:11:42 +0800125 help
126 The fastboot "flash" and "erase" commands normally does operations
Patrick Delaunay3acbc7b2021-01-27 14:46:47 +0100127 on eMMC userdata. Define this to enable the special commands to
128 flash/erase eMMC boot partition.
129 The default target name for updating eMMC boot partition 1/2 is
130 CONFIG_FASTBOOT_MMC_BOOT1_NAME/CONFIG_FASTBOOT_MMC_BOOT2_NAME.
mingming lee1fdbad02020-01-16 16:11:42 +0800131
132config FASTBOOT_MMC_BOOT1_NAME
133 string "Target name for updating EMMC_BOOT1"
Patrick Delaunay3acbc7b2021-01-27 14:46:47 +0100134 depends on FASTBOOT_MMC_BOOT_SUPPORT
mingming lee1fdbad02020-01-16 16:11:42 +0800135 default "mmc0boot0"
136 help
137 The fastboot "flash" and "erase" commands support operations on
138 EMMC_BOOT1. This occurs when the specified "EMMC_BOOT1 name" on
139 the "fastboot flash" and "fastboot erase" commands match the value
140 defined here.
141 The default target name for updating EMMC_BOOT1 is "mmc0boot0".
142
Patrick Delaunay3acbc7b2021-01-27 14:46:47 +0100143config FASTBOOT_MMC_BOOT2_NAME
144 string "Target name for updating EMMC_BOOT2"
145 depends on FASTBOOT_MMC_BOOT_SUPPORT
146 default "mmc0boot1"
147 help
148 The fastboot "flash" and "erase" commands support operations on
149 EMMC_BOOT2. This occurs when the specified "EMMC_BOOT2 name" on
150 the "fastboot flash" and "fastboot erase" commands match the value
151 defined here.
152 The default target name for updating EMMC_BOOT2 is "mmc0boot1".
153
Patrick Delaunay75966962021-01-27 14:46:46 +0100154config FASTBOOT_MMC_USER_SUPPORT
155 bool "Enable eMMC userdata partition flash/erase"
156 depends on FASTBOOT_FLASH_MMC
157 help
158 Define this to enable the support "flash" and "erase" command on
159 eMMC userdata. The "flash" command only update the MBR and GPT
160 header when CONFIG_EFI_PARTITION is supported.
161 The "erase" command erase all the userdata.
162 This occurs when the specified "partition name" on the
163 fastboot command line matches the value CONFIG_FASTBOOT_MMC_USER_NAME.
164
mingming lee1fdbad02020-01-16 16:11:42 +0800165config FASTBOOT_MMC_USER_NAME
Patrick Delaunay75966962021-01-27 14:46:46 +0100166 string "Target name for updating EMMC_USER"
167 depends on FASTBOOT_MMC_USER_SUPPORT
mingming lee1fdbad02020-01-16 16:11:42 +0800168 default "mmc0"
169 help
Patrick Delaunay75966962021-01-27 14:46:46 +0100170 The fastboot "flash" and "erase" command supports EMMC_USER.
171 This occurs when the specified "EMMC_USER name" on the
172 "fastboot flash" and the "fastboot erase" commands match the value
173 defined here.
mingming lee1fdbad02020-01-16 16:11:42 +0800174 The default target name for erasing EMMC_USER is "mmc0".
175
Petr Kulhavy6f6c8632016-09-09 10:27:18 +0200176config FASTBOOT_GPT_NAME
177 string "Target name for updating GPT"
Alex Kiernan42d8dd42018-05-29 15:30:42 +0000178 depends on FASTBOOT_FLASH_MMC && EFI_PARTITION
Petr Kulhavy6f6c8632016-09-09 10:27:18 +0200179 default "gpt"
180 help
181 The fastboot "flash" command supports writing the downloaded
182 image to the Protective MBR and the Primary GUID Partition
183 Table. (Additionally, this downloaded image is post-processed
184 to generate and write the Backup GUID Partition Table.)
185 This occurs when the specified "partition name" on the
186 "fastboot flash" command line matches the value defined here.
187 The default target name for updating GPT is "gpt".
188
189config FASTBOOT_MBR_NAME
190 string "Target name for updating MBR"
Alex Kiernan42d8dd42018-05-29 15:30:42 +0000191 depends on FASTBOOT_FLASH_MMC && DOS_PARTITION
Petr Kulhavy6f6c8632016-09-09 10:27:18 +0200192 default "mbr"
193 help
194 The fastboot "flash" command allows to write the downloaded image
195 to the Master Boot Record. This occurs when the "partition name"
196 specified on the "fastboot flash" command line matches the value
197 defined here. The default target name for updating MBR is "mbr".
198
Alex Kiernan3845b902018-05-29 15:30:54 +0000199config FASTBOOT_CMD_OEM_FORMAT
200 bool "Enable the 'oem format' command"
201 depends on FASTBOOT_FLASH_MMC && CMD_GPT
202 help
203 Add support for the "oem format" command from a client. This
204 relies on the env variable partitions to contain the list of
205 partitions as required by the gpt command.
206
Patrick Delaunayb2f6b972021-01-27 14:46:48 +0100207config FASTBOOT_CMD_OEM_PARTCONF
208 bool "Enable the 'oem partconf' command"
209 depends on FASTBOOT_FLASH_MMC && SUPPORT_EMMC_BOOT
210 help
211 Add support for the "oem partconf" command from a client. This set
212 the mmc boot-partition for the selecting eMMC device.
213
Patrick Delaunay0c0394b2021-01-27 14:46:49 +0100214config FASTBOOT_CMD_OEM_BOOTBUS
215 bool "Enable the 'oem bootbus' command"
216 depends on FASTBOOT_FLASH_MMC && SUPPORT_EMMC_BOOT
217 help
218 Add support for the "oem bootbus" command from a client. This set
219 the mmc boot configuration for the selecting eMMC device.
220
Yann E. MORINc2948732016-11-13 22:26:13 +0100221endif # FASTBOOT
Alex Kiernan312a10f2018-05-29 15:30:39 +0000222
223endmenu