From: Stephen Warren <swarren@wwwdotorg.org>
To: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Cc: balbi@ti.com, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
gregkh@linuxfoundation.org, stern@rowland.harvard.edu
Subject: Re: [PATCH 4/6] usb: phy: tegra: Program new PHY parameters
Date: Thu, 01 Aug 2013 15:16:16 -0600 [thread overview]
Message-ID: <51FAD020.8090306@wwwdotorg.org> (raw)
In-Reply-To: <1375292522-7855-5-git-send-email-ttynkkynen@nvidia.com>
On 07/31/2013 11:42 AM, Tuomas Tynkkynen wrote:
> The Tegra30 TRM recommends configuration of certain PHY parameters for
> optimal quality. Program the following registers based on device tree
> parameters:
>
> - UTMIP_XCVR_HSSLEW: HS slew rate control.
> - UTMIP_HSSQUELCH_LEVEL: HS squelch detector level
> - UTMIP_HSDISCON_LEVEL: HS disconnect detector level.
>
> These registers exist in Tegra20, but programming them hasn't been
> necessary, so these parameters won't be set on Tegra20 to keep the
> device trees backward compatible.
>
> Additionally, the UTMIP_XCVR_SETUP parameter can be set from fuses
> instead of a software-programmed value, as the optimal value can
> vary between invidual boards. The boolean property
> nvidia,xcvr-setup-use-fuses can be used to enable this behaviour.
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> -#define UTMIP_XCVR_HSSLEW_MSB(x) (((x) & 0x7f) << 25)
> +#define UTMIP_XCVR_HSSLEW(x) (((x) & 0x3) << 4)
> +#define UTMIP_XCVR_HSSLEW_MSB(x) ((((x) & 0x1ff) >> 2) << 25)
Similarly, may as well s/0x1ff/0x1fc/ there too.
> @@ -262,7 +267,14 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy)
>
> if (utmip_pad_count++ == 0) {
> val = readl(base + UTMIP_BIAS_CFG0);
> - val &= ~(UTMIP_OTGPD | UTMIP_BIASPD);
> + val &= ~(UTMIP_OTGPD | UTMIP_BIASPD |
> + UTMIP_HSSQUELCH_LEVEL(~0) |
> + UTMIP_HSDISCON_LEVEL(~0) |
> + UTMIP_HSDISCON_LEVEL_MSB(~0));
> +
> + val |= UTMIP_HSSQUELCH_LEVEL(config->hssquelch_level);
> + val |= UTMIP_HSDISCON_LEVEL(config->hsdiscon_level);
> + val |= UTMIP_HSDISCON_LEVEL_MSB(config->hsdiscon_level);
> writel(val, base + UTMIP_BIAS_CFG0);
> }
>
> @@ -432,11 +444,16 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
> UTMIP_FORCE_PDZI_POWERDOWN | UTMIP_XCVR_LSBIAS_SEL |
> UTMIP_XCVR_SETUP(~0) | UTMIP_XCVR_SETUP_MSB(~0) |
> UTMIP_XCVR_LSFSLEW(~0) | UTMIP_XCVR_LSRSLEW(~0) |
> - UTMIP_XCVR_HSSLEW_MSB(~0));
> - val |= UTMIP_XCVR_SETUP(config->xcvr_setup);
> - val |= UTMIP_XCVR_SETUP_MSB(config->xcvr_setup);
> + UTMIP_XCVR_HSSLEW(~0) | UTMIP_XCVR_HSSLEW_MSB(~0));
> +
> + if (!config->xcvr_setup_use_fuses) {
> + val |= UTMIP_XCVR_SETUP(config->xcvr_setup);
> + val |= UTMIP_XCVR_SETUP_MSB(config->xcvr_setup);
> + }
> val |= UTMIP_XCVR_LSFSLEW(config->xcvr_lsfslew);
> val |= UTMIP_XCVR_LSRSLEW(config->xcvr_lsrslew);
> + val |= UTMIP_XCVR_HSSLEW(config->xcvr_hsslew);
> + val |= UTMIP_XCVR_HSSLEW_MSB(config->xcvr_hsslew);
Those two chunks end up clearing some fields in the register now even on
earlier chips, whereas before their values were maintained when doing
the read/modify/write. Yet, the commit description says the new fields
aren't changed on Tegra20. Do the changes above need to be guarded by if
(requires_extra_tuning_parameters)?
(When I tested this series, I only tested Tegra30/114; I didn't any
Tegra20 devices...)
next prev parent reply other threads:[~2013-08-01 21:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 17:41 [PATCH 0/6] USB tree changes for Tegra30 and Tegra114 USB Host support Tuomas Tynkkynen
[not found] ` <1375292522-7855-1-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-07-31 17:41 ` [PATCH 1/6] usb: host: add has_tdi_phy_lpm capability bit Tuomas Tynkkynen
[not found] ` <1375292522-7855-2-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-07-31 18:35 ` Alan Stern
2013-08-01 8:05 ` Matthieu CASTET
2013-08-02 15:42 ` Tuomas Tynkkynen
2013-07-31 17:42 ` [PATCH 5/6] Documentation: New DT parameters for tegra30-usb-phy Tuomas Tynkkynen
[not found] ` <1375292522-7855-6-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-01 21:17 ` Stephen Warren
2013-07-31 17:41 ` [PATCH 2/6] usb: phy: tegra: Fix wrong PHY parameters Tuomas Tynkkynen
[not found] ` <1375292522-7855-3-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-01 21:09 ` Stephen Warren
[not found] ` <51FACE74.3070909-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-02 14:15 ` Tuomas Tynkkynen
2013-07-31 17:41 ` [PATCH 3/6] usb: phy: tegra: Tegra30 support Tuomas Tynkkynen
2013-07-31 17:42 ` [PATCH 4/6] usb: phy: tegra: Program new PHY parameters Tuomas Tynkkynen
2013-08-01 21:16 ` Stephen Warren [this message]
[not found] ` <51FAD020.8090306-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-02 14:05 ` Tuomas Tynkkynen
2013-07-31 17:42 ` [PATCH 6/6] usb: host: tegra: Tegra30 support Tuomas Tynkkynen
[not found] ` <1375292522-7855-7-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-01 21:18 ` Stephen Warren
2013-07-31 23:22 ` [PATCH 0/6] USB tree changes for Tegra30 and Tegra114 USB Host support Stephen Warren
2013-08-01 13:02 ` Tuomas Tynkkynen
[not found] ` <51FA5C5A.2080900-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-01 16:22 ` Stephen Warren
[not found] ` <51FA8B3B.8070504-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-02 7:52 ` Felipe Balbi
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=51FAD020.8090306@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=ttynkkynen@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