fastboot: Move fastboot to drivers/fastboot
authorAlex Kiernan <alex.kiernan@gmail.com>
Tue, 29 May 2018 15:30:39 +0000 (15:30 +0000)
committerMarek Vasut <marex@denx.de>
Wed, 30 May 2018 09:59:21 +0000 (11:59 +0200)
Separate CMD_FASTBOOT from FASTBOOT and move code and configuration to
drivers/fastboot.

Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT as anyone who wants
FASTBOOT before this series wants USB_FUNCTION_FASTBOOT. Split
USB_FUNCTION_FASTBOOT from FASTBOOT so they retain their existing
behaviour.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
47 files changed:
arch/arm/Kconfig
board/ti/common/Kconfig
cmd/Kconfig
common/Makefile
configs/am335x_boneblack_defconfig
configs/am335x_boneblack_vboot_defconfig
configs/am335x_evm_defconfig
configs/am335x_evm_nor_defconfig
configs/am335x_evm_norboot_defconfig
configs/am335x_evm_spiboot_defconfig
configs/am335x_evm_usbspl_defconfig
configs/am57xx_evm_defconfig
configs/am57xx_hs_evm_defconfig
configs/bcm23550_w1d_defconfig
configs/bcm28155_ap_defconfig
configs/birdland_bav335a_defconfig
configs/birdland_bav335b_defconfig
configs/cgtqmx6eval_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/imx6dl_mamoj_defconfig
configs/kc1_defconfig
configs/mx6qsabrelite_defconfig
configs/mx6sabresd_defconfig
configs/nitrogen6dl2g_defconfig
configs/nitrogen6dl_defconfig
configs/nitrogen6q2g_defconfig
configs/nitrogen6q_defconfig
configs/nitrogen6s1g_defconfig
configs/nitrogen6s_defconfig
configs/omap3_beagle_defconfig
configs/omap3_evm_defconfig
configs/omap3_logic_defconfig
configs/sniper_defconfig
configs/stih410-b2260_defconfig
configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
configs/xilinx_zynqmp_zcu102_rev1_0_defconfig
configs/xilinx_zynqmp_zcu102_revA_defconfig
configs/xilinx_zynqmp_zcu102_revB_defconfig
configs/xilinx_zynqmp_zcu106_revA_defconfig
drivers/Kconfig
drivers/Makefile
drivers/fastboot/Kconfig [moved from cmd/fastboot/Kconfig with 88% similarity]
drivers/fastboot/Makefile [new file with mode: 0644]
drivers/fastboot/fb_mmc.c [moved from common/fb_mmc.c with 100% similarity]
drivers/fastboot/fb_nand.c [moved from common/fb_nand.c with 100% similarity]

index 582e84c..dde422b 100644 (file)
@@ -1258,9 +1258,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
index c21eb8c..b1956b8 100644 (file)
@@ -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
index d532c9f..9848c06 100644 (file)
@@ -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 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 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
index d0681c7..9ec40b9 100644 (file)
@@ -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
index 5c01b20..bd3a374 100644 (file)
@@ -16,7 +16,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_CMD_SPL=y
index abbacdc..baaae36 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index 6732013..cc556d1 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 # CONFIG_CMD_FLASH is not set
index bbde07f..41a5c79 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 CONFIG_CMD_NAND=y
index 3ddcf64..75d0793 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=physmap-flash.0"
index 10eb0fe..b267887 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MTDPARTS=y
index dc9ac21..4401291 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_ETHER=y
 # CONFIG_SPL_YMODEM_SUPPORT is not set
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 # CONFIG_CMD_FLASH is not set
index 0e99268..3b83b69 100644 (file)
@@ -24,7 +24,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_USB_DEV=1
index 165c2a4..9c2aef4 100644 (file)
@@ -29,7 +29,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_USB_DEV=1
index 9a986ca..de4fa60 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x80000000
 CONFIG_FASTBOOT_BUF_SIZE=0x1D000000
 CONFIG_FASTBOOT_FLASH=y
