Skip to contentSkip to conversation

usb: USB download gadget and functions config options coherent naming

PATCH New Paul Kocialkowski 3 participants 11 messages Jun 12, 2015 – Jul 6, 2015

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 usb: USB download gadget and functions config options coherent naming

This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix.

---
 README                                    | 2 +-
 board/samsung/common/Makefile             | 2 +-
 board/siemens/common/factoryset.c         | 4 ++--
 doc/README.android-fastboot               | 2 +-
 drivers/dfu/Makefile                      | 2 +-
 drivers/usb/gadget/Makefile               | 8 ++++----
 include/configs/am335x_evm.h              | 4 ++--
 include/configs/am43xx_evm.h              | 4 ++--
 include/configs/bav335x.h                 | 6 +++---
 include/configs/colibri_vf.h              | 6 +++---
 include/configs/dra7xx_evm.h              | 4 ++--
 include/configs/exynos4-common.h          | 8 ++++----
 include/configs/gw_ventana.h              | 4 ++--
 include/configs/mx6sabre_common.h         | 4 ++--
 include/configs/nitrogen6x.h              | 4 ++--
 include/configs/odroid_xu3.h              | 8 ++++----
 include/configs/omap3_beagle.h            | 2 +-
 include/configs/s5p_goni.h                | 8 ++++----
 include/configs/siemens-am33x-common.h    | 4 ++--
 include/configs/socfpga_common.h          | 6 +++---
 include/configs/tbs2910.h                 | 4 ++--
 include/configs/tegra-common-usb-gadget.h | 6 +++---
 include/configs/warp.h                    | 6 +++---
 include/configs/zynq-common.h             | 6 +++---
 24 files changed, 57 insertions(+), 57 deletions(-)
README +1 -1
index 119bbc9..f404812 100644
@@ -1675,7 +1675,7 @@ The following options need to be configured:
 		key for the Replay Protection Memory Block partition in eMMC.
 
 - USB Device Firmware Update (DFU) class support:
-		CONFIG_DFU_FUNCTION
+		CONFIG_USB_FUNCTION_DFU
 		This enables the USB portion of the DFU USB class
 
 		CONFIG_CMD_DFU
board/samsung/common/Makefile +1 -1
index 93347ef..5fb01ce 100644
@@ -6,7 +6,7 @@
 #
 
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += gadget.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += gadget.o
 obj-$(CONFIG_MISC_COMMON) += misc.o
 
 ifndef CONFIG_SPL_BUILD
board/siemens/common/factoryset.c +2 -2
index d81f548..6c869ed 100644
@@ -144,7 +144,7 @@ int factoryset_read_eeprom(int i2c_addr)
 	unsigned char eeprom_buf[0x3c00], hdr[4], buf[MAX_STRING_LENGTH];
 	unsigned char *cp, *cp1;
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
 	factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
 #endif
@@ -202,7 +202,7 @@ int factoryset_read_eeprom(int i2c_addr)
 		cp1 += 3;
 	}
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	/* read vid and pid for dfu mode */
 	if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1",
 					(uchar *)"vid", buf,
doc/README.android-fastboot +1 -1
index 04411e9..c2a2418 100644
@@ -33,7 +33,7 @@ Board specific
 The fastboot gadget relies on the USB download gadget, so the following
 options must be configured:
 
-CONFIG_USBDOWNLOAD_GADGET
+CONFIG_USB_GADGET_DOWNLOAD
 CONFIG_G_DNL_VENDOR_NUM
 CONFIG_G_DNL_PRODUCT_NUM
 CONFIG_G_DNL_MANUFACTURER
drivers/dfu/Makefile +1 -1
index 5cc535e..cebea30 100644
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_DFU_FUNCTION) += dfu.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
 obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
 obj-$(CONFIG_DFU_NAND) += dfu_nand.o
 obj-$(CONFIG_DFU_RAM) += dfu_ram.o
drivers/usb/gadget/Makefile +4 -4
index 70bb550..46d7d94 100644
@@ -15,10 +15,10 @@ obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 obj-$(CONFIG_CI_UDC)	+= ci_udc.o
-obj-$(CONFIG_THOR_FUNCTION) += f_thor.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
-obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
-obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
+obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
+obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
 endif
 ifdef CONFIG_USB_ETHER
include/configs/am335x_evm.h +2 -2
index 8da3325..b94e4b5 100644
@@ -287,7 +287,7 @@
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -344,7 +344,7 @@
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
include/configs/am43xx_evm.h +2 -2
index d4f4c23..af39808 100644
@@ -118,7 +118,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
@@ -128,7 +128,7 @@
 
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/bav335x.h +3 -3
index 490c53e..7ce568b 100644
@@ -444,7 +444,7 @@ DEFAULT_LINUX_BOOT_ENV \
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -472,7 +472,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 #ifdef CONFIG_MUSB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* USB TI's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -494,7 +494,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
include/configs/colibri_vf.h +3 -3
index 4dec42a..2b064f9 100644
@@ -254,16 +254,16 @@
 #define CONFIG_G_DNL_PRODUCT_NUM         CONFIG_TRDX_PID_COLIBRI_VF50
 
 /* USB DFU */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
 
 /* USB Storage */
 #define CONFIG_USB_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 #endif /* __CONFIG_H */
include/configs/dra7xx_evm.h +2 -2
index 77edc21..1804cc0 100644
@@ -186,7 +186,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -194,7 +194,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/exynos4-common.h +4 -4
index f6b0a6f..09d7c96 100644
@@ -32,13 +32,13 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
@@ -61,7 +61,7 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* Common environment variables */
 #define CONFIG_EXTRA_ENV_ITB \
include/configs/gw_ventana.h +2 -2
index 6b8c82d..e3c2aa9 100644
@@ -208,8 +208,8 @@
 /* USB Mass Storage Gadget */
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 
 /* Netchip IDs */
include/configs/mx6sabre_common.h +2 -2
index c8c9f81..ffddeac 100644
@@ -218,8 +218,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
include/configs/nitrogen6x.h +2 -2
index beaa119..1c2eb47 100644
@@ -338,8 +338,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* Netchip IDs */
include/configs/odroid_xu3.h +4 -4
index cf17f3d..8d5c736 100644
@@ -60,10 +60,10 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x04E8
 #define CONFIG_G_DNL_PRODUCT_NUM	0x6601
 #define CONFIG_G_DNL_MANUFACTURER	"Samsung"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* DFU */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
@@ -72,13 +72,13 @@
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
 #define CONFIG_G_DNL_THOR_PRODUCT_NUM	0x685D
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 #define CONFIG_CMD_THOR_DOWNLOAD
 
 /* UMS */
 #define CONFIG_G_DNL_UMS_VENDOR_NUM	0x0525
 #define CONFIG_G_DNL_UMS_PRODUCT_NUM	0xA4A5
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 /* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
include/configs/omap3_beagle.h +1 -1
index 709528b..46c0680 100644
@@ -68,7 +68,7 @@
 #define CONFIG_USB_ETHER_RNDIS
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
 #define CONFIG_G_DNL_MANUFACTURER	"TI"
include/configs/s5p_goni.h +4 -4
index 16770f0..bac4362 100644
@@ -76,15 +76,15 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
 /* USB Samsung's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x04E8
@@ -283,7 +283,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 #define CONFIG_OF_LIBFDT
 
include/configs/siemens-am33x-common.h +2 -2
index f086e73..9b4be3f 100644
@@ -250,7 +250,7 @@
 #endif /* CONFIG_MUSB_GADGET */
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* USB DRACO ID as default */
 #define CONFIG_USBD_HS
@@ -259,7 +259,7 @@
 #define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
