summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2020-04-09 20:09:35 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2020-04-10 14:09:04 +0900
commitae235d55f524c1798961f0b17550d1a6715f080c (patch)
treedc74c9a8a80f8be8d5a6b51512c3b90ea3955412
parent0e5d03f1c119a7d9981f5af1ed16385444d4dd03 (diff)
downloadu-boot-tm1-accepted/tizen_4.0_unified.tar.gz
u-boot-tm1-accepted/tizen_4.0_unified.tar.bz2
u-boot-tm1-accepted/tizen_4.0_unified.zip
New Linux kernel xhci hub uses new usb descriptor scheme first for high speed usb peripheral device and it requests 8 bytes usb device descriptor and then 18 bytes full usb device descriptor but thor cdc-acm gadget always sends 18 bytes full usb device descriptor, so thor download mode is failed to recognize for linux host with new scheme. Fix the invalid larger device descriptor than requested by sending only requested bytes. Change-Id: I9ada9831a9667512f372d3a93d196fa8788f11b5 Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=48fc7dbd52c0559647291f33a10ccdc6cdbe4c72 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--property/usb/drv_cdc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/property/usb/drv_cdc.c b/property/usb/drv_cdc.c
index 0b726a7..30e6f92 100644
--- a/property/usb/drv_cdc.c
+++ b/property/usb/drv_cdc.c
@@ -17,6 +17,7 @@
#include <asm/arch/virtual_com.h>
#include <asm/arch/packet.h>
#include <asm/arch/usb20_reg_v3.h>
+#include <linux/usb/ch9.h>
#define USB_DEBUG
@@ -253,7 +254,13 @@ LOCAL void usb_get_descriptor (USB_REQUEST_1_U *request1, USB_REQUEST_2_U *reque
case USB_DEVICE_DESCRIPTOR_TYPE:
send_data = (uint8 *) thor_get_device_desc(enum_speed);
- EPI0_config (0x12, 0x1, TRUE, (uint32 *) send_data);
+ /*
+ * only send less or equal than requested length.
+ * no need to care about larger reqeust than possible
+ * descriptor length because of zero-length packet
+ * generated by usb controller
+ */
+ EPI0_config (min(USB_DT_DEVICE_SIZE, length), 0x1, TRUE, (uint32 *) send_data);
break;
case USB_CONFIGURATION_DESCRIPTOR_TYPE: