From 3389e83177b84892479d1ddf98dc41ec3bf6fa3a Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Mon, 16 Jul 2018 20:58:06 +0800 Subject: [PATCH] DM USB: add some BCD codes BCD code is USB Specification Release Number in Binaray-Coded Decimal. Add some BCD codes for some USB devices. Change-Id: I40f04ef2ebaf5b0da554ff8f432415e8e3cebe01 Tracked-On: Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/platform/usb_pmapper.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devicemodel/hw/platform/usb_pmapper.c b/devicemodel/hw/platform/usb_pmapper.c index 5e31e0290..cde6fb630 100644 --- a/devicemodel/hw/platform/usb_pmapper.c +++ b/devicemodel/hw/platform/usb_pmapper.c @@ -823,10 +823,21 @@ usb_dev_init(void *pdata, char *opt) goto errout; switch (desc.bcdUSB) { + case 0x310: case 0x300: ver = 3; break; case 0x200: + case 0x201: + case 0x210: case 0x110: + /* 0x110 is a special case. + * xHCI spec v1.0 was released in 2010 and USB spec v1.1 was + * released in 1998, anything about USB 1.x could hardly be + * found in xHCI spec. So here use USB 2.x to do the emulation + * for USB 1.x device. + * And one more thing, it is almost impossible to find an USB + * 1.x device today. + */ ver = 2; break; default: goto errout;