usb: dwc2: Add support for v3 snpsid value
authorPeter Griffin <peter.griffin@linaro.org>
Tue, 12 May 2015 13:38:27 +0000 (14:38 +0100)
committerMarek Vasut <marex@denx.de>
Fri, 29 May 2015 10:41:04 +0000 (12:41 +0200)
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>
drivers/usb/host/dwc2.c
drivers/usb/host/dwc2.h

index 2ac00177a20c1b3b00da029d251388939b1e0930..eee60a2b039a247b8c1282d1c2e92294a2377ae8 100644 (file)
@@ -932,7 +932,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;
        }
index 45408c6f5cc19946fb66c27b9ca190ab6012f103..f69372e6b418fca6825dfba48560b9dad1c2e0db 100644 (file)
@@ -732,6 +732,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