include/configs/socfpga_common.h +3 -3
index 5ba2f6a..53dc51d 100644
@@ -245,10 +245,10 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(32 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
include/configs/tbs2910.h +2 -2
index e1c9937..b702a06 100644
@@ -127,10 +127,10 @@
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
 #define CONFIG_USB_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER	"TBS"
include/configs/tegra-common-usb-gadget.h +3 -3
index 287460c..d70a4e7 100644
@@ -18,12 +18,12 @@
 #define CONFIG_G_DNL_VENDOR_NUM 0x0955
 #define CONFIG_G_DNL_PRODUCT_NUM 0x701A
 #define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 /* USB mass storage protocol */
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 /* DFU protocol */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
 #define CONFIG_CMD_DFU
 #ifdef CONFIG_MMC
include/configs/warp.h +3 -3
index e38b425..a152913 100644
@@ -82,8 +82,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
@@ -91,7 +91,7 @@
 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
 
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
include/configs/zynq-common.h +3 -3
index 1a52e7d..3c7eefd 100644
@@ -111,10 +111,10 @@
 # define CONFIG_CI_UDC           /* ChipIdea CI13xxx UDC */
 # define CONFIG_USB_GADGET
 # define CONFIG_USB_GADGET_DUALSPEED
-# define CONFIG_USBDOWNLOAD_GADGET
+# define CONFIG_USB_GADGET_DOWNLOAD
 # define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x600000
 # define DFU_DEFAULT_POLL_TIMEOUT	300
-# define CONFIG_DFU_FUNCTION
+# define CONFIG_USB_FUNCTION_DFU
 # define CONFIG_DFU_RAM
 # define CONFIG_USB_GADGET_VBUS_DRAW	2
 # define CONFIG_G_DNL_VENDOR_NUM	0x03FD
@@ -124,7 +124,7 @@
 # define CONFIG_USB_CABLE_CHECK
 # define CONFIG_CMD_DFU
 # define CONFIG_CMD_THOR_DOWNLOAD
-# define CONFIG_THOR_FUNCTION
+# define CONFIG_USB_FUNCTION_THOR
 # define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"set dfu_alt_info " \
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/4 usb: USB download gadget and functions config options coherent naming

Le vendredi 12 juin 2015 ? 19:56 +0200, Paul Kocialkowski a ?crit :

Quoted 4 lines

This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix.

Lukasz, does that series look good to you (now that there is Odroid XU3 support too)? Could this be merged soon?

Thanks!

Quoted 514 lines
---
 README                                    | 2 +-
 board/samsung/common/Makefile             | 2 +-
 board/siemens/common/factoryset.c         | 4 ++--
 doc/README.android-fastboot               | 2 +-
 drivers/dfu/Makefile                      | 2 +-
 drivers/usb/gadget/Makefile               | 8 ++++----
 include/configs/am335x_evm.h              | 4 ++--
 include/configs/am43xx_evm.h              | 4 ++--
 include/configs/bav335x.h                 | 6 +++---
 include/configs/colibri_vf.h              | 6 +++---
 include/configs/dra7xx_evm.h              | 4 ++--
 include/configs/exynos4-common.h          | 8 ++++----
 include/configs/gw_ventana.h              | 4 ++--
 include/configs/mx6sabre_common.h         | 4 ++--
 include/configs/nitrogen6x.h              | 4 ++--
 include/configs/odroid_xu3.h              | 8 ++++----
 include/configs/omap3_beagle.h            | 2 +-
 include/configs/s5p_goni.h                | 8 ++++----
 include/configs/siemens-am33x-common.h    | 4 ++--
 include/configs/socfpga_common.h          | 6 +++---
 include/configs/tbs2910.h                 | 4 ++--
 include/configs/tegra-common-usb-gadget.h | 6 +++---
 include/configs/warp.h                    | 6 +++---
 include/configs/zynq-common.h             | 6 +++---
 24 files changed, 57 insertions(+), 57 deletions(-)
README +1 -1
index 119bbc9..f404812 100644
@@ -1675,7 +1675,7 @@ The following options need to be configured:
 		key for the Replay Protection Memory Block partition in eMMC.
 
 - USB Device Firmware Update (DFU) class support:
-		CONFIG_DFU_FUNCTION
+		CONFIG_USB_FUNCTION_DFU
 		This enables the USB portion of the DFU USB class
 
 		CONFIG_CMD_DFU
board/samsung/common/Makefile +1 -1
index 93347ef..5fb01ce 100644
@@ -6,7 +6,7 @@
 #
 
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += gadget.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += gadget.o
 obj-$(CONFIG_MISC_COMMON) += misc.o
 
 ifndef CONFIG_SPL_BUILD
board/siemens/common/factoryset.c +2 -2
index d81f548..6c869ed 100644
@@ -144,7 +144,7 @@ int factoryset_read_eeprom(int i2c_addr)
 	unsigned char eeprom_buf[0x3c00], hdr[4], buf[MAX_STRING_LENGTH];
 	unsigned char *cp, *cp1;
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
 	factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
 #endif
@@ -202,7 +202,7 @@ int factoryset_read_eeprom(int i2c_addr)
 		cp1 += 3;
 	}
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	/* read vid and pid for dfu mode */
 	if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1",
 					(uchar *)"vid", buf,
doc/README.android-fastboot +1 -1
index 04411e9..c2a2418 100644
@@ -33,7 +33,7 @@ Board specific
 The fastboot gadget relies on the USB download gadget, so the following
 options must be configured:
 
-CONFIG_USBDOWNLOAD_GADGET
+CONFIG_USB_GADGET_DOWNLOAD
 CONFIG_G_DNL_VENDOR_NUM
 CONFIG_G_DNL_PRODUCT_NUM
 CONFIG_G_DNL_MANUFACTURER
drivers/dfu/Makefile +1 -1
index 5cc535e..cebea30 100644
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_DFU_FUNCTION) += dfu.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
 obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
 obj-$(CONFIG_DFU_NAND) += dfu_nand.o
 obj-$(CONFIG_DFU_RAM) += dfu_ram.o
drivers/usb/gadget/Makefile +4 -4
index 70bb550..46d7d94 100644
@@ -15,10 +15,10 @@ obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 obj-$(CONFIG_CI_UDC)	+= ci_udc.o
-obj-$(CONFIG_THOR_FUNCTION) += f_thor.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
-obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
-obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
+obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
+obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
 endif
 ifdef CONFIG_USB_ETHER
include/configs/am335x_evm.h +2 -2
index 8da3325..b94e4b5 100644
@@ -287,7 +287,7 @@
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -344,7 +344,7 @@
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
include/configs/am43xx_evm.h +2 -2
index d4f4c23..af39808 100644
@@ -118,7 +118,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
@@ -128,7 +128,7 @@
 
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/bav335x.h +3 -3
index 490c53e..7ce568b 100644
@@ -444,7 +444,7 @@ DEFAULT_LINUX_BOOT_ENV \
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -472,7 +472,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 #ifdef CONFIG_MUSB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* USB TI's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -494,7 +494,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
include/configs/colibri_vf.h +3 -3
index 4dec42a..2b064f9 100644
@@ -254,16 +254,16 @@
 #define CONFIG_G_DNL_PRODUCT_NUM         CONFIG_TRDX_PID_COLIBRI_VF50
 
 /* USB DFU */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
 
 /* USB Storage */
 #define CONFIG_USB_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 #endif /* __CONFIG_H */
include/configs/dra7xx_evm.h +2 -2
index 77edc21..1804cc0 100644
@@ -186,7 +186,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -194,7 +194,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/exynos4-common.h +4 -4
index f6b0a6f..09d7c96 100644
@@ -32,13 +32,13 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
@@ -61,7 +61,7 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* Common environment variables */
 #define CONFIG_EXTRA_ENV_ITB \
include/configs/gw_ventana.h +2 -2
index 6b8c82d..e3c2aa9 100644
@@ -208,8 +208,8 @@
 /* USB Mass Storage Gadget */
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 
 /* Netchip IDs */
include/configs/mx6sabre_common.h +2 -2
index c8c9f81..ffddeac 100644
@@ -218,8 +218,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
include/configs/nitrogen6x.h +2 -2
index beaa119..1c2eb47 100644
@@ -338,8 +338,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* Netchip IDs */
include/configs/odroid_xu3.h +4 -4
index cf17f3d..8d5c736 100644
@@ -60,10 +60,10 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x04E8
 #define CONFIG_G_DNL_PRODUCT_NUM	0x6601
 #define CONFIG_G_DNL_MANUFACTURER	"Samsung"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* DFU */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
@@ -72,13 +72,13 @@
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
 #define CONFIG_G_DNL_THOR_PRODUCT_NUM	0x685D
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 #define CONFIG_CMD_THOR_DOWNLOAD
 
 /* UMS */
 #define CONFIG_G_DNL_UMS_VENDOR_NUM	0x0525
 #define CONFIG_G_DNL_UMS_PRODUCT_NUM	0xA4A5
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 /* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
include/configs/omap3_beagle.h +1 -1
index 709528b..46c0680 100644
@@ -68,7 +68,7 @@
 #define CONFIG_USB_ETHER_RNDIS
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
 #define CONFIG_G_DNL_MANUFACTURER	"TI"
include/configs/s5p_goni.h +4 -4
index 16770f0..bac4362 100644
@@ -76,15 +76,15 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
 /* USB Samsung's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x04E8
@@ -283,7 +283,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 #define CONFIG_OF_LIBFDT
 
include/configs/siemens-am33x-common.h +2 -2
index f086e73..9b4be3f 100644
@@ -250,7 +250,7 @@
 #endif /* CONFIG_MUSB_GADGET */
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* USB DRACO ID as default */
 #define CONFIG_USBD_HS
