blob: 45e07d05e017479a3e2705d3ed828dbf7a20344e [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
Steve Rae437689f2016-08-15 17:26:26 -07007
8config USB_FUNCTION_FASTBOOT
9 bool "Enable USB fastboot gadget"
Alex Kiernan65de9552018-05-29 15:30:39 +000010 depends on USB_GADGET
11 default y if ARCH_SUNXI && USB_MUSB_GADGET
12 select FASTBOOT
Maxime Ripard6d7dfe22017-09-07 10:29:51 +020013 select USB_GADGET_DOWNLOAD
Steve Rae437689f2016-08-15 17:26:26 -070014 help
15 This enables the USB part of the fastboot gadget.
16
Alex Kiernand5aa57c2018-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
Alex Kiernan65de9552018-05-29 15:30:39 +000024if FASTBOOT
Steve Rae437689f2016-08-15 17:26:26 -070025
26config FASTBOOT_BUF_ADDR
27 hex "Define FASTBOOT buffer address"
Tom Rinib5bf5622017-08-25 17:50:27 -040028 default 0x82000000 if MX6SX || MX6SL || MX6UL || MX6SLL
29 default 0x81000000 if ARCH_OMAP2PLUS
30 default 0x42000000 if ARCH_SUNXI && !MACH_SUN9I
31 default 0x22000000 if ARCH_SUNXI && MACH_SUN9I
32 default 0x60800800 if ROCKCHIP_RK3036 || ROCKCHIP_RK3188 || \
33 ROCKCHIP_RK322X
34 default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \
35 ROCKCHIP_RK3399
36 default 0x280000 if ROCKCHIP_RK3368
37 default 0x100000 if ARCH_ZYNQMP
Jens Wiklanderf1edae92018-09-25 16:40:23 +020038 default 0 if SANDBOX
Steve Rae437689f2016-08-15 17:26:26 -070039 help
40 The fastboot protocol requires a large memory buffer for
41 downloads. Define this to the starting RAM address to use for
42 downloaded images.
43
44config FASTBOOT_BUF_SIZE
45 hex "Define FASTBOOT buffer size"
Tom Rinib5bf5622017-08-25 17:50:27 -040046 default 0x8000000 if ARCH_ROCKCHIP
47 default 0x6000000 if ARCH_ZYNQMP
48 default 0x2000000 if ARCH_SUNXI
Jens Wiklanderf1edae92018-09-25 16:40:23 +020049 default 0x8192 if SANDBOX
Tom Rinib5bf5622017-08-25 17:50:27 -040050 default 0x7000000
Steve Rae437689f2016-08-15 17:26:26 -070051 help
52 The fastboot protocol requires a large memory buffer for
53 downloads. This buffer should be as large as possible for a
54 platform. Define this to the size available RAM for fastboot.
55
Semen Protsenko97bb3f82016-10-24 18:41:10 +030056config FASTBOOT_USB_DEV
57 int "USB controller number"
Alex Kiernan65de9552018-05-29 15:30:39 +000058 depends on USB_FUNCTION_FASTBOOT
Semen Protsenko97bb3f82016-10-24 18:41:10 +030059 default 0
60 help
61 Some boards have USB OTG controller other than 0. Define this
62 option so it can be used in compiled environment (e.g. in
63 CONFIG_BOOTCOMMAND).
64
Steve Rae437689f2016-08-15 17:26:26 -070065config FASTBOOT_FLASH
66 bool "Enable FASTBOOT FLASH command"
Jagan Teki04aae032019-11-19 13:56:18 +053067 default y if ARCH_SUNXI || ARCH_ROCKCHIP
Miquel Raynald0935362019-10-03 19:50:03 +020068 depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
Alex Kiernanc568bcb2018-05-29 15:30:52 +000069 select IMAGE_SPARSE
Steve Rae437689f2016-08-15 17:26:26 -070070 help
71 The fastboot protocol includes a "flash" command for writing
72 the downloaded image to a non-volatile storage device. Define
73 this to enable the "fastboot flash" command.
74
Patrick Delaunay99a8e032017-12-07 18:26:17 +010075choice
76 prompt "Flash provider for FASTBOOT"
77 depends on FASTBOOT_FLASH
78
79config FASTBOOT_FLASH_MMC
80 bool "FASTBOOT on MMC"
81 depends on MMC
82
83config FASTBOOT_FLASH_NAND
84 bool "FASTBOOT on NAND"
Miquel Raynald0935362019-10-03 19:50:03 +020085 depends on MTD_RAW_NAND && CMD_MTDPARTS
Patrick Delaunay99a8e032017-12-07 18:26:17 +010086
87endchoice
88
Steve Rae437689f2016-08-15 17:26:26 -070089config FASTBOOT_FLASH_MMC_DEV
90 int "Define FASTBOOT MMC FLASH default device"
Patrick Delaunay99a8e032017-12-07 18:26:17 +010091 depends on FASTBOOT_FLASH_MMC
Jagan Teki04aae032019-11-19 13:56:18 +053092 default 0 if ARCH_ROCKCHIP
Maxime Ripard65cefba2017-08-23 10:12:22 +020093 default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
94 default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
Steve Rae437689f2016-08-15 17:26:26 -070095 help
96 The fastboot "flash" command requires additional information
97 regarding the non-volatile storage device. Define this to
98 the eMMC device that fastboot should use to store the image.
99
Alex Kiernandc405852018-05-29 15:30:51 +0000100config FASTBOOT_FLASH_NAND_TRIMFFS
101 bool "Skip empty pages when flashing NAND"
102 depends on FASTBOOT_FLASH_NAND
103 help
104 When flashing NAND enable the DROP_FFS flag to drop trailing all-0xff
105 pages.
106
developer6a105562020-01-16 16:11:42 +0800107config FASTBOOT_MMC_BOOT1_SUPPORT
108 bool "Enable EMMC_BOOT1 flash/erase"
109 depends on FASTBOOT_FLASH_MMC && EFI_PARTITION && ARCH_MEDIATEK
110 help
111 The fastboot "flash" and "erase" commands normally does operations
112 on EMMC userdata. Define this to enable the special commands to
113 flash/erase EMMC_BOOT1.
114 The default target name for updating EMMC_BOOT1 is "mmc0boot0".
115
116config FASTBOOT_MMC_BOOT1_NAME
117 string "Target name for updating EMMC_BOOT1"
118 depends on FASTBOOT_MMC_BOOT1_SUPPORT
119 default "mmc0boot0"
120 help
121 The fastboot "flash" and "erase" commands support operations on
122 EMMC_BOOT1. This occurs when the specified "EMMC_BOOT1 name" on
123 the "fastboot flash" and "fastboot erase" commands match the value
124 defined here.
125 The default target name for updating EMMC_BOOT1 is "mmc0boot0".
126
Patrick Delaunay8b0a29a2021-01-27 14:46:46 +0100127config FASTBOOT_MMC_USER_SUPPORT
128 bool "Enable eMMC userdata partition flash/erase"
129 depends on FASTBOOT_FLASH_MMC
130 help
131 Define this to enable the support "flash" and "erase" command on
132 eMMC userdata. The "flash" command only update the MBR and GPT
133 header when CONFIG_EFI_PARTITION is supported.
134 The "erase" command erase all the userdata.
135 This occurs when the specified "partition name" on the
136 fastboot command line matches the value CONFIG_FASTBOOT_MMC_USER_NAME.
137
developer6a105562020-01-16 16:11:42 +0800138config FASTBOOT_MMC_USER_NAME
Patrick Delaunay8b0a29a2021-01-27 14:46:46 +0100139 string "Target name for updating EMMC_USER"
140 depends on FASTBOOT_MMC_USER_SUPPORT
developer6a105562020-01-16 16:11:42 +0800141 default "mmc0"
142 help
Patrick Delaunay8b0a29a2021-01-27 14:46:46 +0100143 The fastboot "flash" and "erase" command supports EMMC_USER.
144 This occurs when the specified "EMMC_USER name" on the
145 "fastboot flash" and the "fastboot erase" commands match the value
146 defined here.
developer6a105562020-01-16 16:11:42 +0800147 The default target name for erasing EMMC_USER is "mmc0".
148
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200149config FASTBOOT_GPT_NAME
150 string "Target name for updating GPT"
Alex Kiernan8cb1eab2018-05-29 15:30:42 +0000151 depends on FASTBOOT_FLASH_MMC && EFI_PARTITION
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200152 default "gpt"
153 help
154 The fastboot "flash" command supports writing the downloaded
155 image to the Protective MBR and the Primary GUID Partition
156 Table. (Additionally, this downloaded image is post-processed
157 to generate and write the Backup GUID Partition Table.)
158 This occurs when the specified "partition name" on the
159 "fastboot flash" command line matches the value defined here.
160 The default target name for updating GPT is "gpt".
161
162config FASTBOOT_MBR_NAME
163 string "Target name for updating MBR"
Alex Kiernan8cb1eab2018-05-29 15:30:42 +0000164 depends on FASTBOOT_FLASH_MMC && DOS_PARTITION
Petr Kulhavy4ed1eca2016-09-09 10:27:18 +0200165 default "mbr"
166 help
167 The fastboot "flash" command allows to write the downloaded image
168 to the Master Boot Record. This occurs when the "partition name"
169 specified on the "fastboot flash" command line matches the value
170 defined here. The default target name for updating MBR is "mbr".
171
Alex Kiernanc86cde92018-05-29 15:30:54 +0000172config FASTBOOT_CMD_OEM_FORMAT
173 bool "Enable the 'oem format' command"
174 depends on FASTBOOT_FLASH_MMC && CMD_GPT
175 help
176 Add support for the "oem format" command from a client. This
177 relies on the env variable partitions to contain the list of
178 partitions as required by the gpt command.
179
Yann E. MORIN3d2561f2016-11-13 22:26:13 +0100180endif # FASTBOOT
Alex Kiernan65de9552018-05-29 15:30:39 +0000181
182endmenu