From: Peter Chen <peter.chen@kernel.org>
To: Ravi Gunasekaran <r-gunasekaran@ti.com>
Cc: pawell@cadence.com, rogerq@kernel.org,
gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] usb: cdns3: Add quirk flag to enable suspend residency
Date: Thu, 16 May 2024 09:39:24 +0800 [thread overview]
Message-ID: <20240516013924.GA3283751@nchen-desktop> (raw)
In-Reply-To: <dde63edb-9057-2d33-032a-8ee25e981c72@ti.com>
On 24-05-15 09:52:57, Ravi Gunasekaran wrote:
>
>
> On 5/15/24 7:08 AM, Peter Chen wrote:
> > On 24-05-14 14:54:20, Ravi Gunasekaran wrote:
> >> From: Roger Quadros <rogerq@kernel.org>
> >>
> >> Some platforms (e.g. ti,j721e-usb, ti,am64-usb) require
> >> this bit to be set to workaround a lockup issue with PHY
> >> short suspend intervals [1]. Add a platform quirk flag
> >> to indicate if Suspend Residency should be enabled.
> >>
> >> [1] - https://www.ti.com/lit/er/sprz457h/sprz457h.pdf
> >> i2409 - USB: USB2 PHY locks up due to short suspend
> >>
> >> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> >> Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
> >> ---
>
> [...]
>
> >> regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res);
> >> @@ -439,6 +439,13 @@ int cdns_drd_init(struct cdns *cdns)
> >> return -EINVAL;
> >> }
> >>
> >> + if (cdns->pdata &&
> >> + (cdns->pdata->quirks & CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE)) {
> >> + reg = readl(&cdns->otg_v1_regs->susp_ctrl);
> >> + reg |= SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE;
> >> + writel(reg, &cdns->otg_v1_regs->susp_ctrl);
> >> + }
> >> +
> >
> > It is better put this above (just above code cdns->version =
> > CDNS3_CONTROLLER_V1;)
> >
>
> You mean here, to group it with CDNS3 v1?
>
> else if (OTG_CDNS3_CHECK_DID(state)) {
> cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem *)
> &cdns->otg_v1_regs->ien;
> writel(1, &cdns->otg_v1_regs->simulate);
>
> + if (cdns->pdata &&
> + (cdns->pdata->quirks & CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE)) {
> + reg = readl(&cdns->otg_v1_regs->susp_ctrl);
> + reg |= SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE;
> + writel(reg, &cdns->otg_v1_regs->susp_ctrl);
> + }
> dns->version = CDNS3_CONTROLLER_V1;
Yes.
Peter
> } else
>
> > Peter
> >> dev_dbg(cdns->dev, "DRD version v1 (ID: %08x, rev: %08x)\n",
> >> readl(&cdns->otg_v1_regs->did),
> >> readl(&cdns->otg_v1_regs->rid));
> >> diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h
> >> index d72370c321d3..1e2aee14d629 100644
> >> --- a/drivers/usb/cdns3/drd.h
> >> +++ b/drivers/usb/cdns3/drd.h
> >> @@ -193,6 +193,9 @@ struct cdns_otg_irq_regs {
> >> /* OTGREFCLK - bitmasks */
> >> #define OTGREFCLK_STB_CLK_SWITCH_EN BIT(31)
> >>
> >> +/* SUPS_CTRL - bitmasks */
> >> +#define SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE BIT(17)
> >> +
> >> /* OVERRIDE - bitmasks */
> >> #define OVERRIDE_IDPULLUP BIT(0)
> >> /* Only for CDNS3_CONTROLLER_V0 version */
> >> --
> >> 2.17.1
> >>
> >
>
> --
> Regards,
> Ravi
--
Thanks,
Peter Chen
next prev parent reply other threads:[~2024-05-16 1:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 9:24 [PATCH 0/2] TI AM64/J7: USB Errata i2409 workaround Ravi Gunasekaran
2024-05-14 9:24 ` [PATCH 1/2] usb: cdns3: Add quirk flag to enable suspend residency Ravi Gunasekaran
2024-05-15 1:38 ` Peter Chen
2024-05-15 4:22 ` Ravi Gunasekaran
2024-05-16 1:39 ` Peter Chen [this message]
2024-05-14 9:24 ` [PATCH 2/2] usb: cdns3-ti: Add workaround for Errata i2409 Ravi Gunasekaran
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=20240516013924.GA3283751@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
--cc=r-gunasekaran@ti.com \
--cc=rogerq@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 read-only IMAP folder(s) and NNTP newsgroup(s).