@@ -259,7 +259,7 @@
 #define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
include/configs/socfpga_common.h +3 -3
index 5ba2f6a..53dc51d 100644
@@ -245,10 +245,10 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(32 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
include/configs/tbs2910.h +2 -2
index e1c9937..b702a06 100644
@@ -127,10 +127,10 @@
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
 #define CONFIG_USB_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER	"TBS"
include/configs/tegra-common-usb-gadget.h +3 -3
index 287460c..d70a4e7 100644
@@ -18,12 +18,12 @@
 #define CONFIG_G_DNL_VENDOR_NUM 0x0955
 #define CONFIG_G_DNL_PRODUCT_NUM 0x701A
 #define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 /* USB mass storage protocol */
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 /* DFU protocol */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
 #define CONFIG_CMD_DFU
 #ifdef CONFIG_MMC
include/configs/warp.h +3 -3
index e38b425..a152913 100644
@@ -82,8 +82,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
@@ -91,7 +91,7 @@
 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
 
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
include/configs/zynq-common.h +2 -2
index 1a52e7d..3c7eefd 100644
@@ -111,10 +111,10 @@
 # define CONFIG_CI_UDC           /* ChipIdea CI13xxx UDC */
 # define CONFIG_USB_GADGET
 # define CONFIG_USB_GADGET_DUALSPEED
-# define CONFIG_USBDOWNLOAD_GADGET
+# define CONFIG_USB_GADGET_DOWNLOAD
 # define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x600000
 # define DFU_DEFAULT_POLL_TIMEOUT	300
-# define CONFIG_DFU_FUNCTION
+# define CONFIG_USB_FUNCTION_DFU
 # define CONFIG_DFU_RAM
 # define CONFIG_USB_GADGET_VBUS_DRAW	2
 # define CONFIG_G_DNL_VENDOR_NUM	0x03FD

include/configs/zynq-common.h line 130

Quoted 8 lines
include/configs/zynq-common.h +1 -1
@@ -124,7 +124,7 @@
 # define CONFIG_USB_CABLE_CHECK
 # define CONFIG_CMD_DFU
 # define CONFIG_CMD_THOR_DOWNLOAD
-# define CONFIG_THOR_FUNCTION
+# define CONFIG_USB_FUNCTION_THOR
 # define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"set dfu_alt_info " \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150704/b56092ad/attachment.sig>

#2 lore raw

PATCH v2 1/4 usb: USB download gadget and functions config options coherent naming

Hi Paul,

Quoted 9 lines

Le vendredi 12 juin 2015 ? 19:56 +0200, Paul Kocialkowski a ?crit :

Quoted 5 lines

This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix.

Lukasz, does that series look good to you (now that there is Odroid XU3 support too)? Could this be merged soon?

I'm going to give it a test run. If no errors I will add it to u-boo-dfu tree.

Thanks for remainder.

Quoted 526 lines

Thanks!

Quoted 522 lines
---
 README                                    | 2 +-
 board/samsung/common/Makefile             | 2 +-
 board/siemens/common/factoryset.c         | 4 ++--
 doc/README.android-fastboot               | 2 +-
 drivers/dfu/Makefile                      | 2 +-
 drivers/usb/gadget/Makefile               | 8 ++++----
 include/configs/am335x_evm.h              | 4 ++--
 include/configs/am43xx_evm.h              | 4 ++--
 include/configs/bav335x.h                 | 6 +++---
 include/configs/colibri_vf.h              | 6 +++---
 include/configs/dra7xx_evm.h              | 4 ++--
 include/configs/exynos4-common.h          | 8 ++++----
 include/configs/gw_ventana.h              | 4 ++--
 include/configs/mx6sabre_common.h         | 4 ++--
 include/configs/nitrogen6x.h              | 4 ++--
 include/configs/odroid_xu3.h              | 8 ++++----
 include/configs/omap3_beagle.h            | 2 +-
 include/configs/s5p_goni.h                | 8 ++++----
 include/configs/siemens-am33x-common.h    | 4 ++--
 include/configs/socfpga_common.h          | 6 +++---
 include/configs/tbs2910.h                 | 4 ++--
 include/configs/tegra-common-usb-gadget.h | 6 +++---
 include/configs/warp.h                    | 6 +++---
 include/configs/zynq-common.h             | 6 +++---
 24 files changed, 57 insertions(+), 57 deletions(-)
README +0 -0
index 119bbc9..f404812 100644
@@ -1675,7 +1675,7 @@ The following options need to be configured:
 		key for the Replay Protection Memory Block

partition in eMMC.
- USB Device Firmware Update (DFU) class support:

README +1 -1
-		CONFIG_DFU_FUNCTION
+		CONFIG_USB_FUNCTION_DFU
 		This enables the USB portion of the DFU USB class
 
 		CONFIG_CMD_DFU
(quoted diff) +0 -0

b/board/samsung/common/Makefile index 93347ef..5fb01ce 100644

board/samsung/common/Makefile +1 -1
@@ -6,7 +6,7 @@
 #
 
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += gadget.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += gadget.o
 obj-$(CONFIG_MISC_COMMON) += misc.o
 
 ifndef CONFIG_SPL_BUILD
(quoted diff) +0 -0

b/board/siemens/common/factoryset.c index d81f548..6c869ed 100644

board/siemens/common/factoryset.c +2 -2
@@ -144,7 +144,7 @@ int factoryset_read_eeprom(int i2c_addr)
 	unsigned char eeprom_buf[0x3c00], hdr[4],
 buf[MAX_STRING_LENGTH]; unsigned char *cp, *cp1;
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
 	factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
 #endif
@@ -202,7 +202,7 @@ int factoryset_read_eeprom(int i2c_addr)
 		cp1 += 3;
 	}
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	/* read vid and pid for dfu mode */
 	if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1",
 					(uchar *)"vid", buf,
(quoted diff) +0 -0

b/doc/README.android-fastboot index 04411e9..c2a2418 100644

doc/README.android-fastboot +0 -0
@@ -33,7 +33,7 @@ Board specific
 The fastboot gadget relies on the USB download gadget, so the

following options must be configured:

doc/README.android-fastboot +1 -1
-CONFIG_USBDOWNLOAD_GADGET
+CONFIG_USB_GADGET_DOWNLOAD
 CONFIG_G_DNL_VENDOR_NUM
 CONFIG_G_DNL_PRODUCT_NUM
 CONFIG_G_DNL_MANUFACTURER
drivers/dfu/Makefile +1 -1
index 5cc535e..cebea30 100644
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_DFU_FUNCTION) += dfu.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
 obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
 obj-$(CONFIG_DFU_NAND) += dfu_nand.o
 obj-$(CONFIG_DFU_RAM) += dfu_ram.o
(quoted diff) +0 -0

b/drivers/usb/gadget/Makefile index 70bb550..46d7d94 100644

drivers/usb/gadget/Makefile +0 -0
@@ -15,10 +15,10 @@ obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) +=

s3c_udc_otg.o obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
obj-$(CONFIG_CI_UDC) += ci_udc.o

drivers/usb/gadget/Makefile +4 -4
-obj-$(CONFIG_THOR_FUNCTION) += f_thor.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
-obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
-obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
+obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
+obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
 endif
 ifdef CONFIG_USB_ETHER
(quoted diff) +0 -0

b/include/configs/am335x_evm.h index 8da3325..b94e4b5 100644

include/configs/am335x_evm.h +2 -2
@@ -287,7 +287,7 @@
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -344,7 +344,7 @@
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
(quoted diff) +0 -0

b/include/configs/am43xx_evm.h index d4f4c23..af39808 100644

include/configs/am43xx_evm.h +2 -2
@@ -118,7 +118,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
@@ -128,7 +128,7 @@
 
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/bav335x.h +3 -3
index 490c53e..7ce568b 100644
@@ -444,7 +444,7 @@ DEFAULT_LINUX_BOOT_ENV \
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -472,7 +472,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 #ifdef CONFIG_MUSB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* USB TI's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -494,7 +494,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
(quoted diff) +0 -0

b/include/configs/colibri_vf.h index 4dec42a..2b064f9 100644

