All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Stephan Gerhold <stephan@gerhold.net>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org,
	Dominik Kobinski <dominikkobinski314@gmail.com>,
	Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Subject: [PATCH v2 4/6] clk: qcom: gcc-msm8909: Increase delay for USB PHY reset
Date: Wed,  6 Jul 2022 15:41:30 +0200	[thread overview]
Message-ID: <20220706134132.3623415-5-stephan.gerhold@kernkonzept.com> (raw)
In-Reply-To: <20220706134132.3623415-1-stephan.gerhold@kernkonzept.com>

The USB PHY on MSM8909 works with the driver used on MSM8916
(phy-qcom-usb-hs.c). When turning the PHY on/off it is first reset
using the standard reset controller API. On MSM8916 the reset is
provided by the USB driver (ci_hdrc_msm_por_reset() in ci_hdrc_msm.c).

While this seems to work on MSM8909 as well, the Qualcomm Linux sources
suggest that the PHY should be reset using the GCC_USB2_HS_PHY_ONLY_BCR
register instead. In general this is easy to set up in the device tree,
thanks to the standard reset controller API.

However, to conform to the specifications of the PHY the reset signal
should be asserted for at least 10 us. This is handled correctly on
MSM8916 in ci_hdrc_msm_por_reset(), but not within the GCC driver.

Fix this by making use of the new "udelay" field of qcom_reset_map
and set a delay of ~15 us between the assertion/deassertion of the
USB PHY reset signal.

Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
---
Changes in v2: None.
---
 drivers/clk/qcom/gcc-msm8909.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-msm8909.c b/drivers/clk/qcom/gcc-msm8909.c
index c551953d3791..2a00b11ce2cd 100644
--- a/drivers/clk/qcom/gcc-msm8909.c
+++ b/drivers/clk/qcom/gcc-msm8909.c
@@ -2670,7 +2670,7 @@ static const struct qcom_reset_map gcc_msm8909_resets[] = {
 	[GCC_SDCC2_BCR] = { 0x43000 },
 	[GCC_ULT_AUDIO_BCR] = { 0x1c0b4 },
 	[GCC_USB2A_PHY_BCR] = { 0x41028 },
-	[GCC_USB2_HS_PHY_ONLY_BCR] = { 0x41034 },
+	[GCC_USB2_HS_PHY_ONLY_BCR] = { .reg = 0x41034, .udelay = 15 },
 	[GCC_USB_HS_BCR] = { 0x41000 },
 	[GCC_VENUS0_BCR] = { 0x4c014 },
 	/* Subsystem Restart */
-- 
2.30.2


  parent reply	other threads:[~2022-07-06 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 13:41 [PATCH v2 0/6] clk: qcom: Add clocks for MSM8909 Stephan Gerhold
2022-07-06 13:41 ` [PATCH v2 1/6] dt-bindings: clock: Add schema for MSM8909 GCC Stephan Gerhold
2022-07-06 15:26   ` Krzysztof Kozlowski
2022-07-06 13:41 ` [PATCH v2 2/6] clk: qcom: Add driver " Stephan Gerhold
2022-07-06 13:41 ` [PATCH v2 3/6] clk: qcom: reset: Allow specifying custom reset delay Stephan Gerhold
2022-07-06 13:41 ` Stephan Gerhold [this message]
2022-07-06 13:41 ` [PATCH v2 5/6] dt-bindings: clock: qcom,rpmcc: Add MSM8909 Stephan Gerhold
2022-07-06 13:41 ` [PATCH v2 6/6] clk: qcom: smd-rpm: Add clocks for MSM8909 Stephan Gerhold
2022-09-15  3:37 ` [PATCH v2 0/6] clk: qcom: " Bjorn Andersson

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=20220706134132.3623415-5-stephan.gerhold@kernkonzept.com \
    --to=stephan.gerhold@kernkonzept.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dominikkobinski314@gmail.com \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stephan@gerhold.net \
    /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 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.