net: ipa: implement MAX_READS_BEATS QSB data
authorAlex Elder <elder@linaro.org>
Sat, 20 Mar 2021 15:57:04 +0000 (10:57 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 Mar 2021 01:56:18 +0000 (18:56 -0700)
Starting with IPA v4.0, a limit is placed on the number of bytes
outstanding in a transaction, to reduce latency.  The limit is
imposed only if this value is non-zero.

We don't use a non-zero value for SC7180, but newer versions of IPA
do.  Prepare for that by allowing a programmed value to be specified
in the platform configuration data.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_data-sc7180.c
drivers/net/ipa/ipa_data.h
drivers/net/ipa/ipa_main.c

index 216f790..8fa10d0 100644 (file)
@@ -14,6 +14,7 @@ static const struct ipa_qsb_data ipa_qsb_data[] = {
        [IPA_QSB_MASTER_DDR] = {
                .max_writes     = 8,
                .max_reads      = 12,
+               /* no outstanding read byte (beat) limit */
        },
 };
 
index d50cd5a..4162c47 100644 (file)
@@ -59,10 +59,12 @@ enum ipa_qsb_master_id {
  * struct ipa_qsb_data - Qualcomm System Bus configuration data
  * @max_writes:        Maximum outstanding write requests for this master
  * @max_reads: Maximum outstanding read requests for this master
+ * @max_reads_beats: Max outstanding read bytes in 8-byte "beats" (if non-zero)
  */
 struct ipa_qsb_data {
        u8 max_writes;
        u8 max_reads;
+       u8 max_reads_beats;             /* Not present for IPA v3.5.1 */
 };
 
 /**
index 1ce593b..64b92df 100644 (file)
@@ -274,10 +274,16 @@ ipa_hardware_config_qsb(struct ipa *ipa, const struct ipa_data *data)
 
        /* Max outstanding read accesses for QSB masters */
        val = u32_encode_bits(data0->max_reads, GEN_QMB_0_MAX_READS_FMASK);
-       /* GEN_QMB_0_MAX_READS_BEATS is 0 (IPA v4.0 and above) */
-       if (data->qsb_count > 1)
+       if (ipa->version >= IPA_VERSION_4_0)
+               val |= u32_encode_bits(data0->max_reads_beats,
+                                      GEN_QMB_0_MAX_READS_BEATS_FMASK);
+       if (data->qsb_count > 1) {
                val |= u32_encode_bits(data1->max_reads,
                                       GEN_QMB_1_MAX_READS_FMASK);
+               if (ipa->version >= IPA_VERSION_4_0)
+                       val |= u32_encode_bits(data1->max_reads_beats,
+                                              GEN_QMB_1_MAX_READS_BEATS_FMASK);
+       }
        iowrite32(val, ipa->reg_virt + IPA_REG_QSB_MAX_READS_OFFSET);
 }