include/configs/colibri_vf.h +0 -0
@@ -254,16 +254,16 @@
 #define CONFIG_G_DNL_PRODUCT_NUM

CONFIG_TRDX_PID_COLIBRI_VF50
/* USB DFU */

include/configs/colibri_vf.h +3 -3
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
 
 /* USB Storage */
 #define CONFIG_USB_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 #endif /* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/dra7xx_evm.h index 77edc21..1804cc0 100644

include/configs/dra7xx_evm.h +2 -2
@@ -186,7 +186,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -194,7 +194,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
(quoted diff) +0 -0

b/include/configs/exynos4-common.h index f6b0a6f..09d7c96 100644

include/configs/exynos4-common.h +4 -4
@@ -32,13 +32,13 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
@@ -61,7 +61,7 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* Common environment variables */
 #define CONFIG_EXTRA_ENV_ITB \
(quoted diff) +0 -0

b/include/configs/gw_ventana.h index 6b8c82d..e3c2aa9 100644

include/configs/gw_ventana.h +2 -2
@@ -208,8 +208,8 @@
 /* USB Mass Storage Gadget */
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 
 /* Netchip IDs */
(quoted diff) +0 -0

b/include/configs/mx6sabre_common.h index c8c9f81..ffddeac 100644

include/configs/mx6sabre_common.h +2 -2
@@ -218,8 +218,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
(quoted diff) +0 -0

b/include/configs/nitrogen6x.h index beaa119..1c2eb47 100644

include/configs/nitrogen6x.h +2 -2
@@ -338,8 +338,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* Netchip IDs */
(quoted diff) +0 -0

b/include/configs/odroid_xu3.h index cf17f3d..8d5c736 100644

include/configs/odroid_xu3.h +4 -4
@@ -60,10 +60,10 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x04E8
 #define CONFIG_G_DNL_PRODUCT_NUM	0x6601
 #define CONFIG_G_DNL_MANUFACTURER	"Samsung"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* DFU */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
@@ -72,13 +72,13 @@
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
 #define CONFIG_G_DNL_THOR_PRODUCT_NUM	0x685D
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 #define CONFIG_CMD_THOR_DOWNLOAD
 
 /* UMS */
 #define CONFIG_G_DNL_UMS_VENDOR_NUM	0x0525
 #define CONFIG_G_DNL_UMS_PRODUCT_NUM	0xA4A5
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 /* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
(quoted diff) +0 -0

b/include/configs/omap3_beagle.h index 709528b..46c0680 100644

include/configs/omap3_beagle.h +1 -1
@@ -68,7 +68,7 @@
 #define CONFIG_USB_ETHER_RNDIS
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
 #define CONFIG_G_DNL_MANUFACTURER	"TI"
include/configs/s5p_goni.h +4 -4
index 16770f0..bac4362 100644
@@ -76,15 +76,15 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
 /* USB Samsung's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x04E8
@@ -283,7 +283,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 #define CONFIG_OF_LIBFDT
 
(quoted diff) +0 -0

b/include/configs/siemens-am33x-common.h index f086e73..9b4be3f 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h

include/configs/siemens-am33x-common.h +2 -2
@@ -250,7 +250,7 @@
 #endif /* CONFIG_MUSB_GADGET */
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* USB DRACO ID as default */
 #define CONFIG_USBD_HS
@@ -259,7 +259,7 @@
 #define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
(quoted diff) +0 -0

b/include/configs/socfpga_common.h index 5ba2f6a..53dc51d 100644

include/configs/socfpga_common.h +0 -0
@@ -245,10 +245,10 @@ unsigned int

cm_get_qspi_controller_clk_hz(void); #define
CONFIG_USB_GADGET_VBUS_DRAW 2
/* USB Composite download gadget - g_dnl */

include/configs/socfpga_common.h +3 -3
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(32 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
include/configs/tbs2910.h +2 -2
index e1c9937..b702a06 100644
@@ -127,10 +127,10 @@
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
 #define CONFIG_USB_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER	"TBS"
(quoted diff) +0 -0

b/include/configs/tegra-common-usb-gadget.h index 287460c..d70a4e7 100644 --- a/include/configs/tegra-common-usb-gadget.h +++ b/include/configs/tegra-common-usb-gadget.h

include/configs/tegra-common-usb-gadget.h +3 -3
@@ -18,12 +18,12 @@
 #define CONFIG_G_DNL_VENDOR_NUM 0x0955
 #define CONFIG_G_DNL_PRODUCT_NUM 0x701A
 #define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 /* USB mass storage protocol */
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 /* DFU protocol */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
 #define CONFIG_CMD_DFU
 #ifdef CONFIG_MMC
include/configs/warp.h +3 -3
index e38b425..a152913 100644
@@ -82,8 +82,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
@@ -91,7 +91,7 @@
 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
 
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
(quoted diff) +0 -0

b/include/configs/zynq-common.h index 1a52e7d..3c7eefd 100644

include/configs/zynq-common.h +3 -3
@@ -111,10 +111,10 @@
 # define CONFIG_CI_UDC           /* ChipIdea CI13xxx UDC */
 # define CONFIG_USB_GADGET
 # define CONFIG_USB_GADGET_DUALSPEED
-# define CONFIG_USBDOWNLOAD_GADGET
+# define CONFIG_USB_GADGET_DOWNLOAD
 # define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x600000
 # define DFU_DEFAULT_POLL_TIMEOUT	300
-# define CONFIG_DFU_FUNCTION
+# define CONFIG_USB_FUNCTION_DFU
 # define CONFIG_DFU_RAM
 # define CONFIG_USB_GADGET_VBUS_DRAW	2
 # define CONFIG_G_DNL_VENDOR_NUM	0x03FD
@@ -124,7 +124,7 @@
 # define CONFIG_USB_CABLE_CHECK
 # define CONFIG_CMD_DFU
 # define CONFIG_CMD_THOR_DOWNLOAD
-# define CONFIG_THOR_FUNCTION
+# define CONFIG_USB_FUNCTION_THOR
 # define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"set dfu_alt_info " \
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#3 lore raw

PATCH v2 1/4 usb: USB download gadget and functions config options coherent naming

In reply to Paul Kocialkowski

Hi Paul,

Quoted 9 lines

Le vendredi 12 juin 2015 ? 19:56 +0200, Paul Kocialkowski a ?crit :

Quoted 5 lines

This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix.

Lukasz, does that series look good to you (now that there is Odroid XU3 support too)? Could this be merged soon?

All is OK. Thanks for your work. I've pushed your work to u-boot-dfu repository.

Quoted 526 lines

Thanks!

Quoted 522 lines
---
 README                                    | 2 +-
 board/samsung/common/Makefile             | 2 +-
 board/siemens/common/factoryset.c         | 4 ++--
 doc/README.android-fastboot               | 2 +-
 drivers/dfu/Makefile                      | 2 +-
 drivers/usb/gadget/Makefile               | 8 ++++----
 include/configs/am335x_evm.h              | 4 ++--
 include/configs/am43xx_evm.h              | 4 ++--
 include/configs/bav335x.h                 | 6 +++---
 include/configs/colibri_vf.h              | 6 +++---
 include/configs/dra7xx_evm.h              | 4 ++--
 include/configs/exynos4-common.h          | 8 ++++----
 include/configs/gw_ventana.h              | 4 ++--
 include/configs/mx6sabre_common.h         | 4 ++--
 include/configs/nitrogen6x.h              | 4 ++--
 include/configs/odroid_xu3.h              | 8 ++++----
 include/configs/omap3_beagle.h            | 2 +-
 include/configs/s5p_goni.h                | 8 ++++----
 include/configs/siemens-am33x-common.h    | 4 ++--
 include/configs/socfpga_common.h          | 6 +++---
 include/configs/tbs2910.h                 | 4 ++--
 include/configs/tegra-common-usb-gadget.h | 6 +++---
 include/configs/warp.h                    | 6 +++---
 include/configs/zynq-common.h             | 6 +++---
 24 files changed, 57 insertions(+), 57 deletions(-)
README +0 -0
index 119bbc9..f404812 100644
@@ -1675,7 +1675,7 @@ The following options need to be configured:
 		key for the Replay Protection Memory Block

partition in eMMC.
- USB Device Firmware Update (DFU) class support:

README +1 -1
-		CONFIG_DFU_FUNCTION
+		CONFIG_USB_FUNCTION_DFU
 		This enables the USB portion of the DFU USB class
 
 		CONFIG_CMD_DFU
(quoted diff) +0 -0

b/board/samsung/common/Makefile index 93347ef..5fb01ce 100644

board/samsung/common/Makefile +1 -1
@@ -6,7 +6,7 @@
 #
 
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += gadget.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += gadget.o
 obj-$(CONFIG_MISC_COMMON) += misc.o
 
 ifndef CONFIG_SPL_BUILD
(quoted diff) +0 -0

b/board/siemens/common/factoryset.c index d81f548..6c869ed 100644

board/siemens/common/factoryset.c +2 -2
@@ -144,7 +144,7 @@ int factoryset_read_eeprom(int i2c_addr)
 	unsigned char eeprom_buf[0x3c00], hdr[4],
 buf[MAX_STRING_LENGTH]; unsigned char *cp, *cp1;
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
 	factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
 #endif
@@ -202,7 +202,7 @@ int factoryset_read_eeprom(int i2c_addr)
 		cp1 += 3;
 	}
 
