OSDN Git Service

net: ipa: disable misc clock gating for IPA v3.1
authorAlex Elder <elder@linaro.org>
Mon, 21 Jun 2021 17:56:24 +0000 (12:56 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2021 19:30:59 +0000 (12:30 -0700)
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>
Acked-by: AngeloGioacchino Del Regno
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_main.c

index f82130d..20a83c7 100644 (file)
@@ -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);