summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2015-05-12 11:21:19 +0100
committerPeter Griffin <peter.griffin@linaro.org>2015-05-12 11:21:19 +0100
commit579a350aeccaa3818f783ed31c2028a61024d350 (patch)
treefc9a739a3bcd69f5dd2352a2766a31ec73cdde3e
parentf33cdaa4c3da4a8fd35aa2f9a3172f31cc887b35 (diff)
usb: dwc2: Add support for v3 snpsid value
This has been tested to the extent that I can enumerate a asix usb networking adapter and boot a kernel over usb on the 96boards hikey u-boot port I'm currently doing. Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r--drivers/usb/host/dwc2.c3
-rw-r--r--drivers/usb/host/dwc2.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index e8142ac092..19a6007125 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1015,7 +1015,8 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
snpsid = readl(&regs->gsnpsid);
printf("Core Release: %x.%03x\n", snpsid >> 12 & 0xf, snpsid & 0xfff);
- if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx) {
+ if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx &&
+ (snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_3xx) {
printf("SNPSID invalid (not DWC2 OTG device): %08x\n", snpsid);
return -ENODEV;
}
diff --git a/drivers/usb/host/dwc2.h b/drivers/usb/host/dwc2.h
index ba08fd554f..1e0f502a2b 100644
--- a/drivers/usb/host/dwc2.h
+++ b/drivers/usb/host/dwc2.h
@@ -729,6 +729,7 @@ struct dwc2_core_regs {
#define DWC2_PCGCCTL_DEEP_SLEEP (1 << 7)
#define DWC2_PCGCCTL_DEEP_SLEEP_OFFSET 7
#define DWC2_SNPSID_DEVID_VER_2xx (0x4f542 << 12)
+#define DWC2_SNPSID_DEVID_VER_3xx (0x4f543 << 12)
#define DWC2_SNPSID_DEVID_MASK (0xfffff << 12)
#define DWC2_SNPSID_DEVID_OFFSET 12