linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: robh+dt@kernel.org, angelogioacchino.delregno@somainline.org,
	jamipkettunen@gmail.com, bjorn.andersson@linaro.org,
	agross@kernel.org, elder@kernel.org,
	linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 3/6] net: ipa: disable misc clock gating for IPA v3.1
Date: Mon, 21 Jun 2021 12:56:24 -0500	[thread overview]
Message-ID: <20210621175627.238474-4-elder@linaro.org> (raw)
In-Reply-To: <20210621175627.238474-1-elder@linaro.org>

For IPA v3.1, a workaround is needed to disable gating on a MISC
clock.  I have no further explanation, but this is what the
downstream code (msm-4.4) does.

This was suggested in a patch from AngeloGioacchino Del Regno.

Link: https://lore.kernel.org/netdev/20210211175015.200772-2-angelogioacchino.delregno@somainline.org
Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/ipa_main.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index f82130db32f6d..20a83c7f671f3 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -400,16 +400,20 @@ static void ipa_hardware_config(struct ipa *ipa, const struct ipa_data *data)
 
 	/* Implement some hardware workarounds */
 	if (version >= IPA_VERSION_4_0 && version < IPA_VERSION_4_5) {
-		/* Enable open global clocks (not needed for IPA v4.5) */
-		val = GLOBAL_FMASK;
-		val |= GLOBAL_2X_CLK_FMASK;
-		iowrite32(val, ipa->reg_virt + IPA_REG_CLKON_CFG_OFFSET);
-
 		/* Disable PA mask to allow HOLB drop */
 		val = ioread32(ipa->reg_virt + IPA_REG_TX_CFG_OFFSET);
 		val &= ~PA_MASK_EN_FMASK;
 		iowrite32(val, ipa->reg_virt + IPA_REG_TX_CFG_OFFSET);
+
+		/* Enable open global clocks in the CLKON configuration */
+		val = GLOBAL_FMASK | GLOBAL_2X_CLK_FMASK;
+	} else if (version == IPA_VERSION_3_1) {
+		val = MISC_FMASK;	/* Disable MISC clock gating */
+	} else {
+		val = 0;		/* No CLKON configuration needed */
 	}
+	if (val)
+		iowrite32(val, ipa->reg_virt + IPA_REG_CLKON_CFG_OFFSET);
 
 	ipa_hardware_config_comp(ipa);
 
-- 
2.27.0


  parent reply	other threads:[~2021-06-21 18:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 17:56 [PATCH net-next 0/6] net: ipa: add support for IPA v3.1 Alex Elder
2021-06-21 17:56 ` [PATCH net-next 1/6] dt-bindings: net: qcom,ipa: add support for MSM8998 Alex Elder
2021-06-21 17:56 ` [PATCH net-next 2/6] net: ipa: inter-EE interrupts aren't always available Alex Elder
2021-06-21 18:41   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` Alex Elder [this message]
2021-06-21 18:40   ` [PATCH net-next 3/6] net: ipa: disable misc clock gating for IPA v3.1 AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 4/6] net: ipa: FLAVOR_0 register doesn't exist until IPA v3.5 Alex Elder
2021-06-21 18:42   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 5/6] net: ipa: introduce gsi_ring_setup() Alex Elder
2021-06-21 18:42   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 6/6] net: ipa: add IPA v3.1 configuration data Alex Elder
2021-06-21 18:43   ` AngeloGioacchino Del Regno
2021-06-21 19:50 ` [PATCH net-next 0/6] net: ipa: add support for IPA v3.1 patchwork-bot+netdevbpf

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=20210621175627.238474-4-elder@linaro.org \
    --to=elder@linaro.org \
    --cc=agross@kernel.org \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@kernel.org \
    --cc=jamipkettunen@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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).