Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145687316
D37393.id113142.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D37393.id113142.diff
View Options
diff --git a/sys/dev/usb/controller/dwc3.h b/sys/dev/usb/controller/dwc3.h
--- a/sys/dev/usb/controller/dwc3.h
+++ b/sys/dev/usb/controller/dwc3.h
@@ -31,6 +31,15 @@
#ifndef _DWC3_H_
#define _DWC3_H_
+#define DWC3_IP_ID 0x5533
+#define DWC3_1_IP_ID 0x3331
+#define DWC3_2_IP_ID 0x3332
+
+#define DWC3_VERSION_MASK 0xFFFF0000
+#define DWC3_REVISION_MASK 0xFFFF
+#define DWC3_VERSION(x) ((x & DWC3_VERSION_MASK) >> 16)
+#define DWC3_REVISION(x) (x & DWC3_REVISION_MASK)
+
#define DWC3_GSBUSCFG0 0xc100
#define DWC3_GSBUSCFG1 0xc104
#define DWC3_GTXTHRCFG 0xc108
@@ -80,6 +89,9 @@
#define DWC3_GPRTBIMAP_HSLO 0xc180
#define DWC3_GPRTBIMAP_FSLO 0xc188
+#define DWC3_1_VER_NUMBER 0xc1a0
+#define DWC3_1_VER_TYPE 0xc1a4
+
#define DWC3_GUSB2PHYCFG0 0xc200
#define DWC3_GUSB2PHYCFG0_PHYSOFTRST (1 << 31)
#define DWC3_GUSB2PHYCFG0_U2_FREECLK_EXISTS (1 << 30)
diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c
--- a/sys/dev/usb/controller/dwc3.c
+++ b/sys/dev/usb/controller/dwc3.c
@@ -86,6 +86,9 @@
bus_space_tag_t bst;
bus_space_handle_t bsh;
uint32_t snpsid;
+ uint32_t snpsversion;
+ uint32_t snpsrevision;
+ uint32_t snpsversion_type;
#ifdef FDT
clk_t clk_ref;
clk_t clk_suspend;
@@ -389,8 +392,26 @@
sc->bsh = rman_get_bushandle(sc->mem_res);
sc->snpsid = DWC3_READ(sc, DWC3_GSNPSID);
- if (bootverbose)
- device_printf(sc->dev, "snps id: %#012x\n", sc->snpsid);
+ sc->snpsversion = DWC3_VERSION(sc->snpsid);
+ sc->snpsrevision = DWC3_REVISION(sc->snpsid);
+ if (sc->snpsversion == DWC3_1_IP_ID ||
+ sc->snpsversion == DWC3_2_IP_ID) {
+ sc->snpsrevision = DWC3_READ(sc, DWC3_1_VER_NUMBER);
+ sc->snpsversion_type = DWC3_READ(sc, DWC3_1_VER_TYPE);
+ }
+ if (bootverbose) {
+ if (sc->snpsversion == DWC3_IP_ID)
+ device_printf(sc->dev, "SNPS Version: DWC3 (%x %x)\n",
+ sc->snpsversion, sc->snpsrevision);
+ if (sc->snpsversion == DWC3_1_IP_ID)
+ device_printf(sc->dev, "SNPS Version: DWC3.1 (%x %x %x)\n",
+ sc->snpsversion, sc->snpsrevision,
+ sc->snpsversion_type);
+ if (sc->snpsversion == DWC3_2_IP_ID)
+ device_printf(sc->dev, "SNPS Version: DWC3.2 (%x %x %x)\n",
+ sc->snpsversion, sc->snpsrevision,
+ sc->snpsversion_type);
+ }
#ifdef DWC3_DEBUG
snps_dwc3_dump_ctrlparams(sc);
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 24, 3:26 AM (2 m, 37 s ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28968348
Default Alt Text
D37393.id113142.diff (2 KB)
Attached To
Mode
D37393: usb/dwc3: Read the full IDs/version
Attached
Detach File
Event Timeline
Log In to Comment