-#if defined(CONFIG_DFU_FUNCTION)
+#if defined(CONFIG_USB_FUNCTION_DFU)
 	/* read vid and pid for dfu mode */
 	if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1",
 					(uchar *)"vid", buf,
(quoted diff) +0 -0

b/doc/README.android-fastboot index 04411e9..c2a2418 100644

doc/README.android-fastboot +0 -0
@@ -33,7 +33,7 @@ Board specific
 The fastboot gadget relies on the USB download gadget, so the

following options must be configured:

doc/README.android-fastboot +1 -1
-CONFIG_USBDOWNLOAD_GADGET
+CONFIG_USB_GADGET_DOWNLOAD
 CONFIG_G_DNL_VENDOR_NUM
 CONFIG_G_DNL_PRODUCT_NUM
 CONFIG_G_DNL_MANUFACTURER
drivers/dfu/Makefile +1 -1
index 5cc535e..cebea30 100644
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_DFU_FUNCTION) += dfu.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
 obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
 obj-$(CONFIG_DFU_NAND) += dfu_nand.o
 obj-$(CONFIG_DFU_RAM) += dfu_ram.o
(quoted diff) +0 -0

b/drivers/usb/gadget/Makefile index 70bb550..46d7d94 100644

drivers/usb/gadget/Makefile +0 -0
@@ -15,10 +15,10 @@ obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) +=

s3c_udc_otg.o obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
obj-$(CONFIG_CI_UDC) += ci_udc.o

drivers/usb/gadget/Makefile +4 -4
-obj-$(CONFIG_THOR_FUNCTION) += f_thor.o
-obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
-obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
-obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
+obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
+obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
+obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
+obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
 endif
 ifdef CONFIG_USB_ETHER
(quoted diff) +0 -0

b/include/configs/am335x_evm.h index 8da3325..b94e4b5 100644

include/configs/am335x_evm.h +2 -2
@@ -287,7 +287,7 @@
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -344,7 +344,7 @@
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
(quoted diff) +0 -0

b/include/configs/am43xx_evm.h index d4f4c23..af39808 100644

include/configs/am43xx_evm.h +2 -2
@@ -118,7 +118,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
@@ -128,7 +128,7 @@
 
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
include/configs/bav335x.h +3 -3
index 490c53e..7ce568b 100644
@@ -444,7 +444,7 @@ DEFAULT_LINUX_BOOT_ENV \
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
@@ -472,7 +472,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 #ifdef CONFIG_MUSB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* USB TI's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -494,7 +494,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB Device Firmware Update support */
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
(quoted diff) +0 -0

b/include/configs/colibri_vf.h index 4dec42a..2b064f9 100644

include/configs/colibri_vf.h +0 -0
@@ -254,16 +254,16 @@
 #define CONFIG_G_DNL_PRODUCT_NUM

CONFIG_TRDX_PID_COLIBRI_VF50
/* USB DFU */

include/configs/colibri_vf.h +3 -3
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
 
 /* USB Storage */
 #define CONFIG_USB_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 #endif /* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/dra7xx_evm.h index 77edc21..1804cc0 100644

include/configs/dra7xx_evm.h +2 -2
@@ -186,7 +186,7 @@
 #define CONFIG_USB_DWC3_GADGET
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
@@ -194,7 +194,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_RAM
 #define CONFIG_CMD_DFU
 
(quoted diff) +0 -0

b/include/configs/exynos4-common.h index f6b0a6f..09d7c96 100644

include/configs/exynos4-common.h +4 -4
@@ -32,13 +32,13 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
@@ -61,7 +61,7 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 /* Common environment variables */
 #define CONFIG_EXTRA_ENV_ITB \
(quoted diff) +0 -0

b/include/configs/gw_ventana.h index 6b8c82d..e3c2aa9 100644

include/configs/gw_ventana.h +2 -2
@@ -208,8 +208,8 @@
 /* USB Mass Storage Gadget */
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 
 /* Netchip IDs */
(quoted diff) +0 -0

b/include/configs/mx6sabre_common.h index c8c9f81..ffddeac 100644

include/configs/mx6sabre_common.h +2 -2
@@ -218,8 +218,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
(quoted diff) +0 -0

b/include/configs/nitrogen6x.h index beaa119..1c2eb47 100644

include/configs/nitrogen6x.h +2 -2
@@ -338,8 +338,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 /* Netchip IDs */
(quoted diff) +0 -0

b/include/configs/odroid_xu3.h index cf17f3d..8d5c736 100644

include/configs/odroid_xu3.h +4 -4
@@ -60,10 +60,10 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x04E8
 #define CONFIG_G_DNL_PRODUCT_NUM	0x6601
 #define CONFIG_G_DNL_MANUFACTURER	"Samsung"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* DFU */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
@@ -72,13 +72,13 @@
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
 #define CONFIG_G_DNL_THOR_PRODUCT_NUM	0x685D
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 #define CONFIG_CMD_THOR_DOWNLOAD
 
 /* UMS */
 #define CONFIG_G_DNL_UMS_VENDOR_NUM	0x0525
 #define CONFIG_G_DNL_UMS_PRODUCT_NUM	0xA4A5
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
 /* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
(quoted diff) +0 -0

b/include/configs/omap3_beagle.h index 709528b..46c0680 100644

include/configs/omap3_beagle.h +1 -1
@@ -68,7 +68,7 @@
 #define CONFIG_USB_ETHER_RNDIS
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
 #define CONFIG_G_DNL_MANUFACTURER	"TI"
include/configs/s5p_goni.h +4 -4
index 16770f0..bac4362 100644
@@ -76,15 +76,15 @@
 #define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* TIZEN THOR downloader support */
 #define CONFIG_CMD_THOR_DOWNLOAD
-#define CONFIG_THOR_FUNCTION
+#define CONFIG_USB_FUNCTION_THOR
 
 /* USB Samsung's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x04E8
@@ -283,7 +283,7 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
 #define CONFIG_OF_LIBFDT
 
(quoted diff) +0 -0

b/include/configs/siemens-am33x-common.h index f086e73..9b4be3f 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h

include/configs/siemens-am33x-common.h +2 -2
@@ -250,7 +250,7 @@
 #endif /* CONFIG_MUSB_GADGET */
 
 #define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 
 /* USB DRACO ID as default */
 #define CONFIG_USBD_HS
@@ -259,7 +259,7 @@
 #define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
 
 /* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_NAND
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
(quoted diff) +0 -0

b/include/configs/socfpga_common.h index 5ba2f6a..53dc51d 100644

include/configs/socfpga_common.h +0 -0
@@ -245,10 +245,10 @@ unsigned int

cm_get_qspi_controller_clk_hz(void); #define
CONFIG_USB_GADGET_VBUS_DRAW 2
/* USB Composite download gadget - g_dnl */

include/configs/socfpga_common.h +3 -3
-#define CONFIG_USBDOWNLOAD_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE	(32 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
include/configs/tbs2910.h +2 -2
index e1c9937..b702a06 100644
@@ -127,10 +127,10 @@
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
 #define CONFIG_USB_GADGET
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	0
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER	"TBS"
(quoted diff) +0 -0

b/include/configs/tegra-common-usb-gadget.h index 287460c..d70a4e7 100644 --- a/include/configs/tegra-common-usb-gadget.h +++ b/include/configs/tegra-common-usb-gadget.h

include/configs/tegra-common-usb-gadget.h +3 -3
@@ -18,12 +18,12 @@
 #define CONFIG_G_DNL_VENDOR_NUM 0x0955
 #define CONFIG_G_DNL_PRODUCT_NUM 0x701A
 #define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
 /* USB mass storage protocol */
