[U-Boot] [RFC PATCH v2 01/20] fastboot: Move fastboot to drivers/fastboot

Alex Kiernan alex.kiernan at gmail.com
Mon Apr 30 08:32:35 UTC 2018


Separate CMD_FASTBOOT from FASTBOOT and move code and configuration to
drivers/fastboot.

Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---

Changes in v2: None

 cmd/Kconfig                                 | 14 ++++++++++++--
 common/Makefile                             | 13 -------------
 drivers/Kconfig                             |  2 ++
 drivers/Makefile                            |  1 +
 {cmd => drivers}/fastboot/Kconfig           | 12 ------------
 drivers/fastboot/Makefile                   | 10 ++++++++++
 {common => drivers/fastboot}/fb_mmc.c       |  0
 {common => drivers/fastboot}/fb_nand.c      |  0
 {common => drivers/fastboot}/image-sparse.c |  0
 9 files changed, 25 insertions(+), 27 deletions(-)
 rename {cmd => drivers}/fastboot/Kconfig (91%)
 create mode 100644 drivers/fastboot/Makefile
 rename {common => drivers/fastboot}/fb_mmc.c (100%)
 rename {common => drivers/fastboot}/fb_nand.c (100%)
 rename {common => drivers/fastboot}/image-sparse.c (100%)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 225bb00..15361ff 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -137,8 +137,6 @@ config AUTOBOOT_STOP_STR_SHA256
 
 endmenu
 
-source "cmd/fastboot/Kconfig"
-
 config BUILD_BIN2C
 	bool
 
@@ -642,6 +640,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
diff --git a/common/Makefile b/common/Makefile
index 7011dad..26f7fb1 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -111,19 +111,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
diff --git a/drivers/Kconfig b/drivers/Kconfig
index c2e813f..8424898 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -28,6 +28,8 @@ source "drivers/dfu/Kconfig"
 
 source "drivers/dma/Kconfig"
 
+source "drivers/fastboot/Kconfig"
+
 source "drivers/firmware/Kconfig"
 
 source "drivers/fpga/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 6846d18..78ec2f2 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -72,6 +72,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/
diff --git a/cmd/fastboot/Kconfig b/drivers/fastboot/Kconfig
similarity index 91%
rename from cmd/fastboot/Kconfig
rename to drivers/fastboot/Kconfig
index 0d2c2f1..45600d2 100644
--- a/cmd/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -1,5 +1,3 @@
-comment "FASTBOOT"
-
 menuconfig FASTBOOT
 	bool "Fastboot support"
 	depends on USB_GADGET
@@ -16,16 +14,6 @@ config USB_FUNCTION_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
 
 config FASTBOOT_BUF_ADDR
diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
new file mode 100644
index 0000000..63a67c1
--- /dev/null
+++ b/drivers/fastboot/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier:      GPL-2.0+
+
+obj-$(CONFIG_FASTBOOT_FLASH) += 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
diff --git a/common/fb_mmc.c b/drivers/fastboot/fb_mmc.c
similarity index 100%
rename from common/fb_mmc.c
rename to drivers/fastboot/fb_mmc.c
diff --git a/common/fb_nand.c b/drivers/fastboot/fb_nand.c
similarity index 100%
rename from common/fb_nand.c
rename to drivers/fastboot/fb_nand.c
diff --git a/common/image-sparse.c b/drivers/fastboot/image-sparse.c
similarity index 100%
rename from common/image-sparse.c
rename to drivers/fastboot/image-sparse.c
-- 
2.7.4



More information about the U-Boot mailing list