devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stanley Chang[昌育德]" <stanley_chang@realtek.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Felipe Balbi <balbi@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 RESEND 1/2] usb: dwc3: core: configure TX/RX threshold for DWC3_IP
Date: Tue, 12 Sep 2023 02:48:14 +0000	[thread overview]
Message-ID: <567f066c59de49e88dec4bae459d1dcc@realtek.com> (raw)
In-Reply-To: <20230911234408.xb5higafb6ssajyt@synopsys.com>

Hi Thinh,

> >
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
> > 9c6bf054f15d..1f74a53816c3 100644
> > --- a/drivers/usb/dwc3/core.c
> > +++ b/drivers/usb/dwc3/core.c
> > @@ -1246,6 +1246,39 @@ static int dwc3_core_init(struct dwc3 *dwc)
> >               }
> >       }
> >
> > +     if (DWC3_IP_IS(DWC3)) {
> 
> Would you mind also add the checks for DWC_usb31 and DWC_usb32? Both
> the
> DWC_usb31 and DWC_usb32 share the same field offsets within
> GTX/RXTHRCFG registers. The macros are already defined for those IPs.

DWC3 and DWC31, DWC32 seem to have different register definition as follows.
/* Global RX Threshold Configuration Register */
#define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 19)
#define DWC3_GRXTHRCFG_RXPKTCNT(n) (((n) & 0xf) << 24)
#define DWC3_GRXTHRCFG_PKTCNTSEL BIT(29)

/* Global TX Threshold Configuration Register */
#define DWC3_GTXTHRCFG_MAXTXBURSTSIZE(n) (((n) & 0xff) << 16)
#define DWC3_GTXTHRCFG_TXPKTCNT(n) (((n) & 0xf) << 24)
#define DWC3_GTXTHRCFG_PKTCNTSEL BIT(29)

/* Global RX Threshold Configuration Register for DWC_usb31 only */
#define DWC31_GRXTHRCFG_MAXRXBURSTSIZE(n)       (((n) & 0x1f) << 16)
#define DWC31_GRXTHRCFG_RXPKTCNT(n)             (((n) & 0x1f) << 21)
#define DWC31_GRXTHRCFG_PKTCNTSEL               BIT(26)
#define DWC31_RXTHRNUMPKTSEL_HS_PRD             BIT(15)
#define DWC31_RXTHRNUMPKT_HS_PRD(n)             (((n) & 0x3) << 13)
#define DWC31_RXTHRNUMPKTSEL_PRD                BIT(10)
#define DWC31_RXTHRNUMPKT_PRD(n)                (((n) & 0x1f) << 5)
#define DWC31_MAXRXBURSTSIZE_PRD(n)             ((n) & 0x1f)

/* Global TX Threshold Configuration Register for DWC_usb31 only */
#define DWC31_GTXTHRCFG_MAXTXBURSTSIZE(n)       (((n) & 0x1f) << 16)
#define DWC31_GTXTHRCFG_TXPKTCNT(n)             (((n) & 0x1f) << 21)
#define DWC31_GTXTHRCFG_PKTCNTSEL               BIT(26)
#define DWC31_TXTHRNUMPKTSEL_HS_PRD             BIT(15)
#define DWC31_TXTHRNUMPKT_HS_PRD(n)             (((n) & 0x3) << 13)
#define DWC31_TXTHRNUMPKTSEL_PRD                BIT(10)
#define DWC31_TXTHRNUMPKT_PRD(n)                (((n) & 0x1f) << 5)
#define DWC31_MAXTXBURSTSIZE_PRD(n)             ((n) & 0x1f)

> Also, I think this new addition will make dwc3_core_init() lengthy. Can we split
> this logic to a separate function, perhaps dwc3_config_threshold()?
> 

Ok, I will move this logic to a new function.
Thanks,
Stanley


  reply	other threads:[~2023-09-12  3:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  5:52 [PATCH v2 RESEND 1/2] usb: dwc3: core: configure TX/RX threshold for DWC3_IP Stanley Chang
2023-08-28  5:52 ` [PATCH v2 RESEND 2/2] dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable Stanley Chang
2023-08-28 15:36   ` Rob Herring
2023-09-11  1:53 ` [PATCH v2 RESEND 1/2] usb: dwc3: core: configure TX/RX threshold for DWC3_IP Stanley Chang[昌育德]
2023-09-11 23:44 ` Thinh Nguyen
2023-09-12  2:48   ` Stanley Chang[昌育德] [this message]
2023-09-12  3:32     ` Thinh Nguyen
2023-09-12  3:39       ` Stanley Chang[昌育德]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=567f066c59de49e88dec4bae459d1dcc@realtek.com \
    --to=stanley_chang@realtek.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).