2021-05-05 23:23:50

by Alex Elder

[permalink] [raw]
Subject: Re: [PATCH v1 1/7] net: ipa: Add support for IPA v3.1 with GSI v1.0

On 2/11/21 11:50 AM, AngeloGioacchino Del Regno wrote:
> In preparation for adding support for the MSM8998 SoC's IPA,
> add the necessary bits for IPA version 3.1 featuring GSI 1.0,
> found on at least MSM8998.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>

Almost everything in this patch is the same as what is
now in the upstream code. There were minor differences,
such as using version < IPA_VERSION_4_0 rather than
version <= IPA_VERSION_3_5_1, and some comment changes.

In this patch there is one thing you had that I did not,
and I show it below.

> ---
> drivers/net/ipa/gsi.c | 8 ++++----
> drivers/net/ipa/ipa_endpoint.c | 17 +++++++++--------
> drivers/net/ipa/ipa_main.c | 8 ++++++--
> drivers/net/ipa/ipa_reg.h | 3 +++
> drivers/net/ipa/ipa_version.h | 1 +
> 5 files changed, 23 insertions(+), 14 deletions(-)
. . .

> diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
> index 84bb8ae92725..be191993fbec 100644
> --- a/drivers/net/ipa/ipa_main.c
> +++ b/drivers/net/ipa/ipa_main.c

. . .

> @@ -404,6 +405,9 @@ static void ipa_hardware_config(struct ipa *ipa)
> /* Enable open global clocks (not needed for IPA v4.5) */
> val = GLOBAL_FMASK;
> val |= GLOBAL_2X_CLK_FMASK;
> + if (version == IPA_VERSION_3_1)
> + val |= MISC_FMASK;
> +

This block of code is conditional on:
if (version >= IPA_VERSION_4_0 && version < IPA_VERSION_4_5)

Therefore adding the MISC_FMASK here won't ever happen. (It's
possible the code you were working with had some different
logic.)

I do, however, see in the msm-4.4 code that IPA v3.1 enables
the CLKON_CFG CGC_OPEN_MISC bit (only), stating that it's a
workaround. So I will update the logic and add this.

-Alex

> iowrite32(val, ipa->reg_virt + IPA_REG_CLKON_CFG_OFFSET);
>
> /* Disable PA mask to allow HOLB drop */

. . .