From 01acd6abbdd5a5951f68d08c245550c720ea6ad8 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 12 Jun 2015 19:56:58 +0200 Subject: 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. Signed-off-by: Paul Kocialkowski Tested-by: Lukasz Majewski Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210) --- doc/README.android-fastboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot index 04411e98bc..c2a2418a0f 100644 --- a/doc/README.android-fastboot +++ b/doc/README.android-fastboot @@ -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 -- cgit v1.2.3 From 17da3c0c8cad2a40903c078d178cd663d73ccc7c Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 12 Jun 2015 19:56:59 +0200 Subject: usb: Fastboot function config for better consistency with other functions 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. Signed-off-by: Paul Kocialkowski Tested-by: Lukasz Majewski Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210) --- 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(-) (limited to 'doc') diff --git a/README b/README index c13a38339b..1e04cf8dcc 100644 --- a/README +++ b/README @@ -1716,6 +1716,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 diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c index bbc6bed7ca..7fc0a561b7 100644 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c @@ -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"); diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot index c2a2418a0f..92f2897999 100644 --- a/doc/README.android-fastboot +++ b/doc/README.android-fastboot @@ -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 diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 46d7d945dd..4e15323131 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -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 diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 7fd8cf7d8f..abcdfda6ac 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -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 diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h index b53c49e5e4..31b75f216e 100644 --- a/include/configs/bav335x.h +++ b/include/configs/bav335x.h @@ -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 diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index b9699442fb..62330bf6e4 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -89,6 +89,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 diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h index 231da72c10..47239b1016 100644 --- a/include/configs/nitrogen6x.h +++ b/include/configs/nitrogen6x.h @@ -346,6 +346,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 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 8ebb5bd2a3..59c780ed01 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -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 -- cgit v1.2.3 From a588d99ac19fe09818c6c874bec273012699d82a Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 20 Jul 2015 12:38:22 +0200 Subject: usb: CONFIG_USB_FASTBOOT prefix replacement for consistency FASTBOOT is defined both by CONFIG_USB_FUNCTION_FASTBOOT AND CONFIG_CMD_FASTBOOT, so it doesn't make much sense to have a CONFIG_USB_FASTBOOT prefix for fastboot-specific options, especially given that other config options for fastboot use the CONFIG_FASTBOOT prefix. This replaces the CONFIG_USB_FASTBOOT prefix with CONFIG_FASTBOOT, for consistency. Signed-off-by: Paul Kocialkowski --- README | 4 ++-- doc/README.android-fastboot | 4 ++-- drivers/usb/gadget/f_fastboot.c | 8 ++++---- include/configs/am335x_evm.h | 4 ++-- include/configs/bav335x.h | 4 ++-- include/configs/bcm28155_ap.h | 4 ++-- include/configs/dra7xx_evm.h | 4 ++-- include/configs/nitrogen6x.h | 4 ++-- include/configs/omap3_beagle.h | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) (limited to 'doc') diff --git a/README b/README index 1e04cf8dcc..4e0ff9f74e 100644 --- a/README +++ b/README @@ -1730,12 +1730,12 @@ The following options need to be configured: This enables support for booting images which use the Android image format header. - CONFIG_USB_FASTBOOT_BUF_ADDR + CONFIG_FASTBOOT_BUF_ADDR The fastboot protocol requires a large memory buffer for downloads. Define this to the starting RAM address to use for downloaded images. - CONFIG_USB_FASTBOOT_BUF_SIZE + CONFIG_FASTBOOT_BUF_SIZE The fastboot protocol requires a large memory buffer for downloads. This buffer should be as large as possible for a platform. Define this to the size available RAM for fastboot. diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot index 92f2897999..ce12bc594f 100644 --- a/doc/README.android-fastboot +++ b/doc/README.android-fastboot @@ -47,8 +47,8 @@ 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 -buffer and size are set with CONFIG_USB_FASTBOOT_BUF_ADDR and -CONFIG_USB_FASTBOOT_BUF_SIZE. +buffer and size are set with CONFIG_FASTBOOT_BUF_ADDR and +CONFIG_FASTBOOT_BUF_SIZE. Fastboot partition aliases can also be defined for devices where GPT limitations prevent user-friendly partition names such as "boot", "system" diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 60c846da91..ca01a018b5 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -380,7 +380,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req) !strcmp_l1("max-download-size", cmd)) { char str_num[12]; - sprintf(str_num, "0x%08x", CONFIG_USB_FASTBOOT_BUF_SIZE); + sprintf(str_num, "0x%08x", CONFIG_FASTBOOT_BUF_SIZE); strncat(response, str_num, chars_left); } else if (!strcmp_l1("serialno", cmd)) { s = getenv("serial#"); @@ -430,7 +430,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req) if (buffer_size < transfer_size) transfer_size = buffer_size; - memcpy((void *)CONFIG_USB_FASTBOOT_BUF_ADDR + download_bytes, + memcpy((void *)CONFIG_FASTBOOT_BUF_ADDR + download_bytes, buffer, transfer_size); pre_dot_num = download_bytes / BYTES_PER_DOT; @@ -483,7 +483,7 @@ static void cb_download(struct usb_ep *ep, struct usb_request *req) if (0 == download_size) { sprintf(response, "FAILdata invalid size"); - } else if (download_size > CONFIG_USB_FASTBOOT_BUF_SIZE) { + } else if (download_size > CONFIG_FASTBOOT_BUF_SIZE) { download_size = 0; sprintf(response, "FAILdata too large"); } else { @@ -544,7 +544,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) strcpy(response, "FAILno flash device defined"); #ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV - fb_mmc_flash_write(cmd, (void *)CONFIG_USB_FASTBOOT_BUF_ADDR, + fb_mmc_flash_write(cmd, (void *)CONFIG_FASTBOOT_BUF_ADDR, download_bytes, response); #endif fastboot_tx_write_str(response); diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index abcdfda6ac..633391bc93 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -301,8 +301,8 @@ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR -#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x07000000 +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 /* To support eMMC booting */ #define CONFIG_STORAGE_EMMC diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h index 31b75f216e..fa32fa43d1 100644 --- a/include/configs/bav335x.h +++ b/include/configs/bav335x.h @@ -458,8 +458,8 @@ DEFAULT_LINUX_BOOT_ENV \ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR -#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x07000000 +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 /* To support eMMC booting */ #define CONFIG_STORAGE_EMMC diff --git a/include/configs/bcm28155_ap.h b/include/configs/bcm28155_ap.h index 97e15086d5..b7c5716eae 100644 --- a/include/configs/bcm28155_ap.h +++ b/include/configs/bcm28155_ap.h @@ -140,8 +140,8 @@ #define CONFIG_FASTBOOT_FLASH #define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 #define CONFIG_SYS_CACHELINE_SIZE 64 -#define CONFIG_USB_FASTBOOT_BUF_SIZE (CONFIG_SYS_SDRAM_SIZE - SZ_1M) -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_SDRAM_BASE +#define CONFIG_FASTBOOT_BUF_SIZE (CONFIG_SYS_SDRAM_SIZE - SZ_1M) +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_SDRAM_BASE #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 0 diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 62330bf6e4..74994479e6 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -92,8 +92,8 @@ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR -#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x2F000000 +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x2F000000 #define CONFIG_FASTBOOT_FLASH #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1 #endif diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h index 47239b1016..3bb2e8f870 100644 --- a/include/configs/nitrogen6x.h +++ b/include/configs/nitrogen6x.h @@ -349,7 +349,7 @@ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR -#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x07000000 +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 #endif /* __CONFIG_H */ diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 59c780ed01..804e30708f 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -75,8 +75,8 @@ #define CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_CMD_FASTBOOT #define CONFIG_ANDROID_BOOT_IMAGE -#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR -#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x07000000 +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 /* USB EHCI */ #define CONFIG_CMD_USB -- cgit v1.2.3