From: Jon Hunter <jonathanh@nvidia.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
"Nagarjuna Kristam" <nkristam@nvidia.com>,
JC Kuo <jckuo@nvidia.com>,
Mathias Nyman <mathias.nyman@intel.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
<linux-usb@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-tegra@vger.kernel.org>,
Thierry Reding <treding@nvidia.com>,
Wayne Chang <waynec@nvidia.com>,
Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH v2 12/12] usb: gadget: tegra-xudc: Add support for Tegra264
Date: Mon, 16 Nov 2026 15:24:09 +0000 [thread overview]
Message-ID: <20261116-tegra-usb-v2-12-42efc03a9700@nvidia.com> (raw)
In-Reply-To: <20261116-tegra-usb-v2-0-42efc03a9700@nvidia.com>
Add support for the Tegra264 XUDC by adding the device-tree compatible
string, SoC data and additional registers that need to be configured for
Tegra264. The LMP ITP timer mask in the SSPX_CORE_CNT30 register is
different for Tegra264 and so move the mask into the SoC data.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
drivers/usb/gadget/udc/tegra-xudc.c | 61 ++++++++++++++++++++++++++++++++++---
1 file changed, 56 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index caf437d6b754..b4b6fdc9367b 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -146,10 +146,15 @@
#define SSPX_CORE_CNT0 0x10
#define SSPX_CORE_CNT0_PING_TBURST_MASK GENMASK(7, 0)
#define SSPX_CORE_CNT0_PING_TBURST(x) ((x) & SSPX_CORE_CNT0_PING_TBURST_MASK)
+#define SSPX_CORE_CNT13 0x44
+#define SSPX_CORE_CNT13_CRDTHP_TIMER_MASK GENMASK(11, 0)
+#define SSPX_CORE_CNT13_CRDTHP_TIMER(x) ((x) & \
+ SSPX_CORE_CNT13_CRDTHP_TIMER_MASK)
+#define SSPX_CORE_CNT27 0x7c
+#define SSPX_CORE_CNT27_PING_LFPS_TRPT_MASK GENMASK(29, 0)
+#define SSPX_CORE_CNT27_PING_LFPS_TRPT(x) ((x) & \
+ SSPX_CORE_CNT27_PING_LFPS_TRPT_MASK)
#define SSPX_CORE_CNT30 0x88
-#define SSPX_CORE_CNT30_LMPITP_TIMER_MASK GENMASK(19, 0)
-#define SSPX_CORE_CNT30_LMPITP_TIMER(x) ((x) & \
- SSPX_CORE_CNT30_LMPITP_TIMER_MASK)
#define SSPX_CORE_CNT32 0x90
#define SSPX_CORE_CNT32_POLL_TBURST_MAX_MASK GENMASK(7, 0)
#define SSPX_CORE_CNT32_POLL_TBURST_MAX(x) ((x) & \
@@ -552,9 +557,12 @@ struct tegra_xudc_soc {
unsigned int num_clks;
unsigned int num_phys;
unsigned int sspx_offset;
+ unsigned int crdthp_timer;
unsigned int lfps_ping;
+ unsigned int lfps_ping_trpt;
unsigned int lfps_poll;
unsigned int lmpitp_timer;
+ unsigned int lmpitp_timer_mask;
unsigned int u3_timeout;
bool u1_enable;
bool u2_enable;
@@ -3433,11 +3441,25 @@ static void tegra_xudc_device_params_init(struct tegra_xudc *xudc)
xudc_writel(xudc, val, offset + SSPX_CORE_CNT0);
}
+ if (xudc->soc->crdthp_timer) {
+ val = xudc_readl(xudc, offset + SSPX_CORE_CNT13);
+ val &= ~(SSPX_CORE_CNT13_CRDTHP_TIMER_MASK);
+ val |= SSPX_CORE_CNT13_CRDTHP_TIMER(xudc->soc->crdthp_timer);
+ xudc_writel(xudc, val, offset + SSPX_CORE_CNT13);
+ }
+
+ if (xudc->soc->lfps_ping_trpt) {
+ val = xudc_readl(xudc, offset + SSPX_CORE_CNT27);
+ val &= ~(SSPX_CORE_CNT27_PING_LFPS_TRPT_MASK);
+ val |= SSPX_CORE_CNT27_PING_LFPS_TRPT(xudc->soc->lfps_ping_trpt);
+ xudc_writel(xudc, val, offset + SSPX_CORE_CNT27);
+ }
+
if (xudc->soc->lmpitp_timer) {
/* Default tPortConfiguration timeout is too small. */
val = xudc_readl(xudc, offset + SSPX_CORE_CNT30);
- val &= ~(SSPX_CORE_CNT30_LMPITP_TIMER_MASK);
- val |= SSPX_CORE_CNT30_LMPITP_TIMER(xudc->soc->lmpitp_timer);
+ val &= ~(xudc->soc->lmpitp_timer_mask);
+ val |= xudc->soc->lmpitp_timer & xudc->soc->lmpitp_timer_mask;
xudc_writel(xudc, val, offset + SSPX_CORE_CNT30);
}
@@ -3662,6 +3684,7 @@ static struct tegra_xudc_soc tegra210_xudc_soc_data = {
.lfps_ping = 0xa,
.lfps_poll = 0xb0, /* 1.45us */
.lmpitp_timer = 0x978,
+ .lmpitp_timer_mask = GENMASK(19, 0),
.u3_timeout = 0x5dc0,
.u1_enable = false,
.u2_enable = true,
@@ -3682,6 +3705,7 @@ static struct tegra_xudc_soc tegra186_xudc_soc_data = {
.lfps_ping = 0xa,
.lfps_poll = 0xb0, /* 1.45us */
.lmpitp_timer = 0x978,
+ .lmpitp_timer_mask = GENMASK(19, 0),
.u3_timeout = 0x5dc0,
.u1_enable = true,
.u2_enable = true,
@@ -3702,6 +3726,7 @@ static struct tegra_xudc_soc tegra194_xudc_soc_data = {
.lfps_ping = 0xa,
.lfps_poll = 0xb0, /* 1.45us */
.lmpitp_timer = 0x978,
+ .lmpitp_timer_mask = GENMASK(19, 0),
.u3_timeout = 0x5dc0,
.u1_enable = true,
.u2_enable = true,
@@ -3722,6 +3747,7 @@ static struct tegra_xudc_soc tegra234_xudc_soc_data = {
.lfps_ping = 0xa,
.lfps_poll = 0xb0, /* 1.45us */
.lmpitp_timer = 0x978,
+ .lmpitp_timer_mask = GENMASK(19, 0),
.u3_timeout = 0x5dc0,
.u1_enable = true,
.u2_enable = true,
@@ -3741,6 +3767,7 @@ static struct tegra_xudc_soc tegra238_xudc_soc_data = {
.lfps_ping = 0xa,
.lfps_poll = 0xb0, /* 1.45us */
.lmpitp_timer = 0x978,
+ .lmpitp_timer_mask = GENMASK(19, 0),
.u3_timeout = 0x5dc0,
.u1_enable = true,
.u2_enable = true,
@@ -3752,6 +3779,26 @@ static struct tegra_xudc_soc tegra238_xudc_soc_data = {
.has_powergates = false,
};
+static struct tegra_xudc_soc tegra264_xudc_soc_data = {
+ .clock_names = tegra186_xudc_clock_names,
+ .num_clks = ARRAY_SIZE(tegra186_xudc_clock_names),
+ .num_phys = 4,
+ .sspx_offset = 0x4000,
+ .crdthp_timer = 0x33,
+ .lfps_ping_trpt = 0x7a1200,
+ .lfps_poll = 0x3b, /* 1.466us */
+ .lmpitp_timer = 0xc9,
+ .lmpitp_timer_mask = GENMASK(11, 0),
+ .u1_enable = true,
+ .u2_enable = true,
+ .lpm_enable = true,
+ .invalid_seq_num = false,
+ .pls_quirk = false,
+ .port_reset_quirk = false,
+ .has_ipfs = false,
+ .has_powergates = true,
+};
+
static const struct of_device_id tegra_xudc_of_match[] = {
{
.compatible = "nvidia,tegra210-xudc",
@@ -3773,6 +3820,10 @@ static const struct of_device_id tegra_xudc_of_match[] = {
.compatible = "nvidia,tegra238-xudc",
.data = &tegra238_xudc_soc_data
},
+ {
+ .compatible = "nvidia,tegra264-xudc",
+ .data = &tegra264_xudc_soc_data
+ },
{ }
};
MODULE_DEVICE_TABLE(of, tegra_xudc_of_match);
--
2.43.0
prev parent reply other threads:[~2026-11-16 15:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 15:23 [PATCH v2 00/12] usb: Add support for Tegra238 and device support for Tegra264 Jon Hunter
2026-11-16 15:23 ` [PATCH v2 01/12] dt-bindings: usb: tegra234-xusb: Add required properties Jon Hunter
2026-11-16 15:23 ` [PATCH v2 02/12] dt-bindings: usb: Add Tegra238 XUSB host controller support Jon Hunter
2026-11-16 15:38 ` sashiko-bot
2026-11-16 15:24 ` [PATCH v2 03/12] dt-bindings: usb: tegra-xudc: Add Tegra238 XUDC support Jon Hunter
2026-11-16 15:24 ` [PATCH v2 04/12] dt-bindings: usb: tegra-xudc: Add Tegra264 " Jon Hunter
2026-11-16 15:24 ` [PATCH v2 05/12] usb: xhci: tegra: Fix missing semi-colon Jon Hunter
2026-11-16 15:24 ` [PATCH v2 06/12] usb: xhci: tegra: Add support for Tegra238 Jon Hunter
2026-11-16 15:24 ` [PATCH v2 07/12] usb: gadget: tegra-xudc: Fix CNT65 configuration Jon Hunter
2026-11-16 15:24 ` [PATCH v2 08/12] usb: gadget: tegra-xudc: Preserve runtime PM across system suspend Jon Hunter
2026-11-16 15:24 ` [PATCH v2 09/12] usb: gadget: tegra-xudc: Add support for Tegra238 Jon Hunter
2026-11-16 15:54 ` sashiko-bot
2026-11-16 15:24 ` [PATCH v2 10/12] usb: gadget: tegra-xudc: Add SSPX register offset to SoC data Jon Hunter
2026-11-16 15:24 ` [PATCH v2 11/12] usb: gadget: tegra-xudc: Add default settings " Jon Hunter
2026-11-16 15:24 ` Jon Hunter [this message]
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=20261116-tegra-usb-v2-12-42efc03a9700@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jckuo@nvidia.com \
--cc=krzk+dt@kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=nkristam@nvidia.com \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=thierry.reding@kernel.org \
--cc=treding@nvidia.com \
--cc=waynec@nvidia.com \
/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