-#define CONFIG_USB_GADGET_MASS_STORAGE
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 /* DFU protocol */
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
 #define CONFIG_CMD_DFU
 #ifdef CONFIG_MMC
include/configs/warp.h +3 -3
index e38b425..a152913 100644
@@ -82,8 +82,8 @@
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
-#define CONFIG_USB_GADGET_MASS_STORAGE
-#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+#define CONFIG_USB_GADGET_DOWNLOAD
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 
 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
@@ -91,7 +91,7 @@
 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
 
 #define CONFIG_CMD_DFU
-#define CONFIG_DFU_FUNCTION
+#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_DFU_MMC
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
(quoted diff) +0 -0

b/include/configs/zynq-common.h index 1a52e7d..3c7eefd 100644

include/configs/zynq-common.h +3 -3
@@ -111,10 +111,10 @@
 # define CONFIG_CI_UDC           /* ChipIdea CI13xxx UDC */
 # define CONFIG_USB_GADGET
 # define CONFIG_USB_GADGET_DUALSPEED
-# define CONFIG_USBDOWNLOAD_GADGET
+# define CONFIG_USB_GADGET_DOWNLOAD
 # define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x600000
 # define DFU_DEFAULT_POLL_TIMEOUT	300
-# define CONFIG_DFU_FUNCTION
+# define CONFIG_USB_FUNCTION_DFU
 # define CONFIG_DFU_RAM
 # define CONFIG_USB_GADGET_VBUS_DRAW	2
 # define CONFIG_G_DNL_VENDOR_NUM	0x03FD
@@ -124,7 +124,7 @@
 # define CONFIG_USB_CABLE_CHECK
 # define CONFIG_CMD_DFU
 # define CONFIG_CMD_THOR_DOWNLOAD
-# define CONFIG_THOR_FUNCTION
+# define CONFIG_USB_FUNCTION_THOR
 # define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"set dfu_alt_info " \
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#4 lore raw

PATCH v2 2/4 usb: Fastboot function config for better consistency with other functions

In reply to Paul Kocialkowski

USB download gadget functions such as thor and dfu have a separate config option for the USB gadget part of the code, independent from the command part. This switches the fastboot USB gadget to the same scheme, for better consistency.

---
 README                                       | 3 +++
 arch/arm/cpu/armv7/omap-common/boot-common.c | 2 +-
 doc/README.android-fastboot                  | 4 ++--
 drivers/usb/gadget/Makefile                  | 2 +-
 include/configs/am335x_evm.h                 | 1 +
 include/configs/bav335x.h                    | 1 +
 include/configs/dra7xx_evm.h                 | 1 +
 include/configs/nitrogen6x.h                 | 1 +
 include/configs/omap3_beagle.h               | 1 +
 9 files changed, 12 insertions(+), 4 deletions(-)
README +3 -0
index f404812..2aa0cea 100644
@@ -1720,6 +1720,9 @@ The following options need to be configured:
 		sending again an USB request to the device.
 
 - USB Device Android Fastboot support:
+		CONFIG_USB_FUNCTION_FASTBOOT
+		This enables the USB part of the fastboot gadget
+
 		CONFIG_CMD_FASTBOOT
 		This enables the command "fastboot" which enables the Android
 		fastboot mode for the platform's USB device. Fastboot is a USB
arch/arm/cpu/armv7/omap-common/boot-common.c +1 -1
index bbc6bed..7fc0a56 100644
@@ -163,7 +163,7 @@ void arch_preboot_os(void)
 }
 #endif
 
-#if defined(CONFIG_CMD_FASTBOOT) && !defined(CONFIG_ENV_IS_NOWHERE)
+#if defined(CONFIG_USB_FUNCTION_FASTBOOT) && !defined(CONFIG_ENV_IS_NOWHERE)
 int fb_set_reboot_flag(void)
 {
 	printf("Setting reboot to fastboot flag ...\n");
doc/README.android-fastboot +2 -2
index c2a2418..92f2897 100644
@@ -42,8 +42,8 @@ NOTE: The CONFIG_G_DNL_VENDOR_NUM must be one of the numbers supported by
 the fastboot client. The list of vendor IDs supported can be found in the
 fastboot client source code (fastboot.c) mentioned above.
 
-The fastboot function is enabled by defining CONFIG_CMD_FASTBOOT and
-CONFIG_ANDROID_BOOT_IMAGE.
+The fastboot function is enabled by defining CONFIG_USB_FUNCTION_FASTBOOT,
+CONFIG_CMD_FASTBOOT and CONFIG_ANDROID_BOOT_IMAGE.
 
 The fastboot protocol requires a large memory buffer for downloads. This
 buffer should be as large as possible for a platform. The location of the
drivers/usb/gadget/Makefile +1 -1
index 46d7d94..4e15323 100644
@@ -19,7 +19,7 @@ obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
 obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
 obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
-obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
+obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
 endif
 ifdef CONFIG_USB_ETHER
 obj-y += ether.o
include/configs/am335x_evm.h +1 -0
index b94e4b5..8aa3fd7 100644
@@ -298,6 +298,7 @@
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 /* Fastboot */
+#define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_USB_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
include/configs/bav335x.h +1 -0
index 7ce568b..99e3a00 100644
@@ -455,6 +455,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 /* Fastboot */
+#define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_USB_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
include/configs/dra7xx_evm.h +1 -0
index 1804cc0..fc8de70 100644
@@ -85,6 +85,7 @@
 	DFU_ALT_INFO_RAM
 
 /* Fastboot */
+#define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
include/configs/nitrogen6x.h +1 -0
index 1c2eb47..191c0dd 100644
@@ -347,6 +347,7 @@
 #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER "Boundary"
 
+#define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_USB_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
include/configs/omap3_beagle.h +1 -0
index 46c0680..9089876 100644
@@ -72,6 +72,7 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
 #define CONFIG_G_DNL_MANUFACTURER	"TI"
+#define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_USB_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
Signature · 1 line
1.9.1
#5 lore raw

PATCH v2 3/4 usb: board_usb_init and board_usb_cleanup calls in the fastboot command

In reply to Paul Kocialkowski

Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new.

This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions.

---
 common/cmd_fastboot.c             | 31 +++++++++++++++++++++++++------
 include/configs/ti_omap5_common.h |  2 +-
 2 files changed, 26 insertions(+), 7 deletions(-)
common/cmd_fastboot.c +25 -6
index d52ccfb..86fbddf 100644
@@ -10,11 +10,26 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
+	int controller_index;
+	char *usb_controller;
 	int ret;
 
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	usb_controller = argv[1];
+	controller_index = simple_strtoul(usb_controller, NULL, 0);
+
+	ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+	if (ret) {
+		error("USB init failed: %d", ret);
+		return CMD_RET_FAILURE;
+	}
+
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
 	if (ret)
@@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	if (!g_dnl_board_usb_cable_connected()) {
 		puts("\rUSB cable not detected.\n" \
 		     "Command exit.\n");
-		g_dnl_unregister();
-		g_dnl_clear_detach();
-		return CMD_RET_FAILURE;
+		ret = CMD_RET_FAILURE;
+		goto exit;
 	}
 
 	while (1) {
@@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 		usb_gadget_handle_interrupts(0);
 	}
 
+	ret = CMD_RET_SUCCESS;
+
+exit:
 	g_dnl_unregister();
 	g_dnl_clear_detach();
-	return CMD_RET_SUCCESS;
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);
+
+	return ret;
 }
 
 U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot, 2, 1, do_fastboot,
 	"use USB Fastboot protocol",
-	"\n"
+	"<USB_controller>\n"
 	"    - run as a fastboot usb device"
 );
include/configs/ti_omap5_common.h +1 -1
index 4faffef..4fd5669 100644
@@ -137,7 +137,7 @@
 	"if test ${dofastboot} -eq 1; then " \
 		"echo Boot fastboot requested, resetting dofastboot ...;" \
 		"setenv dofastboot 0; saveenv;" \
-		"echo Booting into fastboot ...; fastboot;" \
+		"echo Booting into fastboot ...; fastboot 0;" \
 	"fi;" \
 	"run findfdt; " \
 	"run mmcboot;" \
Signature · 1 line
1.9.1
#6 lore raw

PATCH v2 3/4 usb: board_usb_init and board_usb_cleanup calls in the fastboot command

Hi Paul,

Quoted 24 lines · Paul Kocialkowski

Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new.

This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions.

---
  common/cmd_fastboot.c             | 31 +++++++++++++++++++++++++------
  include/configs/ti_omap5_common.h |  2 +-
  2 files changed, 26 insertions(+), 7 deletions(-)
