@@ -1246,9 +1246,7 @@ config ARCH_ROCKCHIP
select DM_REGULATOR
select ENABLE_ARM_SOC_BOOT0_HOOK
select SPI
- imply CMD_FASTBOOT
imply DISTRO_DEFAULTS
- imply FASTBOOT
imply FAT_WRITE
imply USB_FUNCTION_FASTBOOT
imply SPL_SYSRESET
@@ -25,7 +25,6 @@ config TI_COMMON_CMD_OPTIONS
imply CMD_EXT2
imply CMD_EXT4
imply CMD_EXT4_WRITE
- imply CMD_FASTBOOT if FASTBOOT
imply CMD_FAT
imply FAT_WRITE if CMD_FAT
imply CMD_FS_GENERIC
@@ -137,8 +137,6 @@ config AUTOBOOT_STOP_STR_SHA256
endmenu
-source "cmd/fastboot/Kconfig"
-
config BUILD_BIN2C
bool
@@ -650,6 +648,18 @@ config CMD_DM
can be useful to see the state of driver model for debugging or
interest.
+config CMD_FASTBOOT
+ bool "fastboot - Android fastboot support"
+ depends on USB_FUNCTION_FASTBOOT || UDP_FUNCTION_FASTBOOT
+ help
+ This enables the command "fastboot" which enables the Android
+ fastboot mode for the platform. Fastboot is a protocol for
+ downloading images, flashing and device control used on
+ Android devices. Fastboot requires either network stack
+ enabled or support for acting as a USB device.
+
+ See doc/README.android-fastboot for more information.
+
config CMD_FDC
bool "fdcboot - Boot from floppy device"
help
@@ -29,7 +29,7 @@ obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
-
+obj-$(CONFIG_FASTBOOT_FLASH) += image-sparse.o
obj-$(CONFIG_MII) += miiphyutil.o
obj-$(CONFIG_CMD_MII) += miiphyutil.o
obj-$(CONFIG_PHYLIB) += miiphyutil.o
@@ -109,19 +109,6 @@ obj-$(CONFIG_IO_TRACE) += iotrace.o
obj-y += memsize.o
obj-y += stdio.o
-ifndef CONFIG_SPL_BUILD
-# This option is not just y/n - it can have a numeric value
-ifdef CONFIG_FASTBOOT_FLASH
-obj-y += image-sparse.o
-ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
-obj-y += fb_mmc.o
-endif
-ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV
-obj-y += fb_nand.o
-endif
-endif
-endif
-
ifdef CONFIG_CMD_EEPROM_LAYOUT
obj-y += eeprom/eeprom_field.o eeprom/eeprom_layout.o
endif
@@ -28,6 +28,8 @@ source "drivers/dfu/Kconfig"
source "drivers/dma/Kconfig"
+source "drivers/fastboot/Kconfig"
+
source "drivers/firmware/Kconfig"
source "drivers/fpga/Kconfig"
@@ -71,6 +71,7 @@ obj-y += block/
obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
obj-$(CONFIG_CPU) += cpu/
obj-y += crypto/
+obj-$(CONFIG_FASTBOOT) += fastboot/
obj-y += firmware/
obj-$(CONFIG_FPGA) += fpga/
obj-y += misc/
similarity index 88%
rename from cmd/fastboot/Kconfig
rename to drivers/fastboot/Kconfig
@@ -1,32 +1,20 @@
-comment "FASTBOOT"
+menu "Fastboot support"
-menuconfig FASTBOOT
- bool "Fastboot support"
- depends on USB_GADGET
- default y if ARCH_SUNXI && USB_MUSB_GADGET
-
-if FASTBOOT
+config FASTBOOT
+ bool
+ imply ANDROID_BOOT_IMAGE
+ imply CMD_FASTBOOT
config USB_FUNCTION_FASTBOOT
bool "Enable USB fastboot gadget"
- default y
+ depends on USB_GADGET
+ default y if ARCH_SUNXI && USB_MUSB_GADGET
+ select FASTBOOT
select USB_GADGET_DOWNLOAD
- imply ANDROID_BOOT_IMAGE
- imply CMD_FASTBOOT
help
This enables the USB part of the fastboot gadget.
-config CMD_FASTBOOT
- bool "Enable FASTBOOT command"
- help
- This enables the command "fastboot" which enables the Android
- fastboot mode for the platform's USB device. Fastboot is a USB
- protocol for downloading images, flashing and device control
- used on Android devices.
-
- See doc/README.android-fastboot for more information.
-
-if USB_FUNCTION_FASTBOOT
+if FASTBOOT
config FASTBOOT_BUF_ADDR
hex "Define FASTBOOT buffer address"
@@ -58,6 +46,7 @@ config FASTBOOT_BUF_SIZE
config FASTBOOT_USB_DEV
int "USB controller number"
+ depends on USB_FUNCTION_FASTBOOT
default 0
help
Some boards have USB OTG controller other than 0. Define this
@@ -129,6 +118,6 @@ config FASTBOOT_MBR_NAME
specified on the "fastboot flash" command line matches the value
defined here. The default target name for updating MBR is "mbr".
-endif # USB_FUNCTION_FASTBOOT
-
endif # FASTBOOT
+
+endmenu
new file mode 100644
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
+obj-y += fb_mmc.o
+endif
+ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV
+obj-y += fb_nand.o
+endif
similarity index 100%
rename from common/fb_mmc.c
rename to drivers/fastboot/fb_mmc.c
similarity index 100%
rename from common/fb_nand.c
rename to drivers/fastboot/fb_nand.c