All of lore.kernel.org
 help / color / mirror / Atom feed
* [13/15] usb: dwc3: Track DWC_usb31 VERSIONTYPE
@ 2018-01-05 21:43 Sergei Shtylyov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-01-05 21:43 UTC (permalink / raw)
  To: Thinh Nguyen, Felipe Balbi, linux-usb; +Cc: John Youn

Hello!

On 1/5/2018 11:16 PM, Thinh Nguyen wrote:

> Add a new variable to dwc3 structure to track VERSIONTYPE. The

    That's called field, not variable.

> VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register.
> In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE
> such as "ea01" and "ea02".
> 
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
[...]

MBR, Sergei
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [13/15] usb: dwc3: Track DWC_usb31 VERSIONTYPE
@ 2018-01-05 22:06 Thinh Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2018-01-05 22:06 UTC (permalink / raw)
  To: Sergei Shtylyov, Thinh Nguyen, Felipe Balbi, linux-usb; +Cc: John Youn

On 1/5/2018 1:43 PM, Sergei Shtylyov wrote:

> Hello!
> 
> On 1/5/2018 11:16 PM, Thinh Nguyen wrote:
> 
>> Add a new variable to dwc3 structure to track VERSIONTYPE. The
> 
>      That's called field, not variable.

Thanks for pointing that out. I'll make an update.

>> VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register.
>> In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE
>> such as "ea01" and "ea02".
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> [...]
> 
> MBR, Sergei
> 

BR,
Thinh
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [13/15] usb: dwc3: Track DWC_usb31 VERSIONTYPE
@ 2018-01-05 20:16 Thinh Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2018-01-05 20:16 UTC (permalink / raw)
  To: Felipe Balbi, Thinh Nguyen, linux-usb; +Cc: John Youn

Add a new variable to dwc3 structure to track VERSIONTYPE. The
VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register.
In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE
such as "ea01" and "ea02".

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 drivers/usb/dwc3/core.c | 2 ++
 drivers/usb/dwc3/core.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 56ca39b40a77..ab0912e4f837 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -642,6 +642,7 @@ static bool dwc3_core_is_valid(struct dwc3 *dwc)
 {
 	u32 reg;
 
+	dwc->ver_type = 0;
 	reg = dwc3_readl(dwc->regs, DWC3_GSNPSID);
 
 	/* This should read as U3 followed by revision number */
@@ -652,6 +653,7 @@ static bool dwc3_core_is_valid(struct dwc3 *dwc)
 		/* Detected DWC_usb31 IP */
 		dwc->revision = dwc3_readl(dwc->regs, DWC3_VER_NUMBER);
 		dwc->revision |= DWC3_REVISION_IS_DWC31;
+		dwc->ver_type = dwc3_readl(dwc->regs, DWC3_VER_TYPE);
 	} else {
 		return false;
 	}
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 21a6dcd379f1..764dc896d07a 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -810,6 +810,7 @@ struct dwc3_scratchpad_array {
  * @u1u2: only used on revisions <1.83a for workaround
  * @maximum_speed: maximum speed requested (mainly for testing purposes)
  * @revision: revision register contents
+ * @ver_type: VERSIONTYPE register contents, a sub release of a revision
  * @dr_mode: requested mode of operation
  * @current_dr_role: current role of operation when in dual-role mode
  * @desired_dr_role: desired role of operation when in dual-role mode
@@ -984,6 +985,10 @@ struct dwc3 {
 #define DWC3_USB31_REVISION_110A	(0x3131302a | DWC3_REVISION_IS_DWC31)
 #define DWC3_USB31_REVISION_120A	(0x3132302a | DWC3_REVISION_IS_DWC31)
 
+	u32			ver_type;
+
+#define DWC3_USB31_VERSIONTYPE_EA01	0x65613031
+
 	enum dwc3_ep0_next	ep0_next_event;
 	enum dwc3_ep0_state	ep0state;
 	enum dwc3_link_state	link_state;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 21:43 [13/15] usb: dwc3: Track DWC_usb31 VERSIONTYPE Sergei Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2018-01-05 22:06 Thinh Nguyen
2018-01-05 20:16 Thinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.