index d26cde5..4f7a58e 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x80000000
 CONFIG_FASTBOOT_BUF_SIZE=0x7FF00000
 CONFIG_FASTBOOT_FLASH=y
index 51b3e6b..3efd566 100644 (file)
@@ -25,7 +25,7 @@ CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
index 29b223a..2f98116 100644 (file)
@@ -25,7 +25,7 @@ CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
index d4204aa..241e958 100644 (file)
@@ -24,7 +24,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CGT-QMX6-Quad U-Boot > "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_DFU=y
index 9b81b0c..b766ba2 100644 (file)
@@ -25,7 +25,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_FLASH=y
index 536946e..39a6801 100644 (file)
@@ -30,7 +30,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_FLASH=y
index 0001457..40a128b 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6dl-mamoj"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
index 534d604..ce71e37 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=2
 CONFIG_SYS_PROMPT="kc1 # "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2000000
 CONFIG_FASTBOOT_FLASH=y
index 966e823..a4740d4 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_BOOTDELAY=3
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
index ca37d8b..5c8e9de 100644 (file)
@@ -22,7 +22,7 @@ CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
index 6ef4226..cfb2ed8 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index b9784a2..9cb7ac2 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index 61688ba..e31521a 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index cfee7ba..85c352c 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index 0f29a56..1f37320 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index 7ad1584..0696f09 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
index 7b81b03..05dc737 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="BeagleBoard # "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x280000
index 20795c3..52285cc 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x280000
index 5a31e46..953980c 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP Logic # "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 # CONFIG_CMD_IMI is not set
 CONFIG_CMD_SPL=y
index ad22a1c..70e485f 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=2
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SYS_PROMPT="sniper # "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2000000
 CONFIG_FASTBOOT_FLASH=y
index 67391bd..7d990f9 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAS1,115200 CONSOLE=/dev/ttyAS1 consoleblank=0 root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait mem=992M@0x40000000 vmalloc=256m"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="stih410-b2260 => "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x40000000
 CONFIG_FASTBOOT_BUF_SIZE=0x3DF00000
 CONFIG_FASTBOOT_FLASH=y
index f5a3334..9e4886d 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_THOR_DOWNLOAD=y
index 7f7ee55..9d9216f 100644 (file)
@@ -20,7 +20,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
index 4cb3959..29743bd 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_THOR_DOWNLOAD=y
index e989d16..cc41182 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_THOR_DOWNLOAD=y
index bd67df9..ae791c3 100644 (file)
@@ -19,7 +19,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_THOR_DOWNLOAD=y
index a5fa33e..34e3c85 100644 (file)
@@ -18,7 +18,7 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_ATF=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_THOR_DOWNLOAD=y
index c2e813f..8424898 100644 (file)
@@ -28,6 +28,8 @@ source "drivers/dfu/Kconfig"
 
 source "drivers/dma/Kconfig"
 
+source "drivers/fastboot/Kconfig"
+
 source "drivers/firmware/Kconfig"
 
 source "drivers/fpga/Kconfig"
index b3f1b60..a79ff2e 100644 (file)
@@ -71,6 +71,9 @@ obj-y += block/
 obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
 obj-$(CONFIG_CPU) += cpu/
 obj-y += crypto/
+ifneq ($(CONFIG_FASTBOOT_FLASH_MMC_DEV)$(CONFIG_FASTBOOT_FLASH_NAND_DEV),)
+obj-y += fastboot/
+endif
 obj-y += firmware/
 obj-$(CONFIG_FPGA) += fpga/
 obj-y += misc/
similarity index 88%
rename from cmd/fastboot/Kconfig
rename to drivers/fastboot/Kconfig
index 0d2c2f1..93a8ac6 100644 (file)
@@ -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
diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
new file mode 100644 (file)
index 0000000..651fbf0
--- /dev/null
@@ -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