common/cmd_fastboot.c +1 -0
index d52ccfb..86fbddf 100644
@@ -10,11 +10,26 @@
  #include <common.h>
  #include <command.h>
  #include <g_dnl.h>
+#include <usb.h>
 

common/cmd_fastboot.c line 24

Quoted 10 lines
common/cmd_fastboot.c +6 -0
  static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  {
+	int controller_index;
+	char *usb_controller;
  	int ret;
 
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	usb_controller = argv[1];

Not backwards compatible.... I would prefer to make it optional:

         if (argc < 2)
                 controller_index = 0;
         else {
                 usb_controller = argv[1];
                 controller_index = simple_strtoul(usb_controller, NULL, 0);
         }
Quoted 34 lines
common/cmd_fastboot.c +14 -4
+	controller_index = simple_strtoul(usb_controller, NULL, 0);
+
+	ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+	if (ret) {
+		error("USB init failed: %d", ret);
+		return CMD_RET_FAILURE;
+	}
+
  	g_dnl_clear_detach();
  	ret = g_dnl_register("usb_dnl_fastboot");
  	if (ret)
@@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  	if (!g_dnl_board_usb_cable_connected()) {
  		puts("\rUSB cable not detected.\n" \
  		     "Command exit.\n");
-		g_dnl_unregister();
-		g_dnl_clear_detach();
-		return CMD_RET_FAILURE;
+		ret = CMD_RET_FAILURE;
+		goto exit;
  	}
 
  	while (1) {
@@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  		usb_gadget_handle_interrupts(0);
  	}
 
+	ret = CMD_RET_SUCCESS;
+
+exit:
  	g_dnl_unregister();
  	g_dnl_clear_detach();
-	return CMD_RET_SUCCESS;
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) · line 66

Quoted 10 lines
common/cmd_fastboot.c +4 -2
+
+	return ret;
  }
 
  U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot, 2, 1, do_fastboot,
  	"use USB Fastboot protocol",
-	"\n"
+	"<USB_controller>\n"

make it optional:

	"[<USB_controller>]\n"

include/configs/ti_omap5_common.h line 140

Quoted 12 lines
common/cmd_fastboot.c +0 -0
  	"    - run as a fastboot usb device"
  );
include/configs/ti_omap5_common.h +1 -1
index 4faffef..4fd5669 100644
@@ -137,7 +137,7 @@
  	"if test ${dofastboot} -eq 1; then " \
  		"echo Boot fastboot requested, resetting dofastboot ...;" \
  		"setenv dofastboot 0; saveenv;" \
-		"echo Booting into fastboot ...; fastboot;" \
+		"echo Booting into fastboot ...; fastboot 0;" \

then this isn't needed either....

include/configs/ti_omap5_common.h line 143

Quoted 4 lines
include/configs/ti_omap5_common.h +0 -0
  	"fi;" \
  	"run findfdt; " \
  	"run mmcboot;" \

Thanks, Steve

#7 lore raw

PATCH v2 3/4 usb: board_usb_init and board_usb_cleanup calls in the fastboot command

Le mardi 16 juin 2015 ? 13:58 -0700, Steve Rae a ?crit :

Quoted 39 lines

Hi Paul,

Quoted 24 lines · Paul Kocialkowski

Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new.

This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions.

---
  common/cmd_fastboot.c             | 31 +++++++++++++++++++++++++------
  include/configs/ti_omap5_common.h |  2 +-
  2 files changed, 26 insertions(+), 7 deletions(-)
common/cmd_fastboot.c +1 -0
index d52ccfb..86fbddf 100644
@@ -10,11 +10,26 @@
  #include <common.h>
  #include <command.h>
  #include <g_dnl.h>
+#include <usb.h>
 

common/cmd_fastboot.c line 24

Quoted 10 lines
common/cmd_fastboot.c +6 -0
  static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  {
+	int controller_index;
+	char *usb_controller;
  	int ret;
 
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	usb_controller = argv[1];

Not backwards compatible.... I would prefer to make it optional:

Quoted 6 lines
         if (argc < 2)
                 controller_index = 0;
         else {
                 usb_controller = argv[1];
                 controller_index = simple_strtoul(usb_controller, NULL, 0);
         }

This is definitely a "bug fix". There is no reason to assume that the USB controller index is 0 and it was incorrect to assume that from the very beginning. Other download USB gadget commands had the controller index as a non-optional parameter already.

Since I fixed the configs that use it in U-Boot, I think it's fair enough. This may indeed break some hand-written scripts but those will be straightforward to fix.

I am strongly against keeping deprecated legacy fallbacks that make the code inconsistent and harder to maintain just for the sake of keeping backwards compatibility with users' hand-written scripts.

Quoted 63 lines
Quoted 34 lines
common/cmd_fastboot.c +14 -4
+	controller_index = simple_strtoul(usb_controller, NULL, 0);
+
+	ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+	if (ret) {
+		error("USB init failed: %d", ret);
+		return CMD_RET_FAILURE;
+	}
+
  	g_dnl_clear_detach();
  	ret = g_dnl_register("usb_dnl_fastboot");
  	if (ret)
@@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  	if (!g_dnl_board_usb_cable_connected()) {
  		puts("\rUSB cable not detected.\n" \
  		     "Command exit.\n");
-		g_dnl_unregister();
-		g_dnl_clear_detach();
-		return CMD_RET_FAILURE;
+		ret = CMD_RET_FAILURE;
+		goto exit;
  	}
 
  	while (1) {
@@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  		usb_gadget_handle_interrupts(0);
  	}
 
+	ret = CMD_RET_SUCCESS;
+
+exit:
  	g_dnl_unregister();
  	g_dnl_clear_detach();
-	return CMD_RET_SUCCESS;
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) · line 66

Quoted 10 lines
common/cmd_fastboot.c +4 -2
+
+	return ret;
  }
 
  U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot, 2, 1, do_fastboot,
  	"use USB Fastboot protocol",
-	"\n"
+	"<USB_controller>\n"

make it optional:

	"[<USB_controller>]\n"

include/configs/ti_omap5_common.h line 140

Quoted 12 lines
common/cmd_fastboot.c +0 -0
  	"    - run as a fastboot usb device"
  );
include/configs/ti_omap5_common.h +1 -1
index 4faffef..4fd5669 100644
@@ -137,7 +137,7 @@
  	"if test ${dofastboot} -eq 1; then " \
  		"echo Boot fastboot requested, resetting dofastboot ...;" \
  		"setenv dofastboot 0; saveenv;" \
-		"echo Booting into fastboot ...; fastboot;" \
+		"echo Booting into fastboot ...; fastboot 0;" \

then this isn't needed either....

Quoted 6 lines

include/configs/ti_omap5_common.h line 143

Quoted 4 lines
include/configs/ti_omap5_common.h +0 -0
  	"fi;" \
  	"run findfdt; " \
  	"run mmcboot;" \

Thanks, Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150616/d706b932/attachment.sig>

#8 lore raw

PATCH v2 3/4 usb: board_usb_init and board_usb_cleanup calls in the fastboot command

Quoted 52 lines · Paul Kocialkowski

Le mardi 16 juin 2015 ? 13:58 -0700, Steve Rae a ?crit :

Quoted 39 lines

Hi Paul,

Quoted 24 lines · Paul Kocialkowski

Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new.

This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions.

---
   common/cmd_fastboot.c             | 31 +++++++++++++++++++++++++------
   include/configs/ti_omap5_common.h |  2 +-
   2 files changed, 26 insertions(+), 7 deletions(-)
common/cmd_fastboot.c +1 -0
index d52ccfb..86fbddf 100644
@@ -10,11 +10,26 @@
   #include <common.h>
   #include <command.h>
   #include <g_dnl.h>
+#include <usb.h>
 

common/cmd_fastboot.c line 24

Quoted 10 lines
common/cmd_fastboot.c +6 -0
   static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   {
+	int controller_index;
+	char *usb_controller;
   	int ret;
 
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	usb_controller = argv[1];

Not backwards compatible.... I would prefer to make it optional:

Quoted 6 lines
          if (argc < 2)
                  controller_index = 0;
          else {
                  usb_controller = argv[1];
                  controller_index = simple_strtoul(usb_controller, NULL, 0);
          }

This is definitely a "bug fix". There is no reason to assume that the USB controller index is 0 and it was incorrect to assume that from the very beginning. Other download USB gadget commands had the controller index as a non-optional parameter already.

Quoted 8 lines

Since I fixed the configs that use it in U-Boot, I think it's fair enough. This may indeed break some hand-written scripts but those will be straightforward to fix.

I am strongly against keeping deprecated legacy fallbacks that make the code inconsistent and harder to maintain just for the sake of keeping backwards compatibility with users' hand-written scripts.

I understand, but I'm more worried about _all_ the existing documentation that states the the command line is "fastboot" (which now would need to be changed to "fastboot 0")

Quoted 70 lines
Quoted 69 lines
Quoted 34 lines
common/cmd_fastboot.c +14 -4
+	controller_index = simple_strtoul(usb_controller, NULL, 0);
+
+	ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+	if (ret) {
+		error("USB init failed: %d", ret);
+		return CMD_RET_FAILURE;
+	}
+
   	g_dnl_clear_detach();
   	ret = g_dnl_register("usb_dnl_fastboot");
   	if (ret)
@@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   	if (!g_dnl_board_usb_cable_connected()) {
   		puts("\rUSB cable not detected.\n" \
   		     "Command exit.\n");
-		g_dnl_unregister();
-		g_dnl_clear_detach();
-		return CMD_RET_FAILURE;
+		ret = CMD_RET_FAILURE;
+		goto exit;
   	}
 
   	while (1) {
@@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   		usb_gadget_handle_interrupts(0);
   	}
 
+	ret = CMD_RET_SUCCESS;
+
+exit:
   	g_dnl_unregister();
   	g_dnl_clear_detach();
-	return CMD_RET_SUCCESS;
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) · line 66

Quoted 10 lines
common/cmd_fastboot.c +4 -2
+
+	return ret;
   }
 
   U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot, 2, 1, do_fastboot,
   	"use USB Fastboot protocol",
-	"\n"
+	"<USB_controller>\n"

make it optional:

	"[<USB_controller>]\n"

include/configs/ti_omap5_common.h line 140

Quoted 12 lines
common/cmd_fastboot.c +0 -0
   	"    - run as a fastboot usb device"
   );
include/configs/ti_omap5_common.h +1 -1
index 4faffef..4fd5669 100644
@@ -137,7 +137,7 @@
   	"if test ${dofastboot} -eq 1; then " \
   		"echo Boot fastboot requested, resetting dofastboot ...;" \
   		"setenv dofastboot 0; saveenv;" \
-		"echo Booting into fastboot ...; fastboot;" \
+		"echo Booting into fastboot ...; fastboot 0;" \

then this isn't needed either....

include/configs/ti_omap5_common.h line 143

Quoted 4 lines
include/configs/ti_omap5_common.h +0 -0
   	"fi;" \
   	"run findfdt; " \
   	"run mmcboot;" \

Thanks, Steve

#9 lore raw

PATCH v2 3/4 usb: board_usb_init and board_usb_cleanup calls in the fastboot command

Le mardi 16 juin 2015 ? 14:36 -0700, Steve Rae a ?crit :

Quoted 58 lines · Paul Kocialkowski
Quoted 56 lines

Le mardi 16 juin 2015 ? 13:58 -0700, Steve Rae a ?crit :

Quoted 39 lines

Hi Paul,

Quoted 24 lines · Paul Kocialkowski

Each USB download function command calls board_usb_init before registering the USB gadget and board_usb_cleanup after de-registering it. On devices currently using fasboot, musb-new is usually initialized earlier, but some other boards might need the board_usb_init call to properly initialize musb-new.

This requires adding an argument (the USB controller index) to the fastboot command, as it is currently done with other USB download gadget functions.

---
   common/cmd_fastboot.c             | 31 +++++++++++++++++++++++++------
   include/configs/ti_omap5_common.h |  2 +-
   2 files changed, 26 insertions(+), 7 deletions(-)
common/cmd_fastboot.c +1 -0
index d52ccfb..86fbddf 100644
@@ -10,11 +10,26 @@
   #include <common.h>
   #include <command.h>
   #include <g_dnl.h>
+#include <usb.h>
 

common/cmd_fastboot.c line 24

Quoted 10 lines
common/cmd_fastboot.c +6 -0
   static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   {
+	int controller_index;
+	char *usb_controller;
   	int ret;
 
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	usb_controller = argv[1];

Not backwards compatible.... I would prefer to make it optional:

Quoted 6 lines
          if (argc < 2)
                  controller_index = 0;
          else {
                  usb_controller = argv[1];
                  controller_index = simple_strtoul(usb_controller, NULL, 0);
          }

This is definitely a "bug fix". There is no reason to assume that the USB controller index is 0 and it was incorrect to assume that from the very beginning. Other download USB gadget commands had the controller index as a non-optional parameter already.

Since I fixed the configs that use it in U-Boot, I think it's fair enough. This may indeed break some hand-written scripts but those will be straightforward to fix.

Quoted 8 lines
Quoted 4 lines

I am strongly against keeping deprecated legacy fallbacks that make the code inconsistent and harder to maintain just for the sake of keeping backwards compatibility with users' hand-written scripts.

I understand, but I'm more worried about _all_ the existing documentation that states the the command line is "fastboot" (which now would need to be changed to "fastboot 0")

Well, if I missed someplace in U-Boot where it is stated that only "fastboot" is sufficient to run the command, I should change that too.

Otherwise, for third party guides, the rationale is the same as previously stated.

Quoted 63 lines
Quoted 63 lines
Quoted 63 lines
Quoted 34 lines
common/cmd_fastboot.c +14 -4
+	controller_index = simple_strtoul(usb_controller, NULL, 0);
+
+	ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+	if (ret) {
+		error("USB init failed: %d", ret);
+		return CMD_RET_FAILURE;
+	}
+
   	g_dnl_clear_detach();
   	ret = g_dnl_register("usb_dnl_fastboot");
   	if (ret)
@@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   	if (!g_dnl_board_usb_cable_connected()) {
   		puts("\rUSB cable not detected.\n" \
   		     "Command exit.\n");
-		g_dnl_unregister();
-		g_dnl_clear_detach();
-		return CMD_RET_FAILURE;
+		ret = CMD_RET_FAILURE;
+		goto exit;
   	}
 
   	while (1) {
@@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
   		usb_gadget_handle_interrupts(0);
   	}
 
+	ret = CMD_RET_SUCCESS;
+
+exit:
   	g_dnl_unregister();
   	g_dnl_clear_detach();
-	return CMD_RET_SUCCESS;
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) · line 66

Quoted 10 lines
common/cmd_fastboot.c +4 -2
+
+	return ret;
   }
 
   U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot, 2, 1, do_fastboot,
   	"use USB Fastboot protocol",
-	"\n"
+	"<USB_controller>\n"

make it optional:

	"[<USB_controller>]\n"

include/configs/ti_omap5_common.h line 140

Quoted 12 lines
common/cmd_fastboot.c +0 -0
   	"    - run as a fastboot usb device"
   );
include/configs/ti_omap5_common.h +1 -1
index 4faffef..4fd5669 100644
@@ -137,7 +137,7 @@
   	"if test ${dofastboot} -eq 1; then " \
   		"echo Boot fastboot requested, resetting dofastboot ...;" \
   		"setenv dofastboot 0; saveenv;" \
-		"echo Booting into fastboot ...; fastboot;" \
+		"echo Booting into fastboot ...; fastboot 0;" \

then this isn't needed either....

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

include/configs/ti_omap5_common.h line 143

Quoted 4 lines
include/configs/ti_omap5_common.h +0 -0
   	"fi;" \
   	"run findfdt; " \
   	"run mmcboot;" \

Thanks, Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150616/09d3c841/attachment.sig>

#10 lore raw

PATCH v2 4/4 usb: gadget: Weak board_usb_init/cleanup definitions in USB download gadget code

In reply to Paul Kocialkowski

Weak versions of board_usb_init and board_usb_cleanup are defined in common USB host code, but it is also used for USB device gadgets, so we also need a weak definition of it when there is no USB host enabled.
Both weak definitions do not conflict.

---
 drivers/usb/gadget/g_dnl.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/usb/gadget/g_dnl.c +13 -0
index ee52a29..ad89a0d 100644
@@ -12,6 +12,7 @@
 
 #include <mmc.h>
 #include <part.h>
+#include <usb.h>
 
 #include <g_dnl.h>
 #include <usb_mass_storage.h>
@@ -148,6 +149,18 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)
 }
 
 __weak
+int board_usb_init(int index, enum usb_init_type init)
+{
+	return 0;
+}
+
+__weak
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+	return 0;
+}
+
+__weak
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
 	return 0;
Signature · 1 